1

Compiling with LuaLaTeX, use of Bradley Hand Font works for body and math using beamer; but I would like to know how to render Bradley Hand font for math using standard Article style. -Thanks.

%\documentclass[11pt]{article}
\documentclass{beamer} %
\usefonttheme{serif}%
 \usepackage{fontspec}
 \usepackage{mathpazo}
%\setmainfont{Bradley Hand ITC TT Bold}%used Bold, since that's what was bundled w/ Mac OS X
\setmainfont{BradleyHandITC} %Postscript name of TT added as user font on MacOS X
\begin{document}
\section{Section}
This is a font test. 
\[ E = m c^2 \] 
\[ L = \alpha \int_0^1 \, dx,  \quad  \vec{P} = \int_{0}^{\infty} \sum_{i =1}^{2} {\varphi}_i  d \gamma \]
\end{document}

enter image description here

However when I try to use article style, instead of beamer, the main text is rendered with the font, but the math is not.

\documentclass[11pt]{article} 
%\documentclass{beamer} 
%\usefonttheme{serif}%
 \usepackage{fontspec}
 \usepackage{mathpazo}
%\setmainfont{Bradley Hand ITC TT Bold}%used Bold, since that's what was bundled w/ Mac OS X
\setmainfont{BradleyHandITC} %Postscript name of TT added as user font on MacOS X

\begin{document}

\section{Section}
This is a font test. 
\[ E = m c^2 \] 
\[ L = \alpha \int_0^1 \, dx,  \quad  \vec{P} = \int_{0}^{\infty} \sum_{i =1}^{2} {\varphi}_i  d \gamma \]
\end{document}

enter image description here

An additional question. How to have only the \section{} and/or selected text use boldface Bradley Hand ITC TT Bold, instead of Regular. -Thanks.

3
  • Off-topic: The mathpazo package is very old and borderline obsolete. Do consider replacing \usepackage{mathpazo} with either \usepackage{newpxtext,newpxmath} or \usepackage{kpfonts}.
    – Mico
    Sep 2, 2022 at 22:58
  • -Mico, thanks for the edit and tips on fonts; I do like your suggestions better than mathpazo. It seems mathpazo works with Bradley Hand in Beamer, but not your suggestions. Likely need to reverse engineer Beamer font styles to understand what is being done there.
    – Lonny T
    Sep 2, 2022 at 23:21
  • To turn off Beamer font substitutions, load \usepackage[professionalfonts]{beamer}.
    – Davislor
    Sep 3, 2022 at 13:31

2 Answers 2

1

You can use the mathastext package to get the same behaviour as with beamer, i.e. the symbols in text mode are substituted with symbols from the normal text font:

% !TeX TS-program = lualatex 

\documentclass[11pt]{article} 
%\documentclass{beamer} 
%\usefonttheme{serif}%
 \usepackage{fontspec}
 \usepackage{mathpazo}
%\setmainfont{Bradley Hand ITC TT Bold}%used Bold, since that's what was bundled w/ Mac OS X
\setmainfont{Bradley Hand} %Postscript name of TT added as user font on MacOS X

\usepackage{mathastext}

\begin{document}

\section{Section}
This is a font test. 
\[ E = m c^2 \] 
\[ L = \alpha \int_0^1 \, dx,  \quad  \vec{P} = \int_{0}^{\infty} \sum_{i =1}^{2} {\varphi}_i  d \gamma \]
\end{document}

enter image description here

2
2

I'm not familiar with how the beamer document class does its font substitutions. But I can suggest that you load the unicode-math package and make use of its range machinery, along the lines of the following example.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article} 

\usepackage{unicode-math}
\setmainfont{Bradley Hand Bold} % what's bundled w/ MacOS
\setmathfont{KpMath-Regular}    % set a default math font
\setmathfont{Bradley Hand Bold}[range={up,it}]
%% unicode slots for int, sum, infty, = glyphs:
\setmathfont{Bradley Hand Bold}[range={"222B,"2211,"221E,"003D}] 

\begin{document}

\section{Section}
This is a font test. 
\[ 
E = mc^2, \quad
L = \alpha \int_0^{\,1} dx, \quad  
\vec{P} = \int_{0}^{\,\infty} \sum_{i=1}^2 \varphi_i \, d\gamma 
\]
\end{document}

Addendum: If one omits the final \setmathfont{Bradley Hand Bold}[...] directive in the code shown above, one would get:

enter image description here


Second Addendum: The OP also asked,

How to have only the \section and/or selected text use boldface Bradley Hand ITC TT Bold, instead of Regular?

Assuming you use one of the basic LaTeX document classes, i.e., article, report, or book, or a document class that is based on one of the basic classes, you could use the sectsty package to achieve your sectioning-related formatting objective. To use the Bradley Hand Bold font for selected pieces of text, I suggest you employ the \newfontfamily machinery of the fontspec package.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article} 

\usepackage{fontspec}
\newfontfamily{\bradley}{Bradley Hand Bold} % what's shipped with MacOS

\usepackage{sectsty}
\allsectionsfont{\bradley}

\begin{document}
\section{Hello}
\subsection{World}
Once upon a {\bradley time}, there {\bradley was} an enchanted castle \dots
\end{document}
6
  • Thanks for instructions on using Unicode. Is there a place where the different fonts available to Unicode are listed? For your example, is there a Unicode \setmathfont equivalent to " \usepackage{newpxtext,newpxmath}", instead of KpMath-Regular, as the math font might be preferable? thanks again.
    – Lonny T
    Sep 3, 2022 at 0:24
  • @LonnyT - I'm not aware of a place or document that lists all opentype text-mode and math-mode fonts. Please consult the user guides of the newpx[text/math] packages for information on how to load the associated fonts under LuaLaTeX (and XeLaTeX).
    – Mico
    Sep 3, 2022 at 3:25
  • Thanks, I will investigate.
    – Lonny T
    Sep 3, 2022 at 12:37
  • @LonnyT For that list, see Which OpenType Math Fonts are Available.
    – Davislor
    Sep 3, 2022 at 13:28
  • 1
    Rather than load an upright font as italic, I’d recommend loading \usepackage[math-style=upright]{unicode-math}, then loading the font as \setmathfont[range=up] (or whatever subset it supports).
    – Davislor
    Sep 3, 2022 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .