[OS X TeX] LaTeX macro question
Bruno Voisin
bvoisin at mac.com
Sun Aug 1 07:03:04 EDT 2004
Le 31 juil. 04, à 23:12, Thomas A.Schmitz a écrit :
> I was trying to write a very simple LaTeX package that would help me
> typeset some parts of my document in a special font: \Mf{blah} should
> be set in a special symbol font. So I had to define the command \Mf. I
> succeeded with some low-level TeX-stuff:
>
> \def\Mf#1{%
> \begingroup
> \fontfamily{newfont}\selectfont#1%
> \endgroup
> }
You could try simply:
\DeclareTextFontCommand{\Mf}{\fontfamily{newfont}\selectfont}
The syntax of this command is described (though not very explicitly) in
/usr/local/teTeX/share/texmf.tetex/doc/latex/base/fntguide.dvi, p. 9.
If you plan to write long fragments of text in that special font, you
might also want to define a new environment. I don't have the LaTeX
manual at hand, and don't remember whether the \begingroup \endgroup
commands are added automatically by \newenvironment; otherwise,
\newenvironment{myfont}%
{\begingroup\fontfamily{newfont}\selectfont}%
{\endgroup}
could do the job.
Hope this helps,
Bruno Voisin
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
More information about the MacOSX-TeX
mailing list