(If I remember correctly this was not a problem with the old font selection
scheme. I think you didn't have to put the italics in an \mbox then, and
then it would scale automatically within math mode.)
Bjorn Lisper bjo...@tds.kth.se
I sometimes want words typeset in italics in math formulas. To achieve this
in LaTeX I use \mboxes, like $...\mbox{\it ...} ...$. However, if I put the
\mbox as sub- or superscript the text size stays the same! I assume this is
an effect of LaTeX temporarily leaving math mode within the \mbox. Can
anyone propose a solution how to achieve "automatic" scaling of italic text
in math mode? What I would need is, say, a macro "\mathitalic" whose
argument would be typeset in italics of correct size wherever it appears in
a math formula.
There is such a thing. the \text command is defined in the amstext
style option that is part of the AMS-LaTeX package.
(If I remember correctly this was not a problem with the old font selection
scheme. I think you didn't have to put the italics in an \mbox then, and
then it would scale automatically within math mode.)
No, it would never scale.
--
Rainer Schoepf
Konrad-Zuse-Zentrum ,,Ich mag es nicht, wenn
fuer Informationstechnik Berlin sich die Dinge so frueh
Heilbronner Strasse 10 am Morgen schon so
D-1000 Berlin 31 dynamisch entwickeln!''
Federal Republic of Germany
<Sch...@sc.ZIB-Berlin.dbp.de> or <Sch...@sc.ZIB-Berlin.de>
Huh? Sure it would. All you need to do to get italicized words is
to type, e.g., {\it last\_value} in math mode. No \mbox
necessary. \mbox (or \text) is only necessary when one is
emulating text mode within a formula, e.g., to type something
like "for every", etc.
The {\it ...} trick works under every LaTeX font selection scheme
I've ever used (and it better since it _is_ documented--albeit
tangentially--in the LaTeX manual).
-dh
--
Don Hosek | To retrieve files from ymir via the mailserver,
dho...@ymir.claremont.edu | send a message to mail...@ymir.claremont.edu
Quixote Digital Typography | with a line saying send [DIRECTORY]FILENAME
714-621-1291 | where DIRECTORY is the FTP directory (sans
---------------------------+ "anonymous") and FILENAME is the filename, e.g.
"send [tex]00readme.txt". There is a list of files in each directory under the
name 00files.txt. Binary files are not available by this technique.
>>> I sometimes want words typeset in italics in math formulas. To achieve this
>>> in LaTeX I use \mboxes, like $...\mbox{\it ...} ...$. However, if I put the
>>> \mbox as sub- or superscript the text size stays the same!
....
>>> (If I remember correctly this was not a problem with the old font selection
>>> scheme. I think you didn't have to put the italics in an \mbox then, and
>>> then it would scale automatically within math mode.)
>> No, it would never scale.
>Huh? Sure it would. All you need to do to get italicized words is
>to type, e.g., {\it last\_value} in math mode. No \mbox
>necessary. \mbox (or \text) is only necessary when one is
>emulating text mode within a formula, e.g., to type something
>like "for every", etc.
>The {\it ...} trick works under every LaTeX font selection scheme
>I've ever used (and it better since it _is_ documented--albeit
>tangentially--in the LaTeX manual).
So, have you ever used the new font selection scheme then? :-)
The problem with the "{\it ...} trick" under NFSS is that the "..." comes
out exactly as in math mode, i.e., without the surrounding "{\it }". The
"..." characters will look like stacked "math symbols", not like a single
word with correct ligatures, kerning etc. Under the old font selection
scheme, putting a text within {\it } in math mode would imply correct
kerning etc. Quite often this is desirable, e.g. if you have multi-character
"identifiers" in your math formulas. To achieve this under NFSS (and without
AMS-LaTeX), you must put the {\it ...} in a surrounding \mbox. But then you
lose the scaling if you want to put the stuff in sub- or superscripts...
Bjorn Lisper
I've got 200pp of a LaTeX manual written with the NFSS. I know.
Did you read the docs? I'll bet you a quarter that
(1) you are using newlfont instead of oldlfont for xxxlfont in
generating the LaTeX format or...
(1a) you specified newlfont as a document style option.
If you would read the documentation, you'd find that there is a
slight syntax change with this in effect and one types \it{...}
inside of math mode. This can be overridden by either selecting
oldfont or nomargid as a document style option. Read the docs for
more information.
-dh
>>>The {\it ...} trick works under every LaTeX font selection scheme
>>>I've ever used (and it better since it _is_ documented--albeit
>>>tangentially--in the LaTeX manual).
>> So, have you ever used the new font selection scheme then? :-)
>I've got 200pp of a LaTeX manual written with the NFSS. I know.
>Did you read the docs? I'll bet you a quarter that
>(1) you are using newlfont instead of oldlfont for xxxlfont in
> generating the LaTeX format or...
>(1a) you specified newlfont as a document style option.
>If you would read the documentation, you'd find that there is a
>slight syntax change with this in effect and one types \it{...}
>inside of math mode. This can be overridden by either selecting
>oldfont or nomargid as a document style option. Read the docs for
>more information.
So I tried the following, with newlfont as style option:
$...\it{varset}...$, according to your suggestion, and $...\mbox{\it
varset}...$. In the first case the kerning between characters is not OK,
since I want "varset" to be typeset as a single word. The second version
fixes this (but then I run into size problems in sub- and superscripts).
By the way, I goofed in my previous answer: this is not a problem related to
the NFSS, it is a problem in LaTeX in general (as opposed to plain TeX where
the "{\it ...} trick" works just fine). Sorry if that misled anyone.
Maybe AMSLaTeX is the answer then? What are the requirements to get it up
and running?
Bjorn Lisper
Apologies... I propogated a bit of misinformation regarding the
correct approach to getting the correct output with
NFSS/newlfont... LaTeX in general if one is using NFSS/oldlfont
or OFSS will work like plain TeX does with respect to {\it ...}
in math mode. LaTeX with NFSS/newlfont, however, requires an
extra step: you will need to specify in the preamble
\newmathalphabet\itmath
\addtoversion{normal}{\itmath}{cmr}{m}{it}
\addtoversion{bold}{\itmath}{cmr}{bx}{it}
or, if the effects of boldmath are not important,
\newmathalphabet*{\itmath}{cmr}{m}{it}
After the appropriate definition, one then uses \itmath{...} in
math mode for italics.
I don't normally use NFSS/newlfont, so I hadn't looked closely
enough at the docs to notice the error in my original posting.
-dh
Don Hosek
dho...@ymir.claremont.edu
Quixote Digital Typography
714-621-1291
The problem with the "{\it ...} trick" under NFSS is that the "..." comes
out exactly as in math mode, i.e., without the surrounding "{\it }". The
"..." characters will look like stacked "math symbols", not like a single
word with correct ligatures, kerning etc. Under the old font selection
scheme, putting a text within {\it } in math mode would imply correct
kerning etc. Quite often this is desirable, e.g. if you have multi-character
"identifiers" in your math formulas. To achieve this under NFSS (and without
AMS-LaTeX), you must put the {\it ...} in a surrounding \mbox. But then you
lose the scaling if you want to put the stuff in sub- or superscripts...
Two answers: AMS-LaTeX provides the \text command, which is similar to
\mbox, but scales correctly. Second, the correct way to do it is
\mathit{letters}
with margid style option,
and
{\mathit letters}
with nomargid (newlfont assumed in both cases).
Rainer Sch"opf