2

I have a problem in my titlepage. The error is:

Extra \endgroup. \end{titlepage} and \begin{document} ended by \end{titlepage}. \end{titlepage} and Too many }'s. \end{table}

and another 7 errors related to that.

My source code is the following:

{\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[version=4]{mhchem}
%\usepackage{fourier} % Use the Adobe Utopia font for the document -     comment this line to return to the LaTeX default
\usepackage{listings}
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[intoc,portuguese]{nomencl}
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage[scientific-notation=true]{siunitx}
\sisetup{locale = FR}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fancyhdr} % Custom headers and footers
\renewcommand{\footrulewidth}{0.4pt}
\usepackage{parskip}
\usepackage{geometry}
%\setmarginsrb{leftmargin}{topmargin}{rightmargin}{bottommargin}
%{headheight}{headsep}{footheight}{footskip}
\usepackage{xcolor}%boxes
\spaceskip=1.0\fontdimen2\font plus 1.5\fontdimen3\font
minus 1.5\fontdimen4\font
\usepackage{courier}
\usepackage{tcolorbox}
\usepackage{lastpage}
\usepackage{xstring} %tentar fazer o if color
\title{PADRONIZAÇÃO DOS PROCESSOS}% Title
\author{Glauco Goebel Tirollo}% Author
\date{28/setembro/2017} % Date




\newcommand{\documentfront}[2]{
\IfEqCase{#1}{
{1}{\texttt{\begin{LARGE}PLANO DE AÇÃO\end{LARGE}}\\[1.0 cm]
\begin{tcolorbox}[colback=red!80!white,colframe=white,arc=0p]{\begin{minipage}{\paperwidth} \hfill \vspace{1.5cm} \end{minipage}}         \end{tcolorbox}
\centering
\\[1.0 cm]} % University Name
{2}{\texttt{\begin{LARGE}MODELO\end{LARGE}}\\[1.0 cm]
\begin{tcolorbox}[colback=blue!80!white,colframe=white,arc=0pt]{\begin{minipage}{\paperwidth} \hfill \vspace{1.5cm} \end{minipage}}     \end{tcolorbox}
\centering
\\[1.0 cm]} 
}}

\newcommand{\documentcode}{2} %1 para plano de ação e 2 para modelo
\newcommand{\revisor}{Lucas J. Pires}
\newcommand{\revdate}{1/outubro/2017}
\newcommand{\revnumber}{0}
\newcommand{\equipe}{Colocar nome dos integrantes}
\newcommand{\tempoestimado}{X dias úteis}

\makeatletter
\let\thetitle\@title
\let\theauthor\@author
\let\thedate\@date
\makeatother

 \pagestyle{fancy}
\fancyhf{}
\rhead{\theauthor}
\lhead{\thetitle}
\rfoot{\thepage/\pageref{LastPage}}
\cfoot{\jobname}
\lfoot{Tubanharon Process Engineering}

%\include{nomenclatura.tex}

\numberwithin{equation}{section} % Number equations within sections (i.e.     1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text


\begin{document}

    \begin{titlepage}
        \newgeometry{margin=0cm}
        \flushright{\includegraphics[scale = 1.2]{logo}\\[2.0 cm]}% University Logo
    \centering
    \vspace{2cm}
    \rule{0.8\linewidth}{0.2 mm} \\[0.4cm]
    { \huge \bfseries \thetitle}\\
    \rule{0.8\linewidth}{0.2 mm} \\[1.5 cm]
    \documentfront{\documentcode}
    \begin{table}[h] \centering
        \begin{tabular}{l|l|l|l}
            %\hline
            \textbf{Autor} &  \theauthor  & \textbf{Revisado por} & \revisor \\ \hline
            \textbf{Data}   &  \thedate & \textbf{Data de revisão}  & \revdate \\ \hline
            \textbf{Nº da revisão} & \revnumber & \textbf{Nº páginas} & \pageref{LastPage} \\ \hline
            \textbf{Tempo estimado} & \tempoestimado & \textbf{ID documento} & \jobname \\
            %\hline
        \end{tabular}
    \end{table}

    \begin{tcolorbox}[title={\flushleft\textbf\normalfont\LARGE{Resumo Executivo}},width=\paperwidth]
        Aqui vai o resumo, este resumo explica o que o leitor vai encontrar no documento. Ele está na capa pois estava sobrando espaço e vale a pena fazer o leitor identificar rapidamente o que está vendo. Como é um conteúdo interno vale a pena deixar aqui na capa.
    \end{tcolorbox}
    %\restoregeometry
\end{titlepage}     
\printnomenclature

I know that it's not related to the table, because when I removed the enviroment \begin{table} the error went to the tcolorbox enviroment... And the table was running ok before. I already tried a lot of things i saw in other questions but none of them solved the problem. Something related to the "vertical mode" might be possible?

  • 3
    Please provide a full document, not just fragments – user31729 Oct 3 '17 at 15:08
  • Your code is still not complete – user31729 Oct 3 '17 at 16:22
  • Sorry, just did it now. – Glauco Goebel Tirollo Oct 3 '17 at 16:23
  • 1
    The cause of your problem is \documentfront. That command expects two arguments but you're calling it one only – user31729 Oct 3 '17 at 16:26
  • And the nested minipage in the tcolorbox is weird, the usage of \IfEqCase is wrong – user31729 Oct 3 '17 at 16:33
3

The main error is that \documentfront is defined with 2 arguments but uses only one in the code.

Also \IfEqCase is used wrong. I switched to an easier \ifcase...\fi statement.

The tcolorbox in \documentfront is used more appropriately with a special documentfrontbox.

I have no idea whether the 2nd argument should be \documentcode, however.

\documentclass[paper=a4, fontsize=11pt,demo]{scrartcl} % A4 paper and 11pt font size
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[version=4]{mhchem}
% \usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage{listings}
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage[intoc,portuguese]{nomencl}
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage[scientific-notation=true]{siunitx}
\sisetup{locale = FR}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fancyhdr} % Custom headers and footers
\renewcommand{\footrulewidth}{0.4pt}
\usepackage{parskip}
\usepackage{geometry}
%\setmarginsrb{leftmargin}{topmargin}{rightmargin}{bottommargin}
%{headheight}{headsep}{footheight}{footskip}
\usepackage{xcolor}%boxes
\spaceskip=1.0\fontdimen2\font plus 1.5\fontdimen3\font
minus 1.5\fontdimen4\font
\usepackage{courier}
\usepackage[most]{tcolorbox}
\usepackage{lastpage}
\usepackage{xstring} %tentar fazer o if color


