标题页中的表格和 tcolorbox 出现错误

标题页中的表格和 tcolorbox 出现错误

我的标题页有问题。错误如下:

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

以及与此相关的另外 7 个错误。

我的源代码如下:

{\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

我知道这与表无关,因为当我删除环境时,\begin{table}错误就转到了tcolorbox环境... 之前表运行正常。我已经尝试了在其他问题中看到的很多方法,但都没有解决问题。可能与“垂直模式”有关?

答案1

主要错误在于它\documentfront定义了 2 个参数,但在代码中只使用了一个。

\IfEqCase用错了。我改用了一个更简单的\ifcase...\fi表述。

in与特殊的tcolorbox一起\documentfront使用更为合适documentfrontbox

\documentcode但是,我不知道第二个参数是否应该是。

\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}

在此处输入图片描述

相关内容