General ⇒ Math Mode Question
-
- Posts: 27
- Joined: Thu Feb 07, 2019 4:25 pm
Math Mode Question
\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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Math Mode Question
you could use the
\ensuremath
command for your macros: latex2e.org/_005censuremath.htmlStefan
-
- Posts: 27
- Joined: Thu Feb 07, 2019 4:25 pm
Math Mode Question
Thank you for the elegant solution.
Regards,
Kurt