Fonts & Character Setslanguage settings for latex-template

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
dejhost
Posts: 5
Joined: Wed Jan 11, 2023 10:11 pm

language settings for latex-template

Post by dejhost »

Hello there!
I am using a latex-template and would like to switch from english to german. So I'd like to get "Kapitel" instead of "Chapter", and "Abbildung" instead of "Figure" etc. in the pdf.

[*]Latex-template: https://hci.rwth-aachen.de/thesis-template (the template for ph.d thesis).
[*]Software: TeXstudio
[*] In the status-bar, it says "de_DE" and UTF-8


in the preamble, I have been playing with the following packages/settings:
%\usepackage[ngerman]{babel}
\documentclass[a4paper,german]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}


The way it is set now, I still have "Chapter 1" instead of the desired "Kapitel 1".
If I actvate the babel, then my german vocals ("Umlaute") like "ü" etc. are not shown correctly, tables are not displayed correctly, and the page-setup is ignored. There are neither "Kapitel" nor "Chapter" to be seen.

Could you please guide me through the process? Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

language settings for latex-template

Post by rais »

Well, the article class does not provide any chapters, you should get an error message for any usage of \chapter, accordingly. The book and report classes do.
\usepackage should appear between \documentclass[..]{..}/latex] and [latex]\begin{document}, nowhere else.
What might be wrong with your umlauts I cannot guess. This should work:

Code: Select all

\documentclass[ngerman]{book}
\usepackage[utf8]{inputenc}% not necessary with TeX Distri from Apr 2018 or newer
\usepackage{babel}
\usepackage[T1]{fontenc}
\begin{document}
\chapter{Foo}
äöüß
\end{document}
KR
Rainer
dejhost
Posts: 5
Joined: Wed Jan 11, 2023 10:11 pm

language settings for latex-template

Post by dejhost »

Thank you for your reply, rais.

I changed from
\documentclass[11pt, a4paper, titlepage]{book} to \documentclass[11pt, a4paper, titlepage, ngerman]{book} in my main.tex, and applied the 3 lines in the preamble:
\usepackage[utf8]{inputenc}% not necessary with TeX Distri from Apr 2018 or newer
\usepackage{babel}
\usepackage[T1]{fontenc}

I commented out the ones I had previously.
  • * I get the message
Package babel Error: You haven't defined the language '[' yet. \babel@toc {[}{2}
.
  • * It also says
    "\babel@toc {ngerman}{}\relax
    \contentsline {chapter}{\numberline {}Einleitung}{1}{chapter*.4}%"
  • * Most of my text is not getting compiled anymore.
  • * None of my tables are displayed correcly. The layout is messed up (e.g., no space at the bottom of the pages)
  • * My "Umlaute" look like this:
    \80\344
  • * No chapters. My table of contents repeats "Einleitung" ("Introduction") like a few dozen times. The list of references for Images and tables are empty
I think fixing this bable would be the first step. why these error-messages? Does it require a seperate installation?
I am using TEXstudio 4.5.1

I attach the main.tex, preampble.tex. Any help is much appreciated - though I understand that this is asked a lot.
Attachments
i10preamble.tex
(25.3 KiB) Downloaded 692 times
main.tex
(3.61 KiB) Downloaded 525 times
dejhost
Posts: 5
Joined: Wed Jan 11, 2023 10:11 pm

language settings for latex-template

Post by dejhost »

Ok, I figured it out. babel and my chapter numbering system are incompatible:
Fails:
\chapter{Grundlagen\markboth{Grundlagen}{Grundlagen}}
\addcontentsline{toc}{chapter}{\protect\numberline{}Grundlagen}
\label{Grundlagen}


Works:
\chapter*{Grundlagen\markboth{Grundlagen}{Grundlagen}}
\addcontentsline{toc}{chapter}{\protect\numberline{}Grundlagen}
\label{Grundlagen}


I will now attempt to define the numbers of the chapters manually.

Thank you for your support.
Post Reply