2

In work that I write, I frequently have a big mathematical block that uses a lot of single-letter symbols. This is fine, and in fact the standard for the specific sub-field in question. My issue (it's not really an issue, but something that bugs me) is that in the normal text sections of the work I frequently mention some of these symbols. These are written so that they match the presentation of them in the mathematical block, which in practice means that I end up wrapping every mention of the symbol in an inline maths block. E.g. from something I'm currently writing:

At step \(k > 1\), ... \(b\) objects are removed, ... replaced with new \(b\) objects ... adding one further \(m\) object to \(M\).

In the instance above, the k > 1 should be inside an inline maths section in order to typeset it correctly, but it always feels a bit wrong to me to wrap all the single symbol references like \(b\) and \(M\) in an inline maths block, as that doesn't really seem like what maths mode is for.

Is there a recommend alternative way to get the same typesetting, without actually switching into math mode? I'm aware of the \textit command, but I'm not sure if that will always produce the same results as using maths mode - I imagine there might be some document class out there that will end making the two have different typesetting. Or should I simply use maths mode and not worry about it?

I couldn't find any guidance when I searched on this topic, though I may just not have searched on the correct terms. I'm currently using pdfLatex, so I assume that's Latex2e (I'm actually using the default in Overleaf), but I'm hoping that there's a fairly general answer to this.

Jarak
  • 391
  • 1
    there is no better alternative for math node. however, you can define new commands for set of variables and frequently used math expressions. – Zarko Apr 11 '19 at 23:26
  • 1
    @Zarko Would you be willing to write up what you mean as an answer, please? Or if there's already such an answer, could you please link to it? – Jarak Apr 11 '19 at 23:37
  • 2
    you can use $b$ instead of \(b\) which is the same thing and saves two keystrokes. \textit{b} selects a different font altogether. – David Carlisle Apr 11 '19 at 23:53
  • The first expression could/should be typeset as $k > 1,\dots b$. –  Apr 12 '19 at 00:06
  • As noted by @DavidCarlisle, $b$ selects a different font than \textit{b} (or, actually, $\mathit{b}$). What he d8dn't say is that, depending on the fonts used, the shapes may actually be different, and certainly the inter-letter spacing is different; the shape difference is usually slight, with the computer modern fonts being the model. – barbara beeton Apr 12 '19 at 00:23
  • @Zarko is right. If you have a command that you want to use without explicitly using math mode, you can define a new command. However, if your custom math command already contains $ that you will not need to write it in the text, then you will lose one editing advantage; that is, you will not be able to get the same highlighting that you typically get when using math mode. – Al-Motasem Aldaoudeyeh Apr 12 '19 at 01:18
  • I'm not really worried about the number of keystrokes. It's more that using math mode on a single letter doesn't really strike me as 'correct' use of math mode. Therefore, I was wondering if there was a different command that would ensure individual letters are typeset identically, without needing to go into math mode. Now that I think about it though, it probably wouldn't make sense to have a second option that replicates it. – Jarak Apr 12 '19 at 02:08
  • @Jarak It is true if and only if you type math variables in math mode. –  Apr 12 '19 at 02:59
  • 1
    @JouleV using math mode for single letters is correct usage (and there are numerous examples of this in the texbook and latexbook) – David Carlisle Apr 12 '19 at 07:42
  • @DavidCarlisle That sounds to me like an exact answer to my question. Could you please write it up as an answer so I can mark it as the correct answer? – Jarak Apr 12 '19 at 21:31
  • Related: https://tex.stackexchange.com/questions/444653/why-arent-all-math-functions-wrapped-in-ensuremath – Henri Menke Apr 14 '19 at 00:52

1 Answers1

3

You can use $b$ instead of \(b\) which is the same thing and saves two keystrokes. \textit{b} selects a different font altogether.

Using math mode for single letters is correct usage (and there are numerous examples of this in the TeXbook and LaTeX book) For example this is a small quotation from the source of the TeXBook:

the natural height~$x$ and the desired height~$w$, and based on the amounts of stretchability and shrinkability that happen to be present.

David Carlisle
  • 757,742