Page Layoutcentre the text

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

centre the text

Post by allevo »

hi!!!!
i have a problem: I'd want that my text is centre in the page. i create new page style with this command:

Code: Select all

\newpagestyle{chapterpage}
{
\addtolength{\voffset}{-1in}
\addtolength{\hoffset}{-1in}
\setlength\topmargin{0mm}
\setlength\headheight{0mm}
\setlength\headsep{0mm}
\setlength\marginparsep{0mm}
\setlength\marginparwidth{0mm}
\textwidth = 0.9\paperwidth
\setlength\oddsidemargin{0.05\paperwidth }
\setlength\evensidemargin{\oddsidemargin}
}
ad I apply with this line:

Code: Select all

\chapter{ola!!}
\pagestyle{chapterpage}
text
but the text is not centre. why?! and how can i centre the text?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

centre the text

Post by Stefan Kottwitz »

Hi Allevo,

do you want to center horizontally or vertically? Try \centering or \begin{center} ... \end{center} for the first. To center vertically you could insert \vspace*{\fill} both at the beginning and at the end of the page.

Stefan
LaTeX.org admin
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

centre the text

Post by allevo »

i apologize..... I wish that my text is centered with respect to page. the space of the text isn't center.
can i follow my aim with this

Code: Select all

\textwidth = 0.9\paperwidth
\setlength\oddsidemargin{0.05\paperwidth }
?!?!?!?!?!?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

centre the text

Post by localghost »

Forget about all those settings and use the geometry package to set up page dimensions.


Best regards
Thorsten¹
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

centre the text

Post by allevo »

I used this and it worked

Code: Select all

\usepackage{anysize}
\marginsize{0.1\paperwidth}{0.1\paperheight}{2cm}{2cm}
is correct?!?!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

centre the text

Post by localghost »

The anysize package is obsolete and should be replaced by the earlier suggested geometry package.
Post Reply