\newcommand{\mycos}{\mathop{\textrm{cos}}}
and I write
\bfseries $\mycos x$
then the "cos" will be bold in accordance with the surrounding environment
(the x will not, but that's another story).
Now my problem is with using the same thing superscripted (or subscripted).
If I write
$\textrm{a}^\textrm{b}$
the b is as large as the a which is ugly. I can manually fix this
by writing
$\textrm{a}^\textrm{\scriptsize b}$
and this looks just fine. But now suppose I want to put this in a macro and
use it everywhere:
\newcommand{\mymacro}{\textrm{a}^\textrm{\scriptsize b}}
However, if I now write
\footnotesize $\mymacro$
then the b is again too large: it is still in \scriptsize, because I manually
told it to be so. This is ugly because superscripts in a surrounding
\footnotesize environment are supposed to be in \scriptscriptsize.
How can I solve this, i.e., how can I define \mymacro so that the b always has
the appropriate size?
Thanks,
--Jan Van den Bussche
\usepackage{amstext}
...
$\textrm{a}^{\text{\textrm{b}}}$
--
Robin Fairbairns, Cambridge
simpler than that.
\usepackage{amstext}
....
$\textrm{a}^\textrm{b}$
Of course it is _wrong_ to abuse the system like this so that you get
bold in a nold environment. If you want a contect in which the text and
the math are both bold, go {\bfseries \boldmath ..... }
David
Something similar. I recently tried to typeset a few pages in sans serif,
including super/subscripts:
\sffamily\Large ... Na$^2+$ ...
There are a large number of chemical superscripts. What is the recommended
way of making the superscript also sans serif? Is there a package which
does that?
Volker
--
Volker Kuhlmann (v.kuh...@elec.canterbury.ac.nz)
.. Na\textsuperscript{2+}
(I would define a shorter alias.)
A more complete solution is to define a sans-serif "math version"
in analogy with boldmath... except that the sans versions of the
math italic fonts don't exist.
More practical is to employ \everymath{\fam\sffam}... but no \sffam in LaTeX.
So use this:
\newcommand\everymathfont[1]{\ensuremath{#1{\xdef\emfTemp
{\everymath{\fam\the\fam\relax}}}}\emfTemp
}
..
\large \sf \everymathfont{\mathsf}
Donald Arseneau as...@triumf.ca