I am trying to use system font for LaTeX. I am able to do it for text but not for the math part. Here is an example (compiled using XeLaTeX), where I use the font "Broadway", but it doesn't work for the math part. Any suggestion for how to define the font for the math part?
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[xetex]{graphicx}
\usepackage{fontspec,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont[Scale=.95]{Broadway}
\setmonofont{Broadway}
\begin{document}
This is the formula for $(a+b)^2$
\begin{equation}
(a+b)^2=a^2+2ab+b^2
\end{equation}
\end{document}
I found alternate ways from The LaTex Font Catalogue.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{concmath}
\usepackage[T1]{fontenc}
\begin{document}
This is the formula for $(a+b)^2$
\begin{equation}
(a+b)^2=a^2+2ab+b^2
\end{equation}
\end{document}
I was looking for typewritter font and "concmath" is a good one and also provides math support. But I am more interested in courier font which is also available in catalogue
\usepackage{courier}
\renewcommand*\ttdefault{lcmtt}
\renewcommand*\familydefault{\ttdefault}
\usepackage[T1]{fontenc}
But now the maths appears in Roman. Is there any possible way to make the math part use the courier font. I am not sure if it can be done by modifying the corresponding .sty file somehow or if there is any other better way. All I am trying to do is to make the math part use the same font (for the text part only, not for the symbol) as text without any italic or bold.
inputenc
with xetex. Beside this: You can use a textfont for some special chars in math, but textfonts can't be used to replace all math. Math fonts need much more internal structure.inputenc
. You should also avoid font packages meant forpdflatex
, look for xelatex solutions. And no: courier too is a text font and you can't use it simply for math (beside the fact that it will look horrible. courier is a typewriter font).\usepackage[italic]{mathastext}
in case you don't find some math font which fits with your text font. However, this is only for the Latin letters, so if you useXeLaTeX
then go withmathspec
as the first choice. (withmathastext
thefontspec
package must be loaded with optionno-math
)