0

I am getting the common "undefined control sequence" error and I have been searching its cause for hours now.

My Tex-Header reads like this :

 %_Allgemeine Einstellungen__________________________________________________________________________

% Dokumentenformat
    \documentclass[a4paper,12pt,headsepline]{scrartcl}

% Umlaute unter UTF8 nutzen
    \usepackage[utf8]{inputenc}

% Packet für Seitenrandabständex und Einstellung für Seitenränder
    \usepackage{geometry}
    \geometry{left=3.5cm, right=2cm, top=2.5cm, bottom=2cm}
    \reversemarginpar

% Zeichenencoding
    \usepackage[T1]{fontenc}

% Deutsche Sonderzeichen benutzen 
    \usepackage{ngerman}

% deutsche Silbentrennung
    \usepackage[english, main=ngerman]{babel}
    \usepackage{fix-cm}
    \usepackage{lmodern}

% Mathematische Symbole importieren
    \usepackage{amsmath,amssymb,nicefrac,mathrsfs}
% Kapitelnummer in Gleichungsnummer
    \numberwithin{equation}{section}


% auf SI-Einheiten zurückgreifen
    \usepackage{siunitx}
    \sisetup{
            exponent-product=\cdot,
            }

% auf jeder Seite eine Überschrift (alt, zentriert)
    %\pagestyle{headings}

% bei englischen Dokumenten 1st,2nd,3rd, usw
    %\usepackage[super]{nth}

% Schaltet den zusätzlichen Zwischenraum ab, den LaTeX normalerweise nach einem Satzzeichen einfügt.
    \frenchspacing

% Paket für Zeilenabstand
    \usepackage{setspace}

% Formatierung der Absätze
    \setlength{\parindent}{1em}
    \setlength{\parskip}{0.2cm}

% Keine einzelnen Linie am Start des Paragraphen (Schusterjungen)
    \clubpenalty = 10000
% Keine einzelnen Linie am Ende des Paragraphen (Hurenkinder)
    \widowpenalty = 10000
    \displaywidowpenalty = 10000

% Symbole wie ° in Texten
    \usepackage{textcomp}


%_Inhalt, Verzeichnisse & Zitate____________________________________________________________________

% Neue Namen für Verzeichnisse, Abbildungen und Tabellen
    \renewcaptionname{ngerman}{\contentsname}{Inhalt}
    %\renewcaptionname{ngerman}{\listfigurename}{Abbildungen}
    %\renewcaptionname{ngerman}{\listtablename}{Tabellen}
    \renewcaptionname{ngerman}{\figurename}{Abb.}
    \renewcaptionname{ngerman}{\tablename}{Tab.}

    \setkomafont{caption}{\small}
    \setkomafont{captionlabel}{\normalsize\bfseries}

% erzeugt Inhaltsverzeichnis mit Querverweisen zu den Kapiteln (PDF Version)
    \usepackage[bookmarksnumbered,hyperfootnotes=false]{hyperref} 
    \hypersetup{colorlinks, citecolor=blue!50!black, linkcolor=black, urlcolor=black}
    %\hypersetup{colorlinks, citecolor=black, linkcolor= black, urlcolor=black}

% für Stichwortverzeichnis
    \usepackage{makeidx}

% Festlegung Art der Zitierung - Havardmethode: Abkuerzung Autor + Jahr
    \usepackage{csquotes}
    \usepackage[citestyle=authoryear]{biblatex}
    \addbibresource{/Masterarbeit/Script/Quellen/neu/literatur}

% Abkürzungsverzeichnis
    \usepackage[withpage]{acronym}

% ToDo Notizen
    \usepackage[colorinlistoftodos,         % frabiges Rechteck in Todo Liste
                prependcaption,             
                %color=green,               % Farbe im Code
                bordercolor=black!50,
                linecolor=orange!50,            
                backgroundcolor=orange!50,
                %figwidth=length,
                %textwidth=length,
                textsize=tiny
                ]{todonotes}
    %\PassOptionsToPackage{disable}{todonotes}      Deaktiviert alle TodoNotes!
                                                %   kann auch später im Hauptdokument 
                                                %   verwendet werden!
% Notizen beginnen am Rand des Dokuments        
    \setlength{\marginparwidth}{3cm}


%_Kopf- & Fußzeilen_________________________________________________________________________________
    \usepackage{fancyhdr}
% Leere Fußzeile
    \fancyfoot{}
%Linke Seite der Kopfzeile
    \fancyhead[R]{\thepage}

