2

This doesn't make any sense to me, but for some reason, \usepackage{babel} is causing \partname not to work as expected.

Here's a MWE. \renewcommand{\partname}{} should give an output text without the word "Pars"—just the Roman numeral and the name of the part. If I remove babel, it works fine.

Is there a way I can fix this?

\documentclass[12pt,openright]{book}
\usepackage{fontenc}[utf8]
\usepackage[english,main=latin]{babel}      

\renewcommand{\partname}{}

\begin{document}
\part{Pīrāta Veterānus}
\end{document}
Joel Derfner
  • 469
  • 2
  • 13

1 Answers1

2

You modify the fixed word by doing

\addto\extraslatin{\renewcommand{\partname}{}}

Your attempt doesn't work, because \begin{document} issues \selectlanguage{latin}, which sets \partname to “Pars” unless modified.

However, this is not a particularly good way to remove the word, because it wouldn't remove the space.

\documentclass[12pt,openright]{book}
\usepackage[T1]{fontenc}
\usepackage[english,main=latin]{babel}

\addto\extraslatin{\renewcommand{\partname}[1]{}}

\begin{document}
\part{Pīrāta Veterānus}
\end{document}

enter image description here

Compare with the result if you just use \renewcommand{\partname}{}:

enter image description here

Sorry for the images with different size, but check the alignment and you'll see that in the latter picture the I is moved to the right.

The book class only uses \partname in the definition of \@part. This is however not guaranteed to work with other packages such as titlesec.


The line \usepackage{fontenc}[utf8] is meaningless. I changed it to \usepackage[T1]{fontenc}.

You possibly wanted to do \usepackage[utf8]{inputenc}, but this is no longer needed on recent TeX distributions.

egreg
  • 1,121,712