Text FormattingUsing geometry package, but where do I modify page-numbering

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Using geometry package, but where do I modify page-numbering

Post by latexforever »

Hello,

I am using the geometry package to make a special page layout. Here is my MWE.

Code: Select all

\documentclass[16pt]{article}
\usepackage{geometry}
\geometry{paperheight=297mm,paperwidth=223mm}%%114--162
\usepackage{sectsty}
\sectionfont{\Huge}
\subsectionfont{\LARGE}
\subsubsectionfont{\Large}
\paragraphfont{\large\it}
\subparagraphfont{\normalsize\it}


\usepackage{lscape}


\usepackage[latin1]{inputenc}
\usepackage[frenchb,english]{babel}
\usepackage{frbib}


\begin{document}
\begin{landscape}
\section{1st thing}

\end{landscape}
\end{document}
Anyway, I want my pages to be numbered. If possible, it would be really great if the numbers were put in the right bottom corner. I have tried various freaky things with fancyhdr, but the page numbering is always, when displayed, put as if the page was in portrait mode. What can I do to prevent this and to display the numbers as I want them to?

Thanks.

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using geometry package, but where do I modify page-numbering

Post by localghost »

If you want to do a whole document in landscape format, add the landscape option to the document class. Note that the standard classes only accept font sizes from 10pt to 12pt.


Best regards
Thorsten
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Re: Using geometry package, but where do I modify page-numbering

Post by latexforever »

Thanks for your answer. Anyway, when I use this option, my pages' number are still located in the same place as before. What can I do?

Thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using geometry package, but where do I modify page-numbering

Post by localghost »

latexforever wrote:[...] What can I do? [...]
Build a real good MWE. At the moment I can't comprehend the problem.

Code: Select all

\documentclass[11pt,a4paper,english,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage{blindtext}

\parindent0em

\begin{document}
  \pagestyle{headings}
  \Blinddocument
\end{document}
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Using geometry package, but where do I modify page-numbering

Post by latexforever »

I do not understand what you do not like in my MWE (and also why your answers always appear to be so curt to me, even if it is a detail).

My problem is the pages' number problem. As I said before, it is always put as if the page was in portrait mode, even when tuning the class to landscape mode. When building my MWE, you should realize where they are placed:

Code: Select all

\documentclass[landscape,16pt]{article}
\usepackage{geometry}
\geometry{paperheight=297mm,paperwidth=223mm}%%114--162
\usepackage{sectsty}
\sectionfont{\Huge}
\subsectionfont{\LARGE}
\subsubsectionfont{\Large}
\paragraphfont{\large\it}
\subparagraphfont{\normalsize\it}


\usepackage{lscape}


\usepackage[latin1]{inputenc}
\usepackage[frenchb,english]{babel}
\usepackage{frbib}


\begin{document}
%\pagestyle{empty}
\begin{landscape}
\section{1st thing}

\end{landscape}
\end{document}
If it does not appear clear to you, please uncomment/comment the

Code: Select all

\pagestyle{empty}
command.

Thanks for your help.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using geometry package, but where do I modify page-numbering

Post by localghost »

latexforever wrote:I do not understand what you do not like in my MWE (and also why your answers always appear to be so curt to me, even if it is a detail).[...]
In your initial post you talked about fancyhdr and you associated it with the problem you descibed. But I just can't see that package loaded and used in any of your MWEs. Just omit the \geometry command with paper specifications.
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Using geometry package, but where do I modify page-numbering

Post by latexforever »

localghost wrote:[...] But I just can't see that package loaded and used in any of your MWEs.
Surely: I said in my first post that I tried with it, but it kept on not working. That is why I did not use it anymore in my MWE.

Anyway, if I omit the

Code: Select all

\geometry
command, the problem with the pages' numbering is still here, and, furthermore, the dimensions I want to use are not correctly used.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using geometry package, but where do I modify page-numbering

Post by localghost »

latexforever wrote:[...] Anyway, if I omit the

Code: Select all

\geometry
command, the problem with the pages' numbering is still here, and, furthermore, the dimensions I want to use are not correctly used.
You are specifying the wrong paper dimensions. Giving the height with 297mm and the width with 223mm makes the paper appear in portrait format. The options and environments for landscape output seem to confuse the compiler.

Here's an example with titlesec for the setup of headings as well as column titles (headers and footers) that should match your ideas.

Code: Select all

\documentclass[12pt,english,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,papersize={297mm,223mm},margin=2cm]{geometry}
\usepackage[calcwidth,pagestyles,raggedright,bf,sf]{titlesec}
\usepackage{blindtext}

%Headings setup (titlesec)
\titleformat{\section}{\normalfont\Huge\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\LARGE\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalfont\Large\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}[runin]{\normalfont\large\bfseries\itshape}{\theparagraph}{1em}{}
\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries\itshape}{\thesubparagraph}{1em}{}

