4

When I use this code: \toprule works well. \bottomrule appear on the bottom but this error occurs: misplaced \noalign \bottomrule. You know why? Thank you!

\begin{quadro}
\caption{Experiência com ensino de italiano - grupos 1 e 2}
\label{quad:experiencia_com_ensino_de_italiano_grupos1_e2}
 \begin{tabular}{c}
 \toprule
 \begin{minipage}{.5\textwidth}
  \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento. 
     \begin{bchart}[step=50, max=100, unit=\%, scale=0.4]
          \bcxlabel{Grupo 1}
          \bcbar[label=Sim]{76}
              \medskip
          \bcbar[label=Não]{24}
    \end{bchart}
\end{minipage} 
\begin{minipage}{.5\textwidth}
   \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento. 
   \begin{bchart}[step=50,max=100, unit=\%, scale=0.4]
   \bcxlabel{Grupo2}
          \bcbar[label=Sim]{91}
              \medskip
          \bcbar[label=Não]{9}
 \end{bchart}
 \end{minipage}
 \bottomrule
 \end{tabular}
 \end{quadro}
  • You can only place rules after the table preamble or after a line change command ` \\ ` (or similar). – Gonzalo Medina Feb 8 '14 at 3:18
  • in addition to needing \\ before the rule, your table will be too wide, the content of the c column is two minipages .5\textwidth wide separated by an inter-word-space, and then you have \tabcolsep space either side from the table padding so the total is 2\tabcolsep+ 1space wider than the page. – David Carlisle Feb 8 '14 at 3:22
4

You can only place rules after the table preamble or after a line change command \\ (or similar). You can add \\ after the last minipage:

\documentclass[draft]{article}
\usepackage{newfloat}
\usepackage{booktabs}
\usepackage{bchart}

\DeclareFloatingEnvironment{quadro}

\begin{document}

\begin{quadro}
\caption{Experiência com ensino de italiano - grupos 1 e 2}
\label{quad:experiencia_com_ensino_de_italiano_grupos1_e2}
 \begin{tabular}{@{}c@{}}
 \toprule
 \begin{minipage}{.5\textwidth}
  \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento. 
     \begin{bchart}[step=50, max=100, unit=\%, scale=0.4]
          \bcxlabel{Grupo 1}
          \bcbar[label=Sim]{76}
              \medskip
          \bcbar[label=Não]{24}
    \end{bchart}
\end{minipage}% 
\begin{minipage}{.5\textwidth}
   \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento. 
   \begin{bchart}[step=50,max=100, unit=\%, scale=0.4]
   \bcxlabel{Grupo2}
          \bcbar[label=Sim]{91}
              \medskip
          \bcbar[label=Não]{9}
 \end{bchart}
 \end{minipage}\\
 \bottomrule
 \end{tabular}
 \end{quadro}

\end{document}

enter image description here

Notice that I commented out a superfluous blank space after the first \end{minipage} (otherwise, you'll get an overfull \hbox). I also killed the space before and after the tabular contents using @{}c@{} (again, to prevent an overfull \hbox).

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.