1

I'm struggling with kind of error when compiling file with equations.

\documentclass{article}

\usepackage{kotex}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[czech]{babel}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{indentfirst}
\usepackage{commath}
\usepackage{mathtools}
\usepackage{calc}
\usepackage{amsmath}
\usepackage{amssymb}

\newcommand{\Author}{XXX}
\newcommand{\Institute}{xxxxx}
\newcommand{\Organization}{}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Roverline}{\overline{\mathbb{R}}}
\newcommand{\Coverline}{\overline{\mathbb{C}}}
\newcommand{\floor}[1]{\lfloor #1 \rfloor}

\newtheorem{Definice}{Definice}
\newtheorem{Lemma}{Lemma}
\newtheorem{Cvičení}{Cvičení}

\begin{document}
\begin{titlepage}
\centering
{\huge\bfseries Lineární algebra \par}

\vspace{3cm}


\begin{tikzpicture}[scale=1.75, transform shape]
\centering
\hspace*{-0.9cm}
  \begin{axis}[
domain=-1:1,
samples=6,
xmin=-1,xmax=1,
ymin=-1,ymax=1,
zmin=-1,zmax=1,
]
    \pgfplotsinvokeforeach{-1,-.5,0,.5,1}{
      \addplot3[cyan,quiver,-stealth,
      point meta={x+y+z},
      quiver={
        u={2*z},
        v={y-z},
        w={-3*x},
        colored,scale arrows=.1}]
      (x,y,#1);
    }
  \end{axis}
\end{tikzpicture}

\vspace{2.5cm}
{\Large\itshape \Author \\}

\end{titlepage}

\section{Úvod}
Lineární algebra je matematická disciplína, která se vyskytuje nebo doplňuje spoustu jiných odvětví matematiky. Je to odvětví obecné algebry, které se zabývá vektorovými prostory, speciálně vektorů jako n-tic čísel, matic nebo zobrazení (transformací). Nachází využití v diskrétní matematice, matematické analýze, ve fyzice (všemožné transformace souřadnic) nebo dokonce v chemii (vyrovnávání redoxních rovnic). 

Jedním z takových využití je například řešení diferenciálních rovnic. Můžeme uvést příklad:

\begin{equation*}
y''-y = 0
\end{equation*}

Hned od pohledu lze říct, že funkce $y = e^x$ a $y=e^{-x}$ řeší takovou rovnici, druhé derivace těchto funkcí jsou identické s původními funkcemi. Mohlo by nás však také napadnout, jestli třeba $y = 3e^x - 2 e^{-x}$ by nebylo také řešení takové rovnice.
Ano skutečně je. Vraťme se nyní na střední školu a vzpomeňme si, jak se derivovaly součty dvou funkcí a součiny funkce a konstanty, konstantu lze z derivace vytknout. Pokud máme dvě derivace za sebou, můžeme toto udělat hned dvakrát.

\begin{align*}
(3e^x - 2 e^{-x})''-3e^x + 2e^{-x} &= 0 &\\
((3e^x - 2 e^{-x})')' -3e^x + 2e^{-x} &= 0 &\\ 
((3e^x)' - (2 e^{-x})')' -3e^x + 2e^{-x} &= 0 &\\ 
(3e^x)'' - (2 e^{-x})'' - 3e^x + 2e^{-x} &= 0 &\\
3(e^x)'' - 2(e^{-x})'' - 3e^x + 2e^{-x} &= 0 &\\
3e^x - 2 e^{-x}- 3e^x + 2e^{-x} &= 0 &
\end{align*}
\end{document}

I get error like this:

Missing \endcsname inserted.
<to be read again> 
                   \protect 
l.88 \end{align*}
TeX capacity exceeded, sorry [input stack size=5000].
\@spaces ->\space 
                   \space \space \space 
l.88 \end{align*}

Thank you for any help.

2
  • 1
    Do you need kotex for writing in Czech? – egreg Mar 24 '18 at 11:55
  • 1
    As a note for the future: It is very helpful to provide an MWE (with stress on the minimal) when asking a question on this site. This helps us answer your question and often makes the problem clearer to you before you post your question (for example you would probably have identified the \newtheorem as problematic yourself). You can find pointers on how to write a good MWE here and also have a look at our starter guide. – schtandard Mar 24 '18 at 14:52
5

Do not use special characters as an environment name. Use

\newtheorem{Cviceni}{Cvičení}

instead.


The error in your case seems to be caused by the use of kotex (do you write Korean?) together with this \newtheorem (I assume that the accenting commands are redifined by this package, though that is just a hunch). However you may get similar problems with any number of packages.

4
  • Ok, when I removed this package I copied form another my file, it went back and worked. However I still wonder what does it mean and why it didn't come up until I started with the align*... – Dan We Mar 24 '18 at 12:42
  • 1
    I want to clarify that you should not only remove the kotex package if you do not need it but more importantly, avoid using special characters when naming environments (and thus macros). The kotex package obscures the problem, but ultimately the special characters are the culprit. – schtandard Mar 24 '18 at 14:45
  • That said, I am unclear on some things leading to the final warning and error you get. I asked this question about it that you can have a look at if you are interested. – schtandard Mar 24 '18 at 14:46
  • Thank you, I have currently repaired everything what seemed to wrong, removed unused packages and now I'm done, had problems with the part \newtheorem{Cviceni}{Cvičení} because I left an "í" in the name braces. – Dan We Mar 24 '18 at 15:29

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.