TransWikia.com

Centering section title in new environment

TeX - LaTeX Asked by Alchemist on January 3, 2021

“I have defined a new environment for the sections for a CV template. I’m not sure how to center the section title in this code. Could someone help me, please?

newenvironment{rSection}[1] 
{ 

% 1 input argument - section name

    sectionskip

    begingroup

    colorbox{mygrey} 
{

    {rlap{MakeUppercase{bf #1}}hspace{linewidth}hspace{-2fboxsep}}

     }

    endgroup

    begin{list}{} { setlength{leftmargin}{0 em} } item[] } { end{list}

    }

One Answer

Try to use center environment like this:

begin{center}
  Section title
end{center}

or the command centering like this :

begingroup
centering
colorbox{mygrey} 
{

{rlap{MakeUppercase{bf #1}}hspace{linewidth}hspace{-2fboxsep}}

Section title }
....
....

Answered by Compiii on January 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP