I have created a few dozen macros, three of which I show here, for example.
\newcommand{\alphaactual}{$\alpha_\text{actual}$\index{a@$\alpha_\text{actual}$ (Actual Zero Sight Line Angle-Of-Attack)}}
\newcommand{\alphai}{$\alpha_\text{i}$\index{a@$\alpha_\text{i}$ (Zero Sight Line Angle-Of-Attack At Rollout)}}
\newcommand{\alphar}{$\alpha_\text{r}$\index{a@$\alpha_\text{r}$ (Zero Sight Line Angle-Of-Attack At Release)}}
From time to time, I place one of these macros inside of math mode. The following is one example of this:
$frac{\alphar}{17.45}$
Clearly, this causes an error, since it is equivalent to:
$\frac{ $\alpha_\text{r}$ }{17.45}$
I prefer to retain the opening and closing dollar signs, within the macro definition, to eliminate the need to type the dollar signs in paragraph mode.
Is there a method to persuade LaTeX to accept $frac{\alphar}{17.45}$?
Thank you.
General ⇒ Math Mode Question
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10320
- Joined: Mon Mar 10, 2008 9:44 pm
Math Mode Question
Hi Kurt,
you could use the
Stefan
you could use the
\ensuremath
command for your macros: latex2e.org/_005censuremath.htmlStefan
LaTeX.org admin
-
- Posts: 27
- Joined: Thu Feb 07, 2019 4:25 pm
Math Mode Question
Hi, Stefan.
Thank you for the elegant solution.
Regards,
Kurt
Thank you for the elegant solution.
Regards,
Kurt