%_Eigene Formatierungen_____________________________________________________________________________
    \newcommand{\codepar}[1]{\textcolor{blue!50!black}{\ttfamily#1} }
    \newcommand{\codeequ}[2]{\textcolor{blue!50!black}{\ttfamily#1} = #2  }
    \newcommand{\namelist}[1]{\textcolor{red!50!black}{\ttfamily#1} }

    \newcommand{\overbar}[1]{\mkern 1.5mu\overline{\mkern-1.5mu#1\mkern-1.5mu}\mkern 1.5mu}

    \newcommand{\qm}{$\text{m}^2$}
    \newcommand{\pow}[1]{$\text{#1}^2$}
    \newcommand{\powt}[1]{$\text{#1}^3$}
    \newcommand{\pown}[2]{$\text{#1}^#2$}

%_Grafiken_____________________________________________________________________________

    \usepackage{graphicx}
    %\usepackage{floatflt}
    \usepackage{caption}
    %\newcommand{\dontcountfig}{\addtocounter{figure}{-1}}

%_Farben_____________________________________________________________________________
    \usepackage{xcolor}
    \definecolor{UniBlue}{RGB}{83,121,170}

%_Tabellen_____________________________________________________________________________
    \usepackage{array}
    \usepackage{multirow}

% mehrseitige Tabellen ermöglichen
    \usepackage{longtable}
% Tabellen wie in Büchern
    \usepackage{booktabs}
% Toprule usw.
    \usepackage{etoolbox}
    \newlength{\toprulewidth}
        \setlength{\toprulewidth}{0.2ex}
        \patchcmd{\toprule}{\heavyrulewidth}{\toprulewidth}{}{}
    \newlength{\bottomrulewidth}
        \setlength{\bottomrulewidth}{0.30ex}
        \patchcmd{\bottomrule}{\heavyrulewidth}{\bottomrulewidth}{}{}

%_Code_____________________________________________________________________________
    \input{/home/jens/Dokumente/LaTeX/listings.tex}

%_TIKZ_____________________________________________________________________________
    \usepackage{tikz}
    \usetikzlibrary{arrows,shapes,trees,positioning,intersections,backgrounds,decorations.markings,matrix}
    \usepackage{pgfplots}
    \usepgfplotslibrary{fillbetween}
    \tikzset{
        invisible/.style={opacity=0},
        visible on/.style={alt=#1{}{invisible}},
        alt/.code args={<#1>#2#3}{%
            \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}},}

My Error log says:

! Undefined control sequence.
\lbx@lfromlang ->\iffieldundef 
                           {origlanguage} {} {\bibstring {from\thefield ...
l.17 \begin{document}

! Undefined control sequence.
\lbx@lfromlang ...f {origlanguage} {} {\bibstring 
                                              {from\thefield {origlangua...
l.17 \begin{document}

! Undefined control sequence.
\lbx@lfromlang ...} {} {\bibstring {from\thefield 
                                              {origlanguage}}\space }
l.17 \begin{document}

! Undefined control sequence.
\lbx@sfromlang ->\iffieldundef 
                           {origlanguage} {} {\bibstring {from\thefield ...
l.17 \begin{document}

! Undefined control sequence.
\lbx@sfromlang ...f {origlanguage} {} {\bibstring 
                                              {from\thefield {origlangua...
l.17 \begin{document}

! Undefined control sequence.
\lbx@sfromlang ...} {} {\bibstring {from\thefield 
                                              {origlanguage}}\space }
l.17 \begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

I also get the error when my literatur.bib file is only filled with one example entry and I comment out all my text and compile a blank sheet with only a cite to my example entry. So the error has to be inside the header.

I would really appreciate it if anyone could tell me my mistake ! :)

Thank you guys

PS: Sorry for the german comments in the Header :D

9
  • 2
    Welcome to TeX.Stackexchange! Can you please show us the complete error message? If your editor does not show it, open the .log file and search for Undefined control sequence. The lines following this error should tell which control sequence is undefined. Oct 29, 2017 at 16:14
  • 3
    You should not need \usepackage{ngerman} as you are loading babel. Oct 29, 2017 at 16:14
  • 1
    Welcome to TeX.SX! Can you tell us which command is supposed to be undefined? Unfortunately, the code you posted does not really help us to identify the problem, we can't run it. Please consider providing a full MWE/MWEB that we can actually run.
    – moewe
    Oct 29, 2017 at 16:14
  • 2
    With only a few exceptions, hyperref should be loaded last. Oct 29, 2017 at 16:17
  • 1
    You need to specify the file extension in \addbibresource, so you probably need \addbibresource{/Masterarbeit/Script/Quellen/neu/literatur.bib} (this is very likely not the cause of your undefined control sequence, but should be taken car of nonetheless). citestyle=authoryear alone looks a bit meh with a numeric bibliography, try \usepackage[style=authoryear]{biblatex} instead.
    – moewe
    Oct 29, 2017 at 16:17

1 Answer 1

2

The package ngerman is outdated and should be replaced with the babel package (see http://mrunix.de/forums/showthread.php?52211-Tip-Veraltete-Pakete-welche-NICHT-verwendet-werden-sollten for a list with more outdated packages). As your code already contains babel you can simply remove \usepackage{ngerman}.


Some other thoughts about your preamble:

  • With only a few exceptions, the package hyperref should be loaded after the other packages, see Which packages should be loaded after hyperref instead of before? for more information.

  • as moewe mentioned in his comment, .bib is misisng from \addbibresource{/Masterarbeit/Script/Quellen/neu/literatur}

  • I am not sure if

    \tikzset{
        invisible/.style={opacity=0},
        visible on/.style={alt=#1{}{invisible}},
        alt/.code args={<#1>#2#3}{%
            \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}},}
    

    makes sense in a non-beamer document.

  • \frenchspacing is probably unnecessary, as babel automatically set this based on the language which is en effect.

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.