0

when i'm using codes like numberlike= or sibling= in \declaretheorem[]{} appear the missing \begin{document} error and i don't understand why(i want the same numeration for theorems, definitions, propositions....). I'm using in my thesis the next code for latex:

\documentclass[12pt, oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[english]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[mono=false]{libertine}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{cite}
\usepackage{mathrsfs}
\usepackage{parskip}
\usepackage[pdftex]{hyperref}
\hypersetup{colorlinks=true,linkcolor=black} 
\usepackage{float}
\providecommand{\norm}[1]{\lVert#1\rVert}
\usepackage[]{amsmath}
\usepackage[]{amsthm}
\usepackage[]{mathtools}
\usepackage[]{bm}
\usepackage[]{thmtools}
\DeclareMathOperator{\sign}{sign}
\newcommand{\marcador}{\vrule height 10pt depth 2pt width 2pt \hskip .5em\relax}
\newcommand{\cabeceraespecial}{\color{Color}\normalfont\bfseries}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\cabeceraespecial\marcador,
notefont=\cabeceraespecial,
notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
headindent=0pt,
headpunct={.}
]{importante}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\normalfont\itshape\color{Color},
notefont=\normalfont,
notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
headindent=0pt,
headpunct={.}
]{normal}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\normalfont\itshape\color{Color},
notefont=\normalfont,
notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
headindent=0pt,
headpunct={.},
numbered=no,
qed=\color{Color}QED
]{demostracion}
\declaretheorem[name=Theorem,style=importante,numberwithin=chapter]{theorem}
\declaretheorem[name=Remark,style=normal,numberwithin=chapter]{remark}
\declaretheorem[name=Corollary,style=normal]{corollary}
\declaretheorem[name=Proposition,style=importante,numberwithin=chapter,sibling=theorem]{proposition}
\declaretheorem[name=Lemma,style=importante,numberwithin=chapter,sibling=theorem]{lemma}
\declaretheorem[name=Example,style=normal,numberwithin=chapter,sibling=theorem]{ej}
\declaretheorem[name=Definition,style=importante,numberwithin=chapter,sibling=theorem]{definition}
\let\proof=\undefined
\declaretheorem[name=Proof,style=demostracion]{proof}
3
  • the code you posted does not give the error that you ask about, it gives Runaway argument? {\declaretheoremstyle [ spaceabove=\medskipamount , spacebelow=\medskipamount \ ETC. ! File ended while scanning use of \@argdef. due to mis-matched {} please edit the question so the code gives the error in the title, otherwise it is hard to help. – David Carlisle Jul 6 '18 at 22:41
  • did you intend to comment out the } here? \newcommand{\cabeceraespecial}{%\color{Color}%\normalfont\bfseries} – David Carlisle Jul 6 '18 at 22:43
  • yes, sorry, i forget one space when i copy the code – edison leguizamon Jul 6 '18 at 23:06
1

If you add

\begin{document}

\end{document}

to get a complete document

and at the start of the preamble add

\everypar{}

to kill the begin document error (useful sometimes for debugging but not a good

idea in a production document) then you get

enter image description here

which gives a pointer to the error.

\newtheorem has an optional argument to say to re-use an existing counter and a different optional argument to say to reset the counter under a parent counter however you can't use both of these. If you do the second ([chapter]) trailing optional argument is not picked up and is just typeset as text leading to the error shown. The thm-tools keyval wrapper probably ought to complain and give a better error message if you use both sibling and counterwithin

\documentclass[12pt, oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[english]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[mono=false]{libertine}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{cite}
\usepackage{mathrsfs}
\usepackage{parskip}
\usepackage[pdftex]{hyperref}
\hypersetup{colorlinks=true,linkcolor=black} 
\usepackage{float}
\providecommand{\norm}[1]{\lVert#1\rVert}
\usepackage[]{amsmath}
\usepackage[]{amsthm}

\usepackage[]{mathtools}
\usepackage[]{bm}
\usepackage[]{thmtools}
\DeclareMathOperator{\sign}{sign}
\newcommand{\marcador}{\vrule height 10pt depth 2pt width 2pt \hskip .5em\relax}
\newcommand{\cabeceraespecial}{\color{Color}\normalfont\bfseries}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\cabeceraespecial\marcador,
notefont=\cabeceraespecial,
notebraces={(}{)},
bodyfont=\normalfont\itshape,
postheadspace=1em,
headindent=0pt,
headpunct={.}
]{importante}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\normalfont\itshape\color{Color},
notefont=\normalfont,
notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
headindent=0pt,
headpunct={.}
]{normal}
\declaretheoremstyle[
spaceabove=\medskipamount,
spacebelow=\medskipamount,
headfont=\normalfont\itshape\color{Color},
notefont=\normalfont,
notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
headindent=0pt,
headpunct={.},
numbered=no,
qed=\color{Color}QED
]{demostracion}

\declaretheorem[name=Theorem,style=importante,numberwithin=chapter]{theorem}

\declaretheorem[name=Remark,style=normal,sibling=theorem]{remark}

\declaretheorem[name=Corollary,style=normal,sibling=theorem]{corollary}


\declaretheorem[name=Proposition,style=importante,sibling=theorem]{proposition}



\declaretheorem[name=Lemma,style=importante,sibling=theorem]{lemma}
\declaretheorem[name=Example,style=normal,sibling=theorem]{ej}
\declaretheorem[name=Definition,style=importante,sibling=theorem]{definition}
\let\proof=\undefined
\declaretheorem[name=Proof,style=demostracion]{proof}



\begin{document}

\end{document}

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.