Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Inhalt, Abbildungen, Tabellen, Quellcodes und andere Verzeichnisse


ddzekan
Forum-Newbie
Forum-Newbie
Beiträge: 2
Registriert: Di 16. Mär 2021, 09:34

Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Beitrag von ddzekan »

Liebes Forum,

das ist mein erster Beitrag im Latex Forum und ich möchte mich an dieser Stelle dafür bedanken, dass sich viele Leute Zeit nehmen, um in diesem Forum zu Problemlösungen beizutragen.

Nun zu meinem Problem. Ich habe beim Erstellen einer Arbeit irgendwann festgestellt, dass ab einer bestimmten Anzahl an Abbildungen das Abbildungsverzeichnis fehlerhaft erstellt wird. Es wird nämlich kein Seitenumbruch mehr gemacht und die Überschrift befindet sich unten auf der vorherigen Seite. Das gleiche passiert auch mit dem Inhaltsverzeichnis. Nach langer und kopfzerbrechender Suche nach dem Fehler ist mir aufgefallen, dass dies an der Spracheinstellung "Farsi" im babel Paket liegt. Da ich dies aber gerne in der Arbeit verwenden möchte, wäre ich über Hilfe sehr dankbar.

Im folgendem mein Minimalbeispiel:

\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\documentclass[
twoside,
11pt,
ngerman,
listof=totoc,
%listof=entryprefix
]{scrbook}


\usepackage[LAE,T1]{fontenc}
\usepackage[farsi,main=ngerman]{babel} %Ohne "Farsi" fehlerfrei


\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{First Chapter}

\section{First section}

\begin{figure}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
\end{figure}


\end{document}

Viele Grüße
Daniel


Benutzeravatar
KOMA
TeX-Entwickler
TeX-Entwickler
Beiträge: 2958
Registriert: Fr 4. Jul 2008, 17:28
Kontaktdaten:

Re: Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Beitrag von KOMA »

Das Problem ist Paket arabicore, das von farsi geladen wird. Dieses Paket definiert viele Befehle um, wobei es sich an den Standardklassen orientiert und andere Klassen wenig bis gar nicht berücksichtigt. Damit ist das Paket (und somit auch die Spracheinstellung farsi) mit vielen Klassen, u. a. auch der von dir verwendeten KOMA-Script-Klasse scrbook, inkompatibel. Du solltest das dem Maintainer von arabi melden. Eigentlich kann nur er das wirklich korrigieren.

Als Workaround kannst du zumindest die Änderung, die hier für das Problem verantwortlich ist, dadurch entschärfen, dass du die Überschriftenbefehle von KOMA-Script wiederherstellt. Das geht mit einem einzigen \RedeclareSectionCommands:

\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst}
\documentclass[
twoside,% ÜBERFLÜSSIG, weil VOREINSTELLUNG
11pt,% ÜBERFLÜSSIG, weil VOREINSTELLUNG
ngerman,
listof=totoc,
%listof=entryprefix
]{scrbook}


\usepackage[LAE,T1]{fontenc}
\usepackage[farsi,main=ngerman]{babel} %Ohne "Farsi" fehlerfrei

% Für die Überschriften die Originaldefinitionen von KOMA-Script wiederherstellen
\RedeclareSectionCommands{part,chapter,section,subsection,subsubsection,paragraph,subparagraph}

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{First Chapter}

\section{First section}

\begin{figure}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
	\caption{This is a dummy text for testing.}
\end{figure}

\end{document}

Leider kann ich nicht ausschließen, dass es dadurch zu anderen Problemen kommt, beispielsweise, wenn man farsi innerhalb der Überschriften verwendet. Der arabi-Autor sollte seine Änderungen bei KOMA-Script besser durch die durchaus vorhandenen Hooks und Schnittstellen realisieren. Die gibt es extra, um solche Probleme zu verhindern.

Auch sonst sollte man bei Verwendung von arabi zusammen mit KOMA-Script mit Problemen rechnen. Beispielsweise werden auch interne Befehle für \caption umdefiniert. Dadurch funktionieren diese dann eher wieder wie bei den Standardklassen, als wie bei KOMA-Script. Die ganze Erweiterungen von KOMA-Script an der Stelle sind dann eher kaputt. Das kann man eventuell dadurch lösen, dass man zusätzlich Paket caption (und dann natürlich dessen Erweiterungen) nutzt.

Übrigens: Für den ersten Beitrag was das ein perfektes Minimalbeispiel! Meine Hochachtung!


Benutzeravatar
u_fischer
Forum-Meister
Forum-Meister
Beiträge: 4266
Registriert: Do 22. Nov 2012, 11:09
Kontaktdaten:

Re: Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Beitrag von u_fischer »

In dem Fall reicht aber auch einfach lokal statt \addpenalty direct \penalty zu verwenden:

\renewcommand\LastTOCLevelWasSame {\ifvmode \penalty 51 \fi}
\listoffigures


Benutzeravatar
KOMA
TeX-Entwickler
TeX-Entwickler
Beiträge: 2958
Registriert: Fr 4. Jul 2008, 17:28
Kontaktdaten:

Re: Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Beitrag von KOMA »

Das ändert aber alles leider nichts daran, dass arabi u. a. die Überschriftenbefehle der KOMA-Script-Klassen kaputt macht:

\documentclass[headings=optiontotocandhead]{scrbook}
\usepackage[LAE,T1]{fontenc}
\usepackage[%
  farsi,% zerstört u. a. "headings=optiontotocandhead"
  main=ngerman
]{babel}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\chapter[head={Kopfzeile},tocentry={Inhaltsverzeichnis}]{Überschrift}
\Blindtext[10]
\end{document}

Zwar gibt es Planungen für KOMA-Script, damit so etwas an der Stelle nicht mehr passiert, aber das heißt nicht, dass arabi dann problemlos mit KOMA-Script funktionieren wird. Es macht dann nur an der Stelle nichts mehr unabsichtlich kaputt.


ddzekan
Forum-Newbie
Forum-Newbie
Beiträge: 2
Registriert: Di 16. Mär 2021, 09:34

Re: Fehlerhafte Verzeichnisse durch bestimmte "babel" optionen

Beitrag von ddzekan »

Vielen Dank für die sehr schnelle Hilfe!

Tatsächlich scheint es zu funktionieren. Ich finde auch im Moment keine anderen Probleme im Dokument, die das arabi package verursacht.

Also noch einmal vielen Dank.
Daniel


Antworten