% Header and footer setup (fancyhdr)
\newpagestyle{main}{%
  \headrule
  \footrule
  \sethead[\thepage][][\bfseries\sffamily\thesection\quad\sectiontitle]{\bfseries\sffamily\thesubsection\quad\subsectiontitle}{}{\thepage}
  \setfoot[][][\scshape Institution]{Title}{}{}
}

\begin{document}
  \pagestyle{main}
  \Blinddocument
\end{document}
I'm not sure but the landscape option for the document class may be omitted. I used the titlesec package because it allows to customize both with a single package instead of fancyhdr and sectsty. Consider this example as a suggestion of a basic structure. If the setup is not according to your taste, you can easily modify it by studying the manual.

Just a final remark concerning MWEs. Your code isn't one because the frbib package is not available for me. Thus I can't compile your code and the package can't be excluded as a cause for the misbehaviour.
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

Using geometry package, but where do I modify page-numbering

Post by latexforever »

Thanks for your answer. It helped me a little bit, and here is now what I shall use.

Code: Select all

    \documentclass[landscape,16pt]{article}
    \usepackage[latin1]{inputenc}
    \usepackage[frenchb,english]{babel}
    \usepackage{geometry}
    \geometry{paperheight=297mm,paperwidth=223mm,margin=2cm}%%114--162

    %\usepackage{sectsty}

    % -- For use with sectsy package -- %

    %\sectionfont{\Huge}
    %\subsectionfont{\LARGE}
    %\subsubsectionfont{\Large}
    %\paragraphfont{\large\it}
    %\subparagraphfont{\normalsize\it}

    % -- For use with sectsy package -- %


        \usepackage[calcwidth,pagestyles,raggedright,bf,sf]{titlesec}
        \titleformat{\section}{\normalfont\Huge\bfseries}{\thesection}{1em}{}
    \titleformat{\subsection}{\normalfont\LARGE\bfseries}{\thesubsection}{1em}{}
    \titleformat{\subsubsection}{\normalfont\Large\bfseries}{\thesubsubsection}{1em}{}
    \titleformat{\paragraph}[runin]{\normalfont\large\bfseries\itshape}{\theparagraph}{1em}{}
    \titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries\itshape}{\thesubparagraph}{1em}{}

        \newpagestyle{main}{%
    %      \headrule
          %\footrule
           \sethead[\begin{sideways}\thepage\end{sideways}][][\bfseries\thesection\quad\sectiontitle]{\bfseries\sffamily\thesubsection\quad\subsectiontitle}{}{\begin{sideways}\thepage\end{sideways}}
    %      \setfoot[][][\scshape Institution]{Title}{}{}
        }


    \usepackage{lscape}
    \usepackage{rotating}

    \usepackage{lipsum}


    \begin{document}

    \begin{landscape}
    \pagestyle{main}
    \section{1st thing}
    \lipsum

    \end{landscape}
    \end{document}

For example, using

Code: Select all

\usepackage[T1]{fontenc}
in my preamble makes many errors (e.g. when I build your example, my output is 99% white, and I only have bullets on some pages). I do not know why, and I am not sure you understood entirely what I wanted to do, but it is not as simple to explain as it seems.

Thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Using geometry package, but where do I modify page-numbering

Post by localghost »

Excuse me, but it seems that you haven't learned from my previous replies.
  • You can't use geometry the way you do!
  • The standard article class doesn't accept font sizes different from 10pt to 12pt!
  • You have to abandon the lscape stuff completely!
This issue is solved from my point of view now.

Regarding the missing characters you may have to install the cm-super font family or use the lmodern package.

Code: Select all

\usepackage{lmodern}
Post Reply