\title{PADRONIZAÇÃO DOS PROCESSOS}% Title
\author{Glauco Goebel Tirollo}% Author
\date{28/setembro/2017} % Date


\newtcolorbox{documentfrontbox}[1][]{
  nobeforeafter,
  enhanced,
  colback=red!80!white,
  frame hidden,
  sharp corners,
  code={\parindent=0em},
  width=\dimexpr\paperwidth+1pt,
  left skip=-1pt,
  height=2cm,
  #1
}



\newcommand{\documentfront}[2]{%
  \ifcase#1%
  \or% Check for 1
  \texttt{\LARGE PLANO DE AÇÃO}\\[1.0 cm]%
  \begin{documentfrontbox}
    \hfill%
  \end{documentfrontbox}%
  \centering \\[1.0pt]%
  \or% Check for 2
  \texttt{\LARGE PLANO DE AÇÃO}\\[1.0 cm]%
  \begin{documentfrontbox}[colback=blue!80!white]
    \hfill%
  \end{documentfrontbox}%
  \centering \\[1.0pt]%
  \fi
}


\newcommand{\documentcode}{2} %1 para plano de ação e 2 para modelo
\newcommand{\revisor}{Lucas J. Pires}
\newcommand{\revdate}{1/outubro/2017}
\newcommand{\revnumber}{0}
\newcommand{\equipe}{Colocar nome dos integrantes}
\newcommand{\tempoestimado}{X dias úteis}



%colocar título à esquerda

%courier new - ficha técnica
%century gothic - documentos para fora da empresa
%documentos internos - fonte padrão do tex
%exportação de arquivos do excel para latex
%referências
%como transportar modelo antigo para o novo manual
%padrão MLT
%defm{state,flow,element}

\makeatletter
\let\thetitle\@title
\let\theauthor\@author
\let\thedate\@date
\makeatother


\pagestyle{fancy}
\fancyhf{}
\rhead{\theauthor}
\lhead{\thetitle}
\rfoot{\thepage/\pageref{LastPage}}
\cfoot{\jobname}
\lfoot{Tubanharon Process Engineering}

%\include{nomenclatura.tex}

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

\setlength\parindent{0em} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text

%----------------------------------------------------------------------------------------
%   TITLE SECTION
%----------------------------------------------------------------------------------------




\begin{document}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \begin{titlepage}
        \newgeometry{margin=0cm}
        \includegraphics[scale = 1.2]{logo}\\[2.0 cm]% University Logo
        \centering
        \vspace{2cm}
        \rule{0.8\linewidth}{0.2 mm} \\[0.4cm]
        { \huge \bfseries \thetitle}\\
        \rule{0.8\linewidth}{0.2 mm} \\[1.5 cm]
        \documentfront{2}{\documentcode}
        \begin{table}[h] \centering
            \begin{tabular}{l|l|l|l}
                %\hline
                \textbf{Autor} &  \theauthor  & \textbf{Revisado por} & \revisor \\ \hline
                \textbf{Data}   &  \thedate & \textbf{Data de revisão}  & \revdate \\ \hline
                \textbf{Nº da revisão} & \revnumber & \textbf{Nº páginas} & \pageref{LastPage} \\ \hline
                \textbf{Tempo estimado} & \tempoestimado & \textbf{ID documento} & \jobname \\
                %\hline
            \end{tabular}
        \end{table}

        \begin{tcolorbox}[title = {\flushleft\textbf\normalfont\LARGE{Resumo Executivo}},width=\paperwidth]
            Aqui vai o resumo, este resumo explica o que o leitor vai encontrar no documento. Ele está na capa pois estava sobrando espaço e vale a pena fazer o leitor identificar rapidamente o que está vendo. Como é um conteúdo interno vale a pena deixar aqui na capa.
        \end{tcolorbox}
        \restoregeometry
      \end{titlepage}     
\end{document}

enter image description here

  • Be sure to remove the demo option from the \documentclass option list – user31729 Oct 3 '17 at 17:11
  • This is very ugly. But that i not your fault of course. – Johannes_B Oct 7 '17 at 6:22
  • @Johannes_B: Yes, it is ugly... – user31729 Oct 7 '17 at 19:25

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.