1

With TeX Live 2016 and compiling with Lua on Fedora 27, the following code produces the incorrect font for the "doi" text.

% LuaLaTeX
\documentclass[10pt]{article}

%%% this fix is required to properly load my intended font
%%% see https://tex.stackexchange.com/questions/329593/fontspec-font-not-found-alegreyasans-package
\usepackage[no-math]{fontspec}
\makeatletter
\let\fontspec@setsansfont\setsansfont
\def\setsansfont{%
  \let\Alegreya@boldstyle\AlegreyaSans@boldstyle
  \let\setsansfont\fontspec@setsansfont
  \setsansfont
}
\makeatother
%%% end of fix

\usepackage[osf,sfdefault]{AlegreyaSans}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\addbibresource{bib.bib}
\urlstyle{same}

\begin{filecontents}{bib.bib}

@article{one,
    author          = {John Doe},
    title           = {Title},
    journaltitle    = {Journal},
    year            = {2000},
    volume          = {1},
    pages           = {2},
    doi            = {11.1111/abc.1111}
}

\end{filecontents}

\addbibresource{bib.bib}
\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

How might I go about fixing this? All fixes I've found refer only to the font of the doi number itself, not the actual "doi" text.

2

I don't know about TeX Live 2016, but with TeX Live 2018 the AlegreyaSans package fails to set Alegreya Sans as the main font.

Adding a couple of fixes should solve the issue.

\begin{filecontents}{\jobname.bib}
@article{one,
    author          = {John Doe},
    title           = {Title},
    journaltitle    = {Journal},
    year            = {2000},
    volume          = {1},
    pages           = {2},
    doi            = {11.1111/abc.1111}
}
\end{filecontents}

\documentclass[10pt]{article}

%%% this fix is required to properly load my intended font
%%% see https://tex.stackexchange.com/questions/329593/fontspec-font-not-found-alegreyasans-package
\usepackage[no-math]{fontspec}

\makeatletter
\let\fontspec@setsansfont\setsansfont
\def\setsansfont{%
  \let\Alegreya@boldstyle\AlegreyaSans@boldstyle
  \let\setsansfont\fontspec@setsansfont
  \setsansfont
}
\makeatother
%%% end of fix

\usepackage[osf,sfdefault]{AlegreyaSans}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\addbibresource{\jobname.bib}
\urlstyle{same}

% Add these
\edef\familydefault{\sfdefault}
\edef\rmdefault{\sfdefault}
%%%

\begin{document}

Some text
\nocite{*}

\printbibliography

\end{document}

enter image description here

You can avoid the package AlegreyaSans, though.

\begin{filecontents}{\jobname.bib}
@article{one,
    author          = {John Doe},
    title           = {Title},
    journaltitle    = {Journal},
    year            = {2000},
    volume          = {1},
    pages           = {2},
    doi            = {11.1111/abc.1111}
}
\end{filecontents}

\documentclass[10pt]{article}

\usepackage[no-math]{fontspec}

\setmainfont{AlegreyaSans}[
  Extension = .otf,
  UprightFont = *-Regular,
  ItalicFont = *-Italic,
  BoldFont = *-Bold,
  BoldItalicFont = *-BoldItalic,
  Numbers = OldStyle,
]

\usepackage[authordate,backend=biber]{biblatex-chicago}
\addbibresource{\jobname.bib}
\urlstyle{same}

\begin{document}

Upright 1234567890
\textit{Italic 1234567890}
\textbf{Bold 1234567890}
\textbf{\textit{BoldItalic 1234567890}}

\nocite{*}

\printbibliography

\end{document}

enter image description here

| improve this answer | |
  • I can confirm this solves it for Tex Live 2016, as well. This font package sure has its fair share of bugs... – Richard Jul 30 '18 at 19:51

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.