1

I need a bit of help with LateX as I am not the best. So the problem which I currently have is that the babel package [ngerman] does not work. The English works but I need the German one to work and I just cannot figure out why. enter image description here

Thanks for your help

Sorry for coming back so late - The code is not the nicest ... sorry about that but I am no programmer

\documentclass[
  12pt,
  chapterprefix,
  egregdoesnotlikesansseriftitles% no sans serif headings etc.
  ]{scrreprt} % for bigger size of text 
%\providecommand*\Ifstr{\ifstr}% needed up to and including KOMA-Script version 3.27, see https://komascript.de/faq_deprecatedif
%\usepackage{blindtext}% only for dummy text
\usepackage{newtxtext}% <- changed
\usepackage[ngerman]{babel} %help: usepackage[ngerman]{babel} does not work ... \enquote: commas should be at the bottom in the beginning, not the top - not running - error line
\usepackage{adjustbox}
\usepackage[final]{pdfpages}
\usepackage{csquotes} %enquote
\usepackage{graphicx}
\usepackage{MnSymbol,wasysym} %smiley
\usepackage{tabularx} % table x for certain width

\usepackage{setspace}

\usepackage{float}

\usepackage{tablefootnote}
\addtolength{\footnotesep}{1mm} %fußnoten abstand 
\interfootnotelinepenalty=10000 %footnote won't run on two pages
\usepackage{footmisc} %footnotes indent 
\setlength{\footnotemargin}{\parindent}  %footnotes indent 

\newenvironment{hanging}[1][2em]{%  %Literaturverzeichnis
  \addmargin[#1]{0pt}\setlength{\parindent}{-#1}\hspace*{-#1}% 
  \ignorespaces 
}{% 
  \endaddmargin 
} 

\setcounter{secnumdepth}{\chapternumdepth}% only parts and chapters should be numbered

\addtokomafont{disposition}{\mdseries}% headings of section, subsection etc. should not be bold

%chapter in toc and on page (numbering)
\RedeclareSectionCommand[
  font=\bfseries\large,% does the same as \setkomafont{chapter}{\bfseries\large}
  tocentrynumberformat={\def\autodot{:}},
  tocdynnumwidth
]{chapter}

\renewcommand\raggedchapter{\centering}% center chapter headings
\renewcommand*{\chaptermarkformat}{\chapappifchapterprefix{\nobreakspace}\thechapter\autodot:\enskip} 

\let\originaladdchaptertocentry\addchaptertocentry
\renewcommand*{\addchaptertocentry}[2]{%
  \IfArgIsEmpty{#1}
    {\originaladdchaptertocentry{#1}{#2}}
    {\originaladdchaptertocentry{\chapappifchapterprefix{\nobreakspace}#1\autodot}{#2}}%
}

% section
\RedeclareSectionCommand[font=\sffamily\Large]{section}% does the same as \setkomafont{section}{\sffamily\Large}
% subsection
\RedeclareSectionCommand[
  %indent=1em,% <- add this if the subsections should be indented
  font=\itshape% changes the font, does the same as \setkomafont{subsection}{\itshape}
]{subsection}

% format headings with style=section, eg. section, subsection and subsubsection
\let\originalsectionlinesformat\sectionlinesformat
\renewcommand\sectionlinesformat[4]{%
  \Ifstr{#1}{section}
    {\centering #3#4}% centers section headings
    {\originalsectionlinesformat{#1}{#2}{#3}{#4}}% original definition for other section levels
}

% use page style empty in in ToC, LoF and LoT
\AfterTOCHead{\thispagestyle{empty}\pagestyle{empty}}
\AfterStartingTOC{\clearpage}

% rename LoF and LoT
\renewcaptionname{english}{\listfigurename}{Figures}
\renewcaptionname{english}{\listtablename}{Tables}

\begin{document}
5
  • 4
    it is ngerman not nGerman. Jan 24 at 13:34
  • Welcome to TeX.SE.
    – Mico
    Jan 24 at 13:35
  • Hi, just tried the ngerman and it is still not running ... ! Package scrbase Error: \listfigurename' not defined at language english'. See the scrbase package documentation for explanation. Type H <return> for immediate help. ... l.86 \begin{document} ?
    – user232066
    Jan 24 at 13:39
  • 7
    Between what you post and the \begin{document} on line 86 there are 50 lines of code where things could be going wrong. Please post a minimal code reproducing the issue, and post it as text, not as snapshot.
    – campa
    Jan 24 at 13:57
  • I reposted. I haven't been able to figure out the mistake in the past few days
    – user232066
    Jan 28 at 9:42
1

The problem is the combination

\usepackage[ngerman]{babel}
[...]
\renewcaptionname{english}{\listfigurename}{Figures}
\renewcaptionname{english}{\listtablename}{Tables}

You are loading babel with the ngerman option, meaning that the language english isn't defined. When you do

\renewcaptionname{english}{...}{...}

then you'll get the error.

If you are writing simply a German text then remove the two \renewcaptionname instructions.

1
  • thank you so much! It makes total sense, it works!
    – user232066
    Jan 28 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.