Discussion:
pdf output of boldsymbol math does not work
Oscar Lopez
2008-03-03 14:44:04 UTC
Permalink
Dear all

It seems that pdf output of boldsymbol math does not show properly when the
command \boldsymbol is used. I am using lyx-1.5.4 (compiled version using
kubuntu and texlive)

Open a new document (article) enter a math inset with \boldsymbol* an enter a
letter \boldsymbol{a} \boldsymbol{\alpha}. Then, View->PDF (pdflatex) the math
fonts are not bold faced. The culprit seems to be the \usepackage{mathptmx}
included by lyx at preamble. Adding \usepackage{bm} creates a quasi bold face
math both by shifting slightly the font (the looking using a zoom is poor)
However, if the package mathptmx is not loaded and only the bm package is
loaded, the Computer Modern where the bold symbols are present will be used,
which is the correct way to go.

Is there anybody experiencing something similar?
Is there any work around to avoid the automatic insertion by lyx of the mathptmx
package? What is the recommended way to produce math boldsymbols using the
current version of lyx?

Sorry if I missed something evident I have checked through the archives and I
didn't find anything related to this problem.

Thank you very much for your help
Best regards

* By the way when \boldsymbold{ is typed a box is created and left and right
braces are also created which imho is confussing.
Paul A. Rubin
2008-03-03 16:54:11 UTC
Permalink
Post by Oscar Lopez
Dear all
It seems that pdf output of boldsymbol math does not show properly when the
command \boldsymbol is used. I am using lyx-1.5.4 (compiled version using
kubuntu and texlive)
Open a new document (article) enter a math inset with \boldsymbol* an enter a
letter \boldsymbol{a} \boldsymbol{\alpha}. Then, View->PDF (pdflatex) the math
fonts are not bold faced. The culprit seems to be the \usepackage{mathptmx}
included by lyx at preamble. Adding \usepackage{bm} creates a quasi bold face
math both by shifting slightly the font (the looking using a zoom is poor)
However, if the package mathptmx is not loaded and only the bm package is
loaded, the Computer Modern where the bold symbols are present will be used,
which is the correct way to go.
Is there anybody experiencing something similar?
Is there any work around to avoid the automatic insertion by lyx of the mathptmx
package? What is the recommended way to produce math boldsymbols using the
current version of lyx?
Sorry if I missed something evident I have checked through the archives and I
didn't find anything related to this problem.
Thank you very much for your help
Best regards
* By the way when \boldsymbold{ is typed a box is created and left and right
braces are also created which imho is confussing.
Apparently, as of a recent version, LyX loads mathptmx automatically if
you select Times Roman as your Roman font. Since mathptmx has no bold
symbols, I can see this being a problem, and I'm surprised it was done.
In the short term, the workarounds are either to switch your font to
something else or to export to LaTeX, manually edit out the
\usepackage{mathptmx} line and then manually compile the document.

Perhaps a developer can address why the change was made?

As far as the braces are concerned, LyX is interpreting your typing of
'\boldsymbol{' as requesting both a bold symbol and a set of braces.
Try '\boldsymbol ' (note the space at the end).

/Paul
Jürgen Spitzmüller
2008-03-03 17:01:28 UTC
Permalink
Post by Paul A. Rubin
Apparently, as of a recent version, LyX loads mathptmx automatically if
you select Times Roman as your Roman font.  Since mathptmx has no bold
symbols, I can see this being a problem, and I'm surprised it was done.
  In the short term, the workarounds are either to switch your font to
something else or to export to LaTeX, manually edit out the
\usepackage{mathptmx} line and then manually compile the document.
Perhaps a developer can address why the change was made?
Short answer:
http://tug.ctan.org/get/info/l2tabu/english/l2tabuen.pdf
(sec. 2.3.1)

Jürgen
Oscar Lopez
2008-03-03 17:28:33 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Paul A. Rubin
Apparently, as of a recent version, LyX loads mathptmx automatically if
you select Times Roman as your Roman font. Since mathptmx has no bold
symbols, I can see this being a problem, and I'm surprised it was done.
In the short term, the workarounds are either to switch your font to
something else or to export to LaTeX, manually edit out the
\usepackage{mathptmx} line and then manually compile the document.
Perhaps a developer can address why the change was made?
http://tug.ctan.org/get/info/l2tabu/english/l2tabuen.pdf
(sec. 2.3.1)
But as Paul has pointed out mathptmx has no bold symbols. Therefore lyx has to
load something to the preamble in the case math boldsymbols are required. Either
a \usepackage{bm} together with \usepackage{mathptmx} are added or only
\usepackage{bm} is loaded. Please note that the first solution produces math
boldsymbols with poor quality while the second uses Computer Modern fonts.

Best regards
Jürgen Spitzmüller
2008-03-03 17:40:02 UTC
Permalink
Post by Oscar Lopez
But as Paul has pointed out mathptmx has no bold symbols. Therefore lyx has
to load something to the preamble in the case math boldsymbols are
required. Either a \usepackage{bm} together with \usepackage{mathptmx} are
added or only \usepackage{bm} is loaded. Please note that the first
solution produces math boldsymbols with poor quality while the second uses
Computer Modern fonts.
from psnfss2e.pdf:

"There are no bold math fonts [in mathptmx], and \boldmath has no effect. Use
of the package bm in conjunction with mathptmx is not recommended."

The reason is that there are no free bold math fonts available (yet) that
match Times Roman. In the past, LyX simply loaded the computer modern math
fonts. However, this is bad typography -- we have mixed fonts that do not
match at all.

Conclusion: if you need bold math characters, Times Roman is not a good choice
(if you insist on mixing fonts that do not match, you can still load Times
Roman as roman font only with

\def\rmdefault{ptm}

which is still better than \usepackage{times}).

Jürgen
Jürgen Spitzmüller
2008-03-03 17:51:12 UTC
Permalink
Post by Jürgen Spitzmüller
Conclusion: if you need bold math characters, Times Roman is not a good
choice (if you insist on mixing fonts that do not match, you can still load
Times Roman as roman font only with
\def\rmdefault{ptm}
which is still better than \usepackage{times}).
There's also the following hack:

\usepackage{amsmath}
\renewcommand\boldsymbol[1]{\pmb{#1}}

This fakes bold symbols by means of overprinting. Not very nice either.

Jürgen
G. Milde
2008-03-04 08:24:09 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Jürgen Spitzmüller
Conclusion: if you need bold math characters, Times Roman is not a good
choice (if you insist on mixing fonts that do not match, you can still
set the fonts to "default" in the Settings>Document>Fonts selection
boxes and in the LaTeX preamble
Post by Jürgen Spitzmüller
Post by Jürgen Spitzmüller
load Times Roman as roman font only with
\def\rmdefault{ptm}
which is still better than \usepackage{times}).
\usepackage{amsmath}
\renewcommand\boldsymbol[1]{\pmb{#1}}
This fakes bold symbols by means of overprinting. Not very nice either.
But it might still be better than silently dropping the "bold"
attribute of symbols.

The question is: Given a document with DefaultFont==Times and use of
\boldsymbol, whether LyX should

a) implement this fallback
* always
* if Use AMS == auto or always
* if Use AMS == always

b) recommend it in the docs

c) mention it in the docs


Günter
Bruce Pourciau
2008-03-03 19:25:50 UTC
Permalink
Post by Oscar Lopez
Post by Jürgen Spitzmüller
Post by Paul A. Rubin
Apparently, as of a recent version, LyX loads mathptmx
automatically if
you select Times Roman as your Roman font. Since mathptmx has no bold
symbols, I can see this being a problem, and I'm surprised it was done.
In the short term, the workarounds are either to switch your font to
something else or to export to LaTeX, manually edit out the
\usepackage{mathptmx} line and then manually compile the document.
Perhaps a developer can address why the change was made?
http://tug.ctan.org/get/info/l2tabu/english/l2tabuen.pdf
(sec. 2.3.1)
But as Paul has pointed out mathptmx has no bold symbols. Therefore lyx has to
load something to the preamble in the case math boldsymbols are required. Either
a \usepackage{bm} together with \usepackage{mathptmx} are added or only
\usepackage{bm} is loaded. Please note that the first solution
produces math
boldsymbols with poor quality while the second uses Computer Modern fonts.
Best regards
If you don't _have_ to use Times, why not choose Palatino? It is a
beautiful face, unlike Times. I'm happy as a clam -- boldface and all
-- with \usepackage[osf]{mathpazo} in the preamble.

Bruce
Paul A. Rubin
2008-03-03 22:32:06 UTC
Permalink
Post by Bruce Pourciau
If you don't _have_ to use Times, why not choose Palatino? It is a
beautiful face, unlike Times. I'm happy as a clam -- boldface and all --
with \usepackage[osf]{mathpazo} in the preamble.
How well does that work with PDF files?

One reason I use Times/Helvetica/Courier (the obsolete packages document
notwithstanding) is that they are Adobe-native fonts. They may not be
the most aesthetically pleasing (I have no eye for typefaces in any
case), but they work pretty reliably with PDF files, and almost
everything I generate ends up in PDF files. Assuming I'm using Times,
if I have to choose between a close match between the math and text
fonts or having bold symbols, I'll typically take the bold symbols. I
don't produce books, and for pretty much everything else Times without
mathptmx seems good enough to me.

On the other hand, I recognize that there are folks who will want
mathptmx when they use Times, and won't need bold symbols. It would be
nice if there were a way in the document settings to select/deselect
mathptmx, though.

/Paul
David A. Case
2008-03-04 01:56:04 UTC
Permalink
Assuming I'm using Times, if I have to choose between a close match
between the math and text fonts or having bold symbols, I'll typically
take the bold symbols.
I think the choice is between a good match between math and text, but
(somewhat) inferior bold Greek letters and other math symbols (bold
Roman letters are fine),

versus

a poorer match between math and text, with (somewhat) better quality bold
Greek letters and math symbols.

As has been pointed out, the mathpazo package doesn't have this problem, but I
find that its distinction between bold and non-bold Greek letters is too
subtle for my aging eyes. Using the mathptmx and bm packages makes a bigger
distinction here, and also uses the Adobe symbol font, which is (to me) more
pleasing and is less likely to lead to font problems in PDF files.

Of course, there is no "right" or "wrong" answer here. A lot depends on how
heavily one uses bold math constructs, and what "looks good"!

...dave case
G. Milde
2008-03-04 08:33:35 UTC
Permalink
... if I have to choose between a close match between the math and text
fonts or having bold symbols, I'll typically take the bold symbols. I
don't produce books, and for pretty much everything else Times without
mathptmx seems good enough to me.
On the other hand, I recognize that there are folks who will want
mathptmx when they use Times, and won't need bold symbols. It would be
nice if there were a way in the document settings to select/deselect
mathptmx, though.
IMO, LyX should support the "officially recommended" version (i.e. mathptmx)
in the Document>Settings>Fonts Tab.

Other (deprecated as well as exotic or just still not supported) choices
can be done choosing "Default" in the Fonts tab and LaTeX commands in the
Documents>Settings>LaTeX preamble.

E.g. I am using \usepackage{libertine}

Günter
Bruce Pourciau
2008-03-04 13:40:12 UTC
Permalink
Post by Paul A. Rubin
Post by Bruce Pourciau
If you don't _have_ to use Times, why not choose Palatino? It is a
beautiful face, unlike Times. I'm happy as a clam -- boldface and
all -- with \usepackage[osf]{mathpazo} in the preamble.
How well does that work with PDF files?
Perfectly. I use TeXShop to view pdf files, and I've never had a
problem with mathpazo. The math, text, bold, and Greek all match nicely.
Post by Paul A. Rubin
One reason I use Times/Helvetica/Courier (the obsolete packages
document notwithstanding) is that they are Adobe-native fonts.
They may not be the most aesthetically pleasing (I have no eye for
typefaces in any case), but they work pretty reliably with PDF
files, and almost everything I generate ends up in PDF files.
Assuming I'm using Times, if I have to choose between a close match
between the math and text fonts or having bold symbols, I'll
typically take the bold symbols. I don't produce books, and for
pretty much everything else Times without mathptmx seems good
enough to me.
On the other hand, I recognize that there are folks who will want
mathptmx when they use Times, and won't need bold symbols. It
would be nice if there were a way in the document settings to
select/deselect mathptmx, though.
/Paul
Oscar Lopez
2008-03-03 17:18:15 UTC
Permalink
Post by Paul A. Rubin
Apparently, as of a recent version, LyX loads mathptmx automatically if
you select Times Roman as your Roman font. Since mathptmx has no bold
symbols, I can see this being a problem, and I'm surprised it was done.
Yes I didn't expect this behaviour, too.
Post by Paul A. Rubin
In the short term, the workarounds are either to switch your font to
something else or to export to LaTeX, manually edit out the
\usepackage{mathptmx} line and then manually compile the document.
Ok, the first workaround seems to me more versatile at least I do not have
particular constraints related to font choice.
Post by Paul A. Rubin
Perhaps a developer can address why the change was made?
I have been using lyx since version 1.2.x and this caught me by surprise.
Post by Paul A. Rubin
As far as the braces are concerned, LyX is interpreting your typing of
'\boldsymbol{' as requesting both a bold symbol and a set of braces.
Try '\boldsymbol ' (note the space at the end).
Thanks Paul for your promptly and helpful answer.

Best regards
Loading...