LaTeX forum ⇒ Text FormattingHeader Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Georg
Posts: 27
Joined: Mon Jan 29, 2018 4:25 pm

Header

Postby Georg » Mon Feb 05, 2018 1:29 am

Hi all,
How to move \chead position to the left side for 1-3 cm?
Thank you

User avatar
Stefan Kottwitz
Site Admin
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 05, 2018 1:41 am

Quick hack:

\chead{\hspace{-3cm}Text}

Stefan
Site admin

Georg
Posts: 27
Joined: Mon Jan 29, 2018 4:25 pm

Postby Georg » Mon Feb 05, 2018 1:48 am

Thanks, how to move \chead itself?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 05, 2018 1:57 am

Well, the content is starting shifted to the right, that is moving...

Another way would be using a box of a certain width: the box is centered by \chead (as that's the purpose of it) but the box can be wider than the content, left-aligned, so all is shifted to the left:

\chead{\makebox[6cm][l]{Text}}

Stefan
Site admin

Georg
Posts: 27
Joined: Mon Jan 29, 2018 4:25 pm

Postby Georg » Mon Feb 05, 2018 2:27 am

Can you please combine makebox with hspace?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 05, 2018 9:03 am

It can be done either this way, moving the whole box:

\chead{\hspace{-3cm}\makebox[6cm][l]{Text}}

or that way, moving the content in the box:

\chead{\makebox[6cm][l]{\hspace{-3cm}Text}}

The 3cm and 6cm are of course just samples, adjust as needed.

Stefan
Site admin

Georg
Posts: 27
Joined: Mon Jan 29, 2018 4:25 pm

Postby Georg » Mon Feb 05, 2018 12:08 pm

Thank you very much Stefan.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 6 guests