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 }
                                                
?   

1 Answer 1

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}
8
  • Isn't \boldsymbol deprecated? How do I also expnad and thicken the text? Thanks.
    – shmuel
    Jun 30, 2021 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, 2021 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, 2021 at 16:18
  • In addition to p.13 of the documentation at <ctan.mirrors.hoobly.com/macros/unicodetex/latex/unicode-math/…>, I got two hits searching for 'boldsymbol deprecated. I have no idea how seriously to take them.
    – shmuel
    Jul 1, 2021 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 1, 2021 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.