1

I'm writing a document in Overleaf using a document template I've been given, and I need to use the formatting style set out in that template. I've had to change the compiler I'm using from pdfLaTeX to LuaLaTeX so that I can make use of certain linguistic Unicode characters.

The problem I'm having is that changing the compiler seems to have broken the formatting of the template, and I'm not sure how I can fix it.

The only change I made in the preamble to facilitate the new compiler was that I replaced this:

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

With this:

\usepackage{fontspec}
\newfontfamily\abr{Noto Serif}
\newfontfamily\og{Noto Sans Ogham}

Now my title page has changed, the title is no longer bold or using the correct margin sizes. Chapter titles in the table of contents are all lowercase, and section titles in the main body are lowercase too. Aside from these specific issues, the primary font of the whole document has also clearly changed. These are just the issues I've noticed, I suspect there are more subtle changes I haven't noticed yet.

How can I get it to look like it did with the old compiler?

Here are some pictures for reference.

Before (correct formatting):

original title page

original table of contents

original section titles

After (formatting broken):

broken title page

broken table of contents

broken section titles

EDIT: Adding minimal code to enable recreation of the issue.

The issue should be reproducible just switching between compilers without making any changes to the code below.

\documentclass[a4paper,headinclude,footinclude]{book}

% document packages



\usepackage{iftex}

\iftutex
 \usepackage{fontspec}
 \newfontfamily\abr{Noto Serif}
 \newfontfamily\og{Noto Sans Ogham}
\else
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}

\fi

\usepackage[english]{babel}
\usepackage[hyphens]{url}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{{./chapters/images/}}
\usepackage{titling}
\usepackage[toc,page]{appendix}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[
  eulerchapternumbers,
  eulermath,
  subfig,
  beramono,
  pdfspacing,
  floatperchapter,
]{classicthesis}
\usepackage{arsclassica}
\usepackage[  % check the README file about margins
  left=3cm,
  right=3cm,
  top=3cm,
  bottom=3cm,
  heightrounded,
]{geometry}
\usepackage{lipsum}  % for dummy text, you can remove this

% macro definitions
\newcommand{\figurePath}[1]{figures/#1}

% use one and a half line spacing
\onehalfspacing

% set your title, author and publication date here
\title{Development of Natural Looking Titles and Reports about Nothing; with an Application for Deterring Authorship in Other Word Processors}
\author{Andrew Daly}
\date{\today}

% start the document with the title page
\begin{document}
\begin{titlepage}
  \centering
  % main logo
  \vspace*{3em}
  % main title, author and date
  {\color{darkgray} \Large \bfseries\selectfont Team Report} \\ [5em]
  {\sffamily \bfseries \selectfont \huge \singlespacing \thetitle \par}
  \vspace*{2em}
  {\Large \theauthor} \\ [4em]
  {\textbf \thedate} \\ [4em]
  % teams and members
  \parbox{0.25\textwidth}{
    \centering \color{darkgray}
    \textbf{Team A} \\ Greg Thompson
  }
  \parbox{0.4\textwidth}{
    \centering \color{darkgray}
    \textbf{Team B} \\ John McAvoy \\ Cliodhna Dempsy
  }
  \parbox{0.25\textwidth}{
    \centering \color{darkgray}
    \textbf{Team C} \\ Paul Buttler
  } \\
  \vfill
  % secondary logo and footer

  {\color{darkgray}
  Centre for Mocked Up Team Reviews \\
  College of Teamwork, International University of Jupiter
  }
\end{titlepage}

% the front matter of the document
\frontmatter
\chapter*{Abstract}
This is an abstract, there should be about a paragraph of text here. 
\lipsum[10]
\tableofcontents
\chapter*{Acknowledgements}
Thanks folks!

% these are the included chapters
\mainmatter
\chapter{Review of the Literature}\label{ch:litrev}
\section{All About the Dictionary}
This is some text about a dictionary. \lipsum[5]
\section{Teamwork in the Context of Dictionaries}
It would be difficult to write a dictionary on your own. \lipsum[10]
\section{Another Title I Came Up With}
I'm running out of things to say here. \lipsum[9]
\lipsum[6-8]

\appendices
\chapter{Placeholders}
\section{Unused References}
\begin{enumerate}
    \item List item 1
    \item List item 2
    \item List item 3
\end{enumerate}

\end{document}
11
  • 3
    As always on this site, please give others a better chance to evaluate your problem by providing a full but minimal example they can copy and test as is.
    – daleif
    Commented Sep 29, 2021 at 6:04
  • 1
    Additionally, what exactly do you mean by "break formatting"? I see two documents with different fonts, thus different metrics and different line breaks. This is normal when changing fonts. You might even see it when going from a type1 version (pdflatex) to an otf version in lualatex of the same font (lualatex can use both). The metrics are not always the same.
    – daleif
    Commented Sep 29, 2021 at 6:32
  • Hi daleif, I'm working on a minimal example and will add it to my post. What I mean by "break formatting" is that the font has changed without me specifying a new font, the case of chapter titles and section titles changes to lower case without me specifying that the case should be lowercase, and the title changes to not be boldface anymore. Are you saying they'll all change back if I specify an appropriate font?
    – AdeDoyle
    Commented Sep 29, 2021 at 6:38
  • 1
    You presumably were selecting some 8 bit font family previously and are not selecting similar opentype fonts now but as you have shown no information at all, I doubt anyone can answer. If you select a bold font and no bold is available then you will always get a warning in the log showing the attempted font and the font latex used, but you haven't shown your log either. Commented Sep 29, 2021 at 6:47
  • Erh, the default font in latex is not Noto Serif or Noto Sans Ogham so at least you need to explain how you got those in the pdflatex version.
    – daleif
    Commented Sep 29, 2021 at 7:10

1 Answer 1

3

the classicthesis and arsclassica packages are not really set up for Unicode fonts, and LaTeX does warn you that sans serif is not working,

LaTeX Font Warning: Font shape `TU/iwona/m/n' undefined
(Font)              using `TU/lmr/m/n' instead on input line 65.


(/usr/local/texlive/2021/texmf-dist/tex/latex/microtype/mt-LatinModernRoman.cfg
)

LaTeX Font Warning: Font shape `TU/iwona/b/n' undefined
(Font)              using `TU/iwona/m/n' instead on input line 65.

That is the first one saying it can't find iwona so will use latin modern, then the second one saying it can't find bold.

However you can use fontspec to set the sans serif to the OpenType version of iwona then it does set up bold as well

Output from lualatex:

enter image description here

\documentclass[a4paper,headinclude,footinclude]{book}

% document packages



\usepackage{iftex}


\usepackage[english]{babel}
\usepackage[hyphens]{url}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{{./chapters/images/}}
\usepackage{titling}
\usepackage[toc,page]{appendix}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[
  eulerchapternumbers,
  eulermath,
  subfig,
  beramono,
  pdfspacing,
  floatperchapter,
]{classicthesis}
\usepackage{arsclassica}


\iftutex
 \usepackage{fontspec}
 \newfontfamily\abr{Noto Serif}
 \newfontfamily\og{Noto Sans Ogham}
 \setsansfont{iwona}
\else
 \usepackage[T1]{fontenc}
 \usepackage[utf8]{inputenc}

\fi

that fixes the main issue, although arsclassica still has some low level code such as



%************************************************************
% Chapter numbers
%************************************************************
\let\chapterNumber\undefined
\ifct@eulerchapternumbers
\newfont{\chapterNumber}{eurb10 scaled 5000}%
\else
\newfont{\chapterNumber}{pplr9d scaled 5000}%
\fi

which is using internal names and scaling commands to force legacy 8bit fonts, you probably should use the \iftutex block in the preamble above to use fontspec defined fonts for \chapterNumber as well.

5
  • Possibly, but I've just tested this out to see if it would fix the title, or the lowercase issues, and it doesn't seem to have done anything at all. Does it solve the issue with the output when you run it?
    – AdeDoyle
    Commented Sep 29, 2021 at 8:07
  • @AdeDoyle I added an image of the lualatex output. If you are not getting small caps headings lualatex will be showing you a font warning about iwona/sc, what does it say? Commented Sep 29, 2021 at 8:10
  • did you move the iftutex block after arsclassica? @AdeDoyle Commented Sep 29, 2021 at 8:16
  • That's it, I hadn't moved it after arsaclassica. Thank you. I wonder if I could just remove arsaclassica, or if there's some alternative for use with LuaLaTeX. I can try defining my own font for \chapterNumber, as you suggested, but I'm not sure what the condition is in \ifct@eulerchapternumbers above, so I can't copy it.
    – AdeDoyle
    Commented Sep 29, 2021 at 8:32
  • @AdeDoyle I didn't check the code but I assume it is just true if you used the option eulerchapternumbers which you have done Commented Sep 29, 2021 at 9:00

You must log in to answer this question.

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