3

I can't figure out why the following code produces the table as you can see in my attachment:

 \centering
          \begin{tabular}{|m{3.5cm}|m{10.0cm}|m{2.5cm}|}
          \hline
          \centering
          \includegraphics[height=1.59cm,width=3.0cm]{img/logo} &
          \centering
          \Large{PLANO GERAL DE \\ PROTEÇÃO RADIOLÓGICA} \\
          \tiny{SPR F.02}&
          \centering
          \scriptsize{Pág. \thepage\ de \pageref{LastPage}\\
          Data: 26/07/2013\\
          Rev. 0}\tabularnewline
          \end{tabular}%

As you can see, the botton line doesn't close the table properly.

table wont close

4
  • 3
    it looks like your date line doesn't fit (you would get an overfull box warning?) if so take some space off the middle column and add it to the third. Size change commands such as \Large do not take a {} argument. You should have a blank line rather than \\ before the \tiny or the baseline spacing for the large text will be wrong. Commented Jul 25, 2013 at 17:36
  • thats a no go. If I remove the {} from \large or \tiny, it will affect the whole document. Also, line breaks must use \\, or else it wont work like it need to do.
    – erickfis
    Commented Jul 26, 2013 at 13:24
  • also, changing the sizes of the columns didn't work too...
    – erickfis
    Commented Jul 26, 2013 at 13:25
  • 3
    You misunderstand the syntax of \large using {} as you have them does not affect the scope of the font change at all. If you don't insert a blank line then the large text is being typeset on a baseline designed for tiny text so if you need that OK that is what you need. Commented Jul 26, 2013 at 14:03

2 Answers 2

3

It's difficult to be sure from the question, but it looks like what is required is a table in the header. Something like

\documentclass{article}
\usepackage{array}
\usepackage[demo]{graphicx} % Demo option means a rule is used for the image
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage[a4paper,hmargin = 1cm,headheight=50pt]{geometry}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[C]{%
  \begin{tabular}{|m{3.5cm}|m{10.0cm}|m{2.5cm}|}
  \hline
  \centering
  \includegraphics[height=1.59cm,width=3.0cm]{img/logo} &
  \centering
  {%
    \Large
    PLANO GERAL DE \\ PROTEÇÃO RADIOLÓGICA%
  }\\
  {%
    \tiny
    SPR F.02%
  }&
  \centering
  {%
    \scriptsize
    Pág. \thepage\ de \pageref{LastPage}\\
    Data: 26/07/2013\\
    Rev. 0%
  }%
  \tabularnewline
  \hline
\end{tabular}%
}
\begin{document}

Just some content

\end{document}

seems to cover it: I've adjusted the amount of header space to account for the rather large box, and tidied up the table itself somewhat. I've also treated \Large, etc. as switched, as mentioned in comments.

0

This did the job:

\pagestyle{fancy}
\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyhead[C]{%
    \centering
          \begin{tabular}{|m{3.5cm}|m{10.0cm}|m{2.5cm}|}
          \hline
          \centering
          \includegraphics[height=1.59cm,width=3.0cm]{img/logo} &
          \centering
          \Large{PROCEDIMENTO ESPECÍFICO DE \\ PROTEÇÃO RADIOLÓGICA} \\
          \tiny{SPR F.30}&
          \centering
          \scriptsize{PER \numero \\ Rev. \rev \\ Data: \data \\ Pág. \thepage\ de \pageref{LastPage}}          \tabularnewline
          \hline
          \end{tabular}%
    }      
}

Also, had to add:

\renewcommand{\headrulewidth}{}

to preamble in order to get just one line closing the table.

1
  • 3
    It did the job but is not a good example for others. The syntax of \Large etc is wrong. If you want to delimit scope do it thus: {\Large test...}. Try this in a MWE to see the problem. \Large {Test} \tiny {test}. Test.
    – yannisl
    Commented Dec 2, 2013 at 17:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .