I'm trying to create a class to typeset a government gazette. this is the template I'm following, although I don't care about all the colours.

I'm using the article class as a baseline (with the twocolumn option on), fancyhdr to make the header and footer, except for the first page, where I'm trying to redefine maketitle to a header-like structure, similar to the template (it doesn't have to be fancy, the logo and the text in black and white would suffice).

my problem is that the title created by the \maketitle command is invading the text in the second column, as is ignoring the rule that separates the columns, as in:

enter image description here

is there a way of making the title more similar to the linked PDF above?

I've based my class mostly in the newspaper package. here is the class code:

\ProvidesClass{doliberto}[2017/09/21 Mesquita's D.O. class]

%% load article class with options
\LoadClass[twocolumn, a4paper, 10pt]{article}

% pass unused options to article

%% package loading

% brazilian portuguese support in XeLaTeX

%% variables

% counters

% date
\newcommand{\dataextenso}{\arabic{day} de \DTMportugesmonthname{\arabic{month}} de \arabic{year}}

% whose D.O.
\renewcommand{\@author}{Prefeitura Municipal de Mesquita}

%% text dimensions (for now, defaults from newspaper package)
\setlength\topmargin{-48pt} % article default = -58pt
%\setlength\headheight{0pt} % article default = 12pt
\setlength\headsep{34pt} % article default = 25pt
\setlength\marginparwidth{-20pt} % article default = 121pt
\setlength\textwidth{504pt} % article default = 418pt
\setlength\textheight{684pt} % article default = 296pt

\lfoot{{\footnotesize \url{\@site}}}
\rfoot{{\footnotesize \href{mailto:\@email}{\@email}}}

{\huge Diário Oficial}\hfill%   
\raisebox{12pt}{\textbf{\footnotesize \@author}}\\
{\small {\small\@location, \dataextenso} \hfill \textbf{Diário Oficial Nº \arabic{issue}}}\\

\lhead{{\small\@location, \dataextenso}}
\chead{\textbf{Diário Oficial Nº \arabic{issue}}}
\rhead{{\small \@author}}
\lfoot{{\footnotesize \url{\@site}}}
\rfoot{{\footnotesize \href{mailto:\@email}{\@email}}}


%% DOli macros

%% this must be in .tex file
% \titleformat*{\section}[block]{\large\bfseries\filcenter}{\thesection}{1em}{\MakeUppercase}

%% macros

% título do ato
\newcommand\headline[1]{\begin{center} {\bfseries \MakeUppercase{#1}} \end{center} \par}
% quem assina
\newcommand\byline[2]{\begin{center} {\bfseries \MakeUppercase{#1}} \\%
            {\small\bfseries #2} \\ %
            \rule[3pt]{0.4\hsize}{0.5pt}\\ \end{center} \par}
% separando seções de cada secretaria


%% needs xelatex to compile!
%% you can choose your tex engine on sharelatex/overleaf, or
%% (preferrable) download TeXlive!


\section{Secretaria Municipal de Educação}

\headline{Portaria Nº 394/2017} 


\byline{Thaís dos Santos Lima}{Secretário Municipal de Educação}


\section{Conselho Municipal da Criança e do Adolescente}

\headline{RESOLUÇÃO CMDCA Nº 003 / 2017.}


\byline{Jacqueline  Freitas}{\quad}

  • Hint: You can use the blindtext package to generate fill text. – Dr. Manuel Kuehner Sep 25 '17 at 19:38

You could use \maketitle inside a minipage to make it stay within the column width.


enter image description here

or to have the title span the whole page follow the suggestion of David Carlisle:


enter image description here

Alternatively if the changes should happen in the .sty file:

{\huge Diário Oficial}\hfill%   
\raisebox{12pt}{\textbf{\footnotesize \@author}}\\
{\small {\small\@location, \dataextenso} \hfill \textbf{Diário Oficial Nº \arabic{issue}}}\\
  • that looks good! thanks! can I do something similar to get the title to span both columns? – bruno cuconato Sep 25 '17 at 19:45
  • the minipage is just essentially being used to redefine \textwidth here I think – David Carlisle Sep 25 '17 at 19:49
  • @brunocuconato yes the standard article \maketitle already spans both columns, see in article.cls just make \maketitle do \twocolumn[\@maketitle]% wheer \@maketitke is your main title code. – David Carlisle Sep 25 '17 at 19:52
  • thanks for the help! that's what I wanted :) as I understand, and @David Carlisle pointed out, \maketitle should be on two columns already, so why do we need to use this? (but again, it works great!) – bruno cuconato Sep 25 '17 at 19:58
  • @DavidCarlisle Thanks a lot for your comment! I included your suggestion into my answer and removed the superfluous \begin{@twocolumnfalse}... If you would like to edit your own answer and include it there, I going to revert my edit. – user36296 Sep 25 '17 at 20:05

makes a rule that is \textwidth wide (that is, it will span both columns) you presumably intended \columnwidth

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.