1

I need to set the background color in my definition of the title but I don't know how I can do. I have the next definition:

\pretitle{\vspace{-90pt} \begin{flushleft} \HorRule \fontsize{20}{20} \usefont{OT1}{phv}{b}{n} \color{AzulUnir}  \selectfont }
\title{This is the title of the template article}   
\posttitle{\par\end{flushleft}\vskip 0em}   
\preauthor{\begin{flushleft} \large \lineskip 0em \usefont{OT1}{phv}{b}{sl} \color{AzulUnir}}   
\author{Firstname Lastname, 
 \postauthor{\footnotesize \usefont{OT1}{phv}{m}{sl} \color{Black} Universdad \par\end{flushleft}\HorRule}

[EDIT] I'm using this template http://www.howtotex.com/download/2col-color-art-howtotex.tex but I need to customize the background color in the title and a in the section but I don't khow how to make none of them.

migrated from stackoverflow.com Mar 7 '12 at 13:46

This question came from our site for professional and enthusiast programmers.

  • 1
    And please compose a full minimal working example (MWE) that can be compiled out of the box: For example, it is not clear where \pretitle etc. is defined - I suspect you use the titling package. Please add all the relevant information to your question. – diabonas Mar 7 '12 at 14:14
1

It's quite unclear what you want to do; however this changes the background color of the title to green (pick your favorite color)

\newsavebox{\titlebox}
\pretitle{%
  \vspace{-30pt}
  \noindent\HorRule\\[1ex]
  \begin{lrbox}{\titlebox}
  \begin{minipage}{\dimexpr\textwidth-2\fboxsep\relax}\raggedright
  \fontsize{50}{50}\usefont{OT1}{phv}{b}{n}\color{DarkRed}\selectfont
}
\posttitle{%
  \par
  \end{minipage}\end{lrbox}
  \colorbox{green}{\usebox{\titlebox}}\par
  \vskip 1ex}
\title{This is the title of the template article}

The code should go in place of your original \pretitle and \posttitle definitions.

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.