[Tex/LaTex] Compilation error: “! Argument of ” has an extra }”

debuggingerrors

My TeX document gives me the error:

("C:\Program Files\MiKTeX 2.9\tex\latex\base\ulasy.fd") ! Argument of
" has an extra }. \par l.32 }

Can anyone tell me what's wrong? This is my code:

\documentclass[twoside,12pt,a4paper]{report}
%\usepackage{reportpage}
\usepackage{epsf,german}
\usepackage{graphics, graphicx}
\usepackage[utf8]{inputenc}
\usepackage{latexsym}
\usepackage[margin=10pt,font=small,labelfont=bf]{caption}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{pgfplots}

\textwidth 14cm
\theight 22cm
\topmargin 0.0cm
\evensidemargin 1cm
\oddsidemargin 1cm
%\footskip 2cm
\parskip0.5explus0.1exminus0.1ex

\begin{document}
\begin{tikzpicture}
[   cnode/.style={draw=black,fill=#1,minimum width=3mm,circle},
]
\node[cnode=red,label=0:$\Sigma$] (s) at (6,-3) {};
\node at (0,-4) {$\vdots$};
\node at (3,-4) {$\vdots$};
\foreach \x in {1,...,4}
{   \pgfmathparse{\x<4 ? \x : "n"}
    \node[cnode=blue,label=180:$x_{\pgfmathresult}$] (x-\x) at (0,{-\x-div(\x,4)}) {};
    \node[cnode=gray,label=90:$\varphi_{\pgfmathresult}$] (p-\x) at (3,{-\x-div(\x,4)}) {};
    \draw (p-\x) -- node[above,sloped,pos=0.3] {$\omega_{\pgfmathresult}$} (s);
}
\foreach \x in {1,...,4}
{   \foreach \y in {1,...,4}
    {   \draw (x-\x) -- (p-\y);
    }
}
\end{tikzpicture}

\end{document}

Best Answer

Your code is not good as it seems like a patch of very old documents. It's important to be up-to-date.

  1. The package epsf is obsolete and should not be used in new documents.
  2. The package german is obsolete and should not be used in new documents (use babel).
  3. The package latexsym is obsolete and should not be used in new documents (use amssymb instead).
  4. Loading graphics is useless, because you also load graphicx.
  5. It's unclear why using \oddsidemargin=1cm, which leads to a left margin of 3.54cm (use geometry for set the pagination parameters).
  6. Starting from April 2018, \usepackage[utf8]{inputenc} can be omitted.
  7. With German as the main language, \usepackage[T1]{fontenc} is necessary.

Edited version, with \usetikzlibrary{babel} you need no change to the document body.

\documentclass[twoside,12pt,a4paper]{report}

\usepackage[
  textwidth=14cm,
  textheight=22cm,
  hratio=1:1,
  vratio=1:1,
  heightrounded,
]{geometry}

%\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage{amsmath,amssymb}

\usepackage{graphicx}
\usepackage[margin=10pt,font=small,labelfont=bf]{caption}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{babel}

\begin{document}

\begin{tikzpicture}
[   cnode/.style={draw=black,fill=#1,minimum width=3mm,circle},
]
\node[cnode=red,label=0:$\Sigma$] (s) at (6,-3) {};
\node at (0,-4) {$\vdots$};
\node at (3,-4) {$\vdots$};
\foreach \x in {1,...,4}
{   \pgfmathparse{\x<4 ? \x : "n"}
    \node[cnode=blue,label=180:$x_{\pgfmathresult}$] (x-\x) at (0,{-\x-div(\x,4)}) {};
    \node[cnode=gray,label=90:$\varphi_{\pgfmathresult}$] (p-\x) at (3,{-\x-div(\x,4)}) {};
    \draw (p-\x) -- node[above,sloped,pos=0.3] {$\omega_{\pgfmathresult}$} (s);
}
\foreach \x in {1,...,4}
{   \foreach \y in {1,...,4}
    {   \draw (x-\x) -- (p-\y);
    }
}
\end{tikzpicture}

\end{document}

enter image description here

Related Question