1

I designed a T-shirt in OpenOffice and wasn't happy with the rendering of a lower case Gamma. I tried doing it in LaTeX, and neither the formula nor the text is as visible as the OpenOffice version. The markup I'm using is:

\documentclass{article}
\usepackage{bm}
\usepackage[paperheight=10in,paperwidth=10in,top=0.75in, bottom=0in, left=0in, right=0in]{geometry}
\usepackage{graphicx}
\begin{document}
\pagestyle{empty}

\vspace{.5in}

\begin{center} {\Huge \bfseries Which part of} \end{center}

\vspace{1.75in}

{\Huge [ \bm{(\gamma^{\mu } (i\hbar \partial {\mu } - {\frac {e}{c}}A{\mu })-mc) \psi =0} ] }

\vspace{1.75in}

\begin{center} {\Huge \bfseries don't you understand?} \end{center} \end{document}

I tried

\documentclass{article}
\usepackage{unicode-math}
\usepackage[paperheight=10in,paperwidth=10in,top=0.75in, bottom=0in, left=0in, right=0in]{geometry}
\usepackage{graphicx}

\usepackage{newcomputermodern}

\setmainfont{NewCMMath-Book.otf}[ version=bold, FakeBold=2.0, FakeStretch = 1.1 ]

\setmathfont{NewCMMath-Book.otf}[ version=bold, FakeBold=2.0, FakeStretch = 1.1 ]

\pagestyle{empty} \begin{document}

\vspace{.5in}

\begin{center} {\Huge \bfseries Which part of} \end{center}

\vspace{1.75in}

{\Huge [ \boldsymbol{\gamma^{\mu } (i\hbar \partial {\mu } - {\frac {e}{c}}A{\mu })-mc) \psi =0} ] }

\vspace{1.75in}

and got

shmuel@linux-gn5l:~> latexmk -xelatex ~/Documents/Dirac
Rc files read:
  /etc/texmf/latexmk/latexmk.conf
Latexmk: This is Latexmk, John Collins, 17 Apr. 2020, version: 4.69a.
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': The following rules & subrules became out-of-date:
      'xelatex'
------------
Run number 1 of rule 'xelatex'
------------
------------
Running 'xelatex -no-pdf -recorder  "/home/shmuel/Documents/Dirac.tex"'
------------
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/TeX Live for opensuse.org) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(/home/shmuel/Documents/Dirac.tex
LaTeX2e 
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/unicode-math/unicode-math.sty
(/usr/share/texmf/tex/generic/iftex/ifxetex.sty
(/usr/share/texmf/tex/generic/iftex/iftex.sty))
(/usr/share/texmf/tex/generic/iftex/ifluatex.sty)
(/usr/share/texmf/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf/tex/latex/l3kernel/expl3-code.tex
(/usr/share/texmf/tex/latex/l3kernel/l3deprecation.def))
(/usr/share/texmf/tex/latex/l3backend/l3backend-xdvipdfmx.def))
(/usr/share/texmf/tex/latex/ucharcat/ucharcat.sty)
(/usr/share/texmf/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texmf/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texmf/tex/latex/fontspec/fontspec.sty
(/usr/share/texmf/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texmf/tex/latex/base/fontenc.sty
(/usr/share/texmf/tex/latex/base/tuenc.def))
(/usr/share/texmf/tex/latex/fontspec/fontspec.cfg)
! Undefined control sequence.
 \LaTeX3 error: 
                           Erroneous variable \c__fontspec_shape_n_n_tl used!
l.3806 \emfontdeclare{ \emshape, \eminnershape }

?

shmuel
  • 1,449

1 Answers1

3

That’s the bold font of Computer Modern. If you switch to LuaLaTeX or XeLaTeX, and you really want to do this to Computer Modern, you can use fontspec options to thicken and stretch the math font:

\documentclass{article}
\usepackage{unicode-math}
\usepackage[paperheight=10in,paperwidth=10in,top=0.75in, bottom=0in, left=0in, right=0in]{geometry}
\usepackage{graphicx}

\usepackage{newcomputermodern} \setmathfont{NewCMMath-Book.otf}[ version=bold, FakeBold=2.0, FakeStretch = 1.1 ]

\pagestyle{empty} \begin{document}

\vspace{.5in}

\begin{center} {\Huge \bfseries Which part of} \end{center}

\vspace{1.75in}

{\Huge [ \boldsymbol{\gamma^{\mu } (i\hbar \partial {\mu } - {\frac {e}{c}}A{\mu })-mc) \psi =0} ] }

\vspace{1.75in}

\begin{center} {\Huge \bfseries don't you understand?} \end{center} \end{document}

Davislor
  • 44,045
  • Isn't \boldsymbol deprecated? How do I also expnad and thicken the text? Thanks. – shmuel Jun 30 '21 at 15:19
  • @shmuel You would expand and thicken the text with \setmainfont{NewCM10-Bold}[FakeBold=...., FakeStretch=...] with your values of choice. This sets the main font; you would wrap the options in BoldFeatures={...} to keep using \bfseries. – Davislor Jun 30 '21 at 16:16
  • 1
    I haven’t heard anything about \boldsymbol from amsmath being deprecated. It’s completely compatible with either bm or unicode-math. – Davislor Jun 30 '21 at 16:18
  • In addition to p.13 of the documentation at https://ctan.mirrors.hoobly.com/macros/unicodetex/latex/unicode-math/unicode-math.pdf, I got two hits searching for 'boldsymbol deprecated. I have no idea how seriously to take them. – shmuel Jul 01 '21 at 12:46
  • Please see my edit. I tried puting the console log inside a pre tag pair and the formatting is strange; what is the correct way to mark it? Thanks. – shmuel Jul 01 '21 at 13:13
  • @shmuel \bm does some things better than \boldsymbol, but some other things are worse. (See https://tex.stackexchange.com/a/10643/82917) In general I concede that \bm is slightly better in the "important" things (e.g. with the italic correction) and therefore its pros win over the cons, but I wouldn't go as far as denoting \boldymbol as "deprecated". You should only keep in mind that the bm package does \let\boldsymbol\bm, so if you load bm after amsmath then you lose the difference. – campa Jul 01 '21 at 13:23
  • @shmuel Thanks for the ref. I use \boldsymbol in my own code, since I either want to compile with bm in PDFTeX or unicode-math , and that’s what works right in both. LaTeX will never drop support for it, and it gives the correct output. – Davislor Jul 01 '21 at 17:29
  • @shmuel There isn’t a newer synonym for it in unicode-math. If you want to avoid \boldsymbol, since you’re emboldening the entire equation, you could switch to \boldmath instead. – Davislor Jul 01 '21 at 17:31