LaTeX forum ⇒ 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

Postby latexforever » Thu Jun 18, 2009 9:02 pm

Hello,

I am using the geometry package to make a special page layout. Here is my MWE.
  1. \documentclass[16pt]{article}
  2. \usepackage{geometry}
  3. \geometry{paperheight=297mm,paperwidth=223mm}%%114--162
  4. \usepackage{sectsty}
  5. \sectionfont{\Huge}
  6. \subsectionfont{\LARGE}
  7. \subsubsectionfont{\Large}
  8. \paragraphfont{\large\it}
  9. \subparagraphfont{\normalsize\it}
  10.  
  11.  
  12. \usepackage{lscape}
  13.  
  14.  
  15. \usepackage[latin1]{inputenc}
  16. \usepackage[frenchb,english]{babel}
  17. \usepackage{frbib}
  18.  
  19.  
  20. \begin{document}
  21. \begin{landscape}
  22. \section{1st thing}
  23.  
  24. \end{landscape}
  25. \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.

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

Postby localghost » Fri Jun 19, 2009 5:37 pm

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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby latexforever » Fri Jun 19, 2009 6:52 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Fri Jun 19, 2009 7:10 pm

latexforever wrote:[...] What can I do? [...]

Build a real good MWE. At the moment I can't comprehend the problem.
  1. \documentclass[11pt,a4paper,english,landscape]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin1]{inputenc}
  4. \usepackage{babel}
  5. \usepackage[includeheadfoot,margin=2cm]{geometry}
  6. \usepackage{blindtext}
  7.  
  8. \parindent0em
  9.  
  10. \begin{document}
  11. \pagestyle{headings}
  12. \Blinddocument
  13. \end{document}
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby latexforever » Fri Jun 19, 2009 7:29 pm

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:

  1. \documentclass[landscape,16pt]{article}
  2. \usepackage{geometry}
  3. \geometry{paperheight=297mm,paperwidth=223mm}%%114--162
  4. \usepackage{sectsty}
  5. \sectionfont{\Huge}
  6. \subsectionfont{\LARGE}
  7. \subsubsectionfont{\Large}
  8. \paragraphfont{\large\it}
  9. \subparagraphfont{\normalsize\it}
  10.  
  11.  
  12. \usepackage{lscape}
  13.  
  14.  
  15. \usepackage[latin1]{inputenc}
  16. \usepackage[frenchb,english]{babel}
  17. \usepackage{frbib}
  18.  
  19.  
  20. \begin{document}
  21. %\pagestyle{empty}
  22. \begin{landscape}
  23. \section{1st thing}
  24.  
  25. \end{landscape}
  26. \end{document}


If it does not appear clear to you, please uncomment/comment the
  1. \pagestyle{empty}
command.

Thanks for your help.

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

Postby localghost » Fri Jun 19, 2009 7:42 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby latexforever » Fri Jun 19, 2009 8:15 pm

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
  1. \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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sat Jun 20, 2009 1:28 pm

latexforever wrote:[...] Anyway, if I omit the
  1. \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.
  1. \documentclass[12pt,english,landscape]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin1]{inputenc}
  4. \usepackage{babel}
  5. \usepackage[includeheadfoot,papersize={297mm,223mm},margin=2cm]{geometry}
  6. \usepackage[calcwidth,pagestyles,raggedright,bf,sf]{titlesec}
  7. \usepackage{blindtext}
  8.  
  9. %Headings setup (titlesec)
  10. \titleformat{\section}{\normalfont\Huge\bfseries}{\thesection}{1em}{}
  11. \titleformat{\subsection}{\normalfont\LARGE\bfseries}{\thesubsection}{1em}{}
  12. \titleformat{\subsubsection}{\normalfont\Large\bfseries}{\thesubsubsection}{1em}{}
  13. \titleformat{\paragraph}[runin]{\normalfont\large\bfseries\itshape}{\theparagraph}{1em}{}
  14. \titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries\itshape}{\thesubparagraph}{1em}{}
  15.  
  16. % Header and footer setup (fancyhdr)
  17. \newpagestyle{main}{%
  18. \headrule
  19. \footrule
  20. \sethead[\thepage][][\bfseries\sffamily\thesection\quad\sectiontitle]{\bfseries\sffamily\thesubsection\quad\subsectiontitle}{}{\thepage}
  21. \setfoot[][][\scshape Institution]{Title}{}{}
  22. }
  23.  
  24. \begin{document}
  25. \pagestyle{main}
  26. \Blinddocument
  27. \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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby latexforever » Sat Jun 20, 2009 2:10 pm

Thanks for your answer. It helped me a little bit, and here is now what I shall use.
  1. \documentclass[landscape,16pt]{article}
  2. \usepackage[latin1]{inputenc}
  3. \usepackage[frenchb,english]{babel}
  4. \usepackage{geometry}
  5. \geometry{paperheight=297mm,paperwidth=223mm,margin=2cm}%%114--162
  6.  
  7. %\usepackage{sectsty}
  8.  
  9. % -- For use with sectsy package -- %
  10.  
  11. %\sectionfont{\Huge}
  12. %\subsectionfont{\LARGE}
  13. %\subsubsectionfont{\Large}
  14. %\paragraphfont{\large\it}
  15. %\subparagraphfont{\normalsize\it}
  16.  
  17. % -- For use with sectsy package -- %
  18.  
  19.  
  20. \usepackage[calcwidth,pagestyles,raggedright,bf,sf]{titlesec}
  21. \titleformat{\section}{\normalfont\Huge\bfseries}{\thesection}{1em}{}
  22. \titleformat{\subsection}{\normalfont\LARGE\bfseries}{\thesubsection}{1em}{}
  23. \titleformat{\subsubsection}{\normalfont\Large\bfseries}{\thesubsubsection}{1em}{}
  24. \titleformat{\paragraph}[runin]{\normalfont\large\bfseries\itshape}{\theparagraph}{1em}{}
  25. \titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries\itshape}{\thesubparagraph}{1em}{}
  26.  
  27. \newpagestyle{main}{%
  28. % \headrule
  29. %\footrule
  30. \sethead[\begin{sideways}\thepage\end{sideways}][][\bfseries\thesection\quad\sectiontitle]{\bfseries\sffamily\thesubsection\quad\subsectiontitle}{}{\begin{sideways}\thepage\end{sideways}}
  31. % \setfoot[][][\scshape Institution]{Title}{}{}
  32. }
  33.  
  34.  
  35. \usepackage{lscape}
  36. \usepackage{rotating}
  37.  
  38. \usepackage{lipsum}
  39.  
  40.  
  41. \begin{document}
  42.  
  43. \begin{landscape}
  44. \pagestyle{main}
  45. \section{1st thing}
  46. \lipsum
  47.  
  48. \end{landscape}
  49. \end{document}
  50.  


For example, using
  1. \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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sat Jun 20, 2009 2:44 pm

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.
  1. \usepackage{lmodern}
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests