0

I am trying to use kpfonts with tufte-handout class. For some reason the table of contents font defaults to Computer Modern roman when compiled with lualatex, rest of the document compiles correctly. The same code with xelatex compiles correctly and the table of contents font is italics of kpfonts. How can I get correct font for toc using lualatex?

XeLaTeX compiles correctly

LuaLaTeX defaults only TOC font to CM

MWE

\documentclass{tufte-handout}
\usepackage[]{kpfonts}

\usepackage[T1]{fontenc}

\usepackage{lipsum}             

\begin{document}

\tableofcontents

\section{LuaLaTeX}
\lipsum

\section{Two}

\lipsum
\section{Three}

\lipsum

\end{document}
6
  • T1 encoding and legacy fonts like kp don't really make a good fit wih luatex as you have to disable most of its unicode support, why not use pdftex? Commented May 11, 2022 at 7:06
  • It compiles correctly with pdflatex with this error "/usr/local/texlive/2021/texmf-dist/tex/latex/kpfonts/kpfonts.sty:94: LaTeX Error: Option clash for package textcomp. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.94 ...textcomp\RequirePackage[full]{textcomp}\fi \fi? "
    – Damitr
    Commented May 11, 2022 at 7:12
  • yes I believe that has been reported to the package maintainer Commented May 11, 2022 at 7:13
  • I am also using some other font familes which need use of lua/xelatex, and microtype which doesn't like xelatex. So using pdflatex makes it difficult to get the document compiled. But what I am not able to get is why is only the toc font affected? Rest of the document gives the italics fine!
    – Damitr
    Commented May 11, 2022 at 7:20
  • latex does warn you LaTeX Font Warning: Font shape `TU/jkp/m/n' undefined (Font) using `TU/lmr/m/n' instead on input line 1. something is detecting luatex and switching back to unicode and so breaks the legacy 8bit kp font setup. It's probably fixable but.... Commented May 11, 2022 at 7:25

1 Answer 1

1

If you want to compile with LuaLaTeX (or XeLaTeX), I suggest you use the Opentype version of the kpfonts:

\documentclass{tufte-handout}
\usepackage{kpfonts-otf}
\usepackage{lipsum}
\begin{document}

\tableofcontents

\section{LuaLaTeX}
\lipsum

\section{Two}

\lipsum
\section{Three}

\lipsum

\end{document}

PLease have a look at the documentation Kpfonts-OTF-Doc-English.pdf for more information about the available options.

1
  • Thanks for the tip, I got it working by specifying the required fonts for toc using tocloft such as \renewcommand\cftsecfont{\large\itshape}
    – Damitr
    Commented May 16, 2022 at 5:48

You must log in to answer this question.

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