[XeTeX] Reset bold, italic or small-caps to "normal"

Ross Moore ross at ics.mq.edu.au
Tue Mar 31 01:55:12 CEST 2009


Hi Andy,

On 31/03/2009, at 10:16 AM, Andy Black wrote:

> I'm normal,
> {\textbf{I'm bold}},
> {\textit{I'm italic}},
> {\textit{\textbf{I'm bold and italic}}}, and
> {\textit{\textbf{Bold-italic {I'm an embedded normal} bold-italic}}}.

You need something like this:

{\textit{\textbf{Bold-italic {\upshape\mdseries I'm an embedded  
normal} bold-italic}}}.

\upshape  effectively cancels italics
\mdseries effectively cancels bold-face

or you could use \textup  and \textmd .


But personally, I think you will find that using the
commands:  \textbf \textit \textup \textmd , etc.
is actually not the best approach for the kind of application
that you have.

Try the following example:

   {\textit{I'm italic \verb|\relax|}}

which might well be produced by your XML transformations.
It's actually invalid LaTeX, as the resulting console messages
will tell you.

However, this works fine:

   {\itshape I'm italic \verb|\relax|}

The reason for the difference in behaviour relates to
the dual usage of {...}, for:
   1. limiting the scope of typesetting styles;
   2. capturing arguments to be passed to functions.
I'll not offer any deeper explanations here.


With nested objects, you want: e.g.,

{\itshape {\bfseries Bold-italic {\upshape\mdseries I'm an embedded  
normal} bold-italic}}.


>
>
> What I'm wondering is this: is there is a way to tell XeLaTeX to use
> "normal" rather than bold or italic for the "I'm an embedded normal"
> portion?  I see that there is \textnormal, but it uses the main  
> document
> font and there is no guarantee that the main document font will be the
> correct one in the context.

Good point --- so use \mdseries  to adjust the weight
and  \upshape  to specify the slant, without changing
the actual font family being used.

>
> Thanks for any help you can give on this,
>
> --Andy


------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list