Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Two LaTeX questions (boldmath section header and math symbol spacing)

796 views
Skip to first unread message

MyMichelle

unread,
Sep 27, 2006, 1:52:15 PM9/27/06
to
Hi everyone - I have a couple of LaTeX-related questions, and it would
be really great if someone could help me out:

(1) I have this problem with using mathematical symbols in my section
titles, because they don't come out bold in the section header. If I
use boldmath, then they come out bold in the table of contents, which I
don't want for subsections. Is there a way around this that doesn't
involve editing the .toc file?

(2) I have expressions like $<3$ where LaTeX is putting too much space
between the < and 3. Is there an easy way to compress this that
doesn't involve hacking the spacing? (Same with $-3$ where it treats
it like a subtraction sign rather than a minus sign).

Thanks a lot!

Maarten Bergvelt

unread,
Sep 27, 2006, 2:02:44 PM9/27/06
to
In article <1159379535....@i42g2000cwa.googlegroups.com>,
MyMichelle wrote:

> (2) I have expressions like $<3$ where LaTeX is putting too much space
> between the < and 3. Is there an easy way to compress this that
> doesn't involve hacking the spacing? (Same with $-3$ where it treats
> it like a subtraction sign rather than a minus sign).

This has to do with the "mathematical symbol type" of <, -, see for
instance the Latex Companion.

\documentclass{amsart}
\begin{document}
$<3$, $-3$, ${<}3$ $2-3$.
\end{document}

I don't see the problem with $-3$.

--
Maarten Bergvelt

Ralf Stubner

unread,
Sep 27, 2006, 2:54:42 PM9/27/06
to
"MyMichelle" <mymich...@yahoo.com> writes:

> (1) I have this problem with using mathematical symbols in my section
> titles, because they don't come out bold in the section header. If I
> use boldmath, then they come out bold in the table of contents, which I
> don't want for subsections. Is there a way around this that doesn't
> involve editing the .toc file?

It is easy to achieve this with a KOMA Script class:

\documentclass[chapterprefix]{scrbook}
\addtokomafont{sectioning}{\rmfamily\boldmath}
\begin{document}
\tableofcontents
\chapter{Abc $y=x$}
def
\section{ghi $y=x$}
jkl
\subsection{ghi $y=x$}
jkl
\end{document}


Note that 'chapterprefix' and '\rmfamily' are only used to make scrbook
look similar to the default book.cls (at least at first sight).

Please also note that bold symbols in section headings are always a bit
dangerous since in mathematics bold symbols often have a different
meaning.

cheerio
ralf

Robin Fairbairns

unread,
Sep 27, 2006, 3:20:04 PM9/27/06
to
"MyMichelle" <mymich...@yahoo.com> writes:
>Hi everyone - I have a couple of LaTeX-related questions, and it would
>be really great if someone could help me out:
>
>(1) I have this problem with using mathematical symbols in my section
>titles, because they don't come out bold in the section header. If I
>use boldmath, then they come out bold in the table of contents, which I
>don't want for subsections. Is there a way around this that doesn't
>involve editing the .toc file?

my first guess:

{\boldmath\section{$e^{i\pi}+1=0$}}

seems to do the job.
--
Robin Fairbairns, Cambridge

Peter Flynn

unread,
Sep 27, 2006, 4:55:42 PM9/27/06
to
MyMichelle wrote:
> [...] Same with $-3$ where it treats

> it like a subtraction sign rather than a minus sign).

What's the difference between a subtraction sign and a minus sign?

///Peter

Jean-Côme Charpentier

unread,
Sep 27, 2006, 5:09:01 PM9/27/06
to
Peter Flynn a écrit :

I suppose you don't want a mathematical explanation :-)
For TeX, a substraction sign is a BIN(ary symbol) and a minus sign is
an ORD(inary symbol). That makes a difference about spaces around.
Maybe I don't understand the question. Would you know how TeX knows
that "-" is either a substration sign or a minus sign?

Jean-Côme Charpentier

Peter Flynn

unread,
Sep 27, 2006, 5:24:35 PM9/27/06
to

I suspected it might be that...just my ignorance as a non-mathematician.
One performs a function, the other just expresses negativeness.

///Peter

Dan

unread,
Sep 28, 2006, 1:37:21 PM9/28/06
to

TeX follows the rules in Appendix G of the TeXbook. A minus sign
is initially added to a <math list> as a <math atom> of type Bin.
Then TeX reprocesses that list, converting it to "boxes and glue"
according to those rules.

Rule 5 says: "...if this was the first atom in the [current math]
list, or the most recent previous item was Bin, Op, Rel, Open or
Punct, change the Bin to Ord..."

And rule 6 says: "If the current atom is a Rel or Close or Punct,
and if the most recent previous atom was Bin, change that
previous Bin to Ord."

And finally, between rules 18 and 19 is the comment that if the
last atom in a list is Bin, it is changed to Ord. (Why doesn't
this deserve a number?)

Thus, in math mode, the following minus signs become Ords:
-- first in list: {-x},
-- last in list {x-}
-- preceded by Bin, Op, Rel, Open or Punct:
x+-y, \sum-x, y =-x, (-x), (y,-x)
-- followed by Rel, Close or Punct:
x-=y, (x-), (x-,y)

Between Bin and Ord there is \medmuskip. Between Ord and Ord
there is no space (except maybe italic correction). So the changes
from Bin to Ord cause no spaceto appear between "-" and "x". This
is the typographical convention for a negative x. If it stays a Bin,
that
space appears, which is the convention for subtraction. The actual
font glyph used is the same (though usually different from a hyphen
or an ndash).


Dan

Alberto L

unread,
Sep 30, 2006, 1:16:25 PM9/30/06
to

>>>>> "MyMichelle" == MyMichelle <mymich...@yahoo.com> wrote:

MyMichelle> Hi everyone - I have a couple of LaTeX-related questions,
MyMichelle> and it would be really great if someone could help me out:

MyMichelle> (1) I have this problem with using mathematical symbols in
MyMichelle> my section titles, because they don't come out bold in the
MyMichelle> section header. If I use boldmath, then they come out
MyMichelle> bold in the table of contents, which I don't want for
MyMichelle> subsections. Is there a way around this that doesn't
MyMichelle> involve editing the .toc file?

I use the following:

\makeatletter
\DeclareRobustCommand\bfseries{%
\not@math@alphabet\bfseries\mathbf
\fontseries\bfdefault\selectfont\boldmath}
\makeatother

Greetings,
--
Alberto

0 new messages