4

When I type $RTD$ in LaTeX, in the output I am feeling like I am getting space between RT and D. Will it happen due to the format of letter D? Can it be avoided or we have to go with it?

  • 1
    Welcome to TeX.SE. In math mode, the string "RTD" is not processed as a single "word". Instead, TeX interprets it as a collection of three one-letter variables named "R", "T", and "D". As you've noticed, the spacing between letters in math mode is more open than in text mode. In the case at hand, though, "RTD" (an acronym, right?) should indeed be treated as as single entity. I therefore suggest you write either $...\textit{RTD}...$ (if you want italic letters) or $...\textrm{RTD}...$ (if you want upright letters) for this string. – Mico Sep 8 '15 at 9:54
  • Actually I need to use subscripts . Actual I want is $RTD_{estimated}$. If I use \textit{RTD_{estimated}} or \textrm{RTD_{estimated}}. I am getting compilation error. Can u please help – ramanan Sep 8 '15 at 10:03
  • 2
    @ramanan You probably want $...\mathit{RTD}_{\mathrm{estimated}}...$ – egreg Sep 8 '15 at 10:14
8

If “RTD” is the name of a single variable, then it should probably be typeset with \mathit. The “estimated” subscript, instead, should be upright, because it's not a “mathematical” subscript, but rather a word.

So you should be happy with

$\mathit{RTD}_{\mathrm{estimated}}=a+b$

If you type $RTD$ you indeed get “strange” spacing, which is not really so strange, because the expression is interpreted as the product of three quantities, unless TeX is told not to with \mathit.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

This is ugly:
\[
RTD_{estimated}=a+b
\]
This is bad:
\[
\mathit{RTD}_{estimated}=a+b
\]
This is good:
\[
\mathit{RTD}_{\mathrm{estimated}}=a+b
\]

\end{document}

enter image description here

In general, however, you shouldn't be using directly \mathit or \mathrm, as remarked by daleif; I suggest you to define

\newcommand{\mvar}[1]{\mathit{#1}}
\newcommand{\tsub}[1]{\mathrm{#1}}

and use

\mvar{RTD}_{\tsub{estimated}}

so you can change the style for your multiletter variables or textual subscripts at once by just modifying one line in the preamble.

If you often use a variable, you can also add something like

\newcommand{\RTD}{\mvar{RTD}}

so the input would be

\RTD_{\tsub{estimated}}

If the subscript “estimated” is frequent, you can also abbreviate input for it by adding

\newcommand{\est}{\tsub{estimated}}

so you can type

\RTD_{\est}
  • Why not RTD upright? Is it because it is treated as a variable? – daleif Sep 8 '15 at 10:28
  • @daleif My bet is that it's a variable; however, what style should be used also depends on overall style and habits in the specific research fields. – egreg Sep 8 '15 at 10:30
  • 1
    Which is why I always recommend users to use \RTD – daleif Sep 8 '15 at 10:32
  • @daleif good suggestion, I incorporated it. – egreg Sep 8 '15 at 10:38
  • I understand your example but I don't understand the use of italic or upright. So you say that a variable should be set italic and not a variable should be set upright. What would be an example for "not a variable"? Second, why is the superscript set upright? You said that it is not a “mathematical” subscript. I don't understand that. RTD is also not a mathematical symbol. – machinery Jul 5 '16 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.