I'm working on a document with Xelatex so I use \fontspec
. I have set the monotype fonts with \setmonofont
to use Inconsolata, for example, in the urls of the bibliography. This minimal example shows it:
\documentclass[11pt,notitlepage,oneside,a4paper]{article}
\usepackage[backend=biber,style=authoryear,doi=true]{biblatex}
\usepackage{fontspec}
\usepackage{filecontents}
\setmonofont{Inconsolata}
\begin{filecontents}{biblio.bib}
@article{test,
author = {Author, A.},
year = {2015},
title = {Title},
journal = {Some Journal},
doi = {10.1016/S0169-8141(98)00038-9},
}
\end{filecontents}
\addbibresource{biblio.bib}
\usepackage[colorlinks=true,breaklinks]{hyperref}
\begin{document}
Lorem ipsum dolor \textcite{test}
\printbibliography
\end{document}
The result with the correct font is:
Then, I wanted to change the mathfont so I changed from \fontspec
to \mathspec
and added a \setmathfont
. Everything works fine with the math fonts except now the urls in my bibliography are typeset in that math font and not in Inconsolata
\documentclass[11pt,notitlepage,oneside,a4paper]{article}
\usepackage[backend=biber,style=authoryear,doi=true]{biblatex}
%\usepackage{fontspec}
\usepackage{mathspec}
\usepackage{filecontents}
\setmathfont(Digits,Latin,Greek)[Numbers={Lining,Monospaced}]{Alegreya Sans Light}
\setmonofont{Inconsolata}
\begin{filecontents}{biblio.bib}
@article{test,
author = {Author, A.},
year = {2015},
title = {Title},
journal = {Some Journal},
doi = {10.1016/S0169-8141(98)00038-9},
}
\end{filecontents}
\addbibresource{biblio.bib}
\usepackage[colorlinks=true,breaklinks]{hyperref}
\begin{document}
Lorem ipsum dolor \textcite{test}
\printbibliography
\end{document}
What's the problem? How can I set the math font and mantain Inconsolata as the monotype font?
Thanks for your help.
mathspec
– egreg Aug 17 '15 at 21:32