Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: LaTeX page numbering

  1. #1
    Join Date
    Jun 2005
    Location
    Madrid
    Beans
    212
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Question LaTeX page numbering

    I have a LaTeX file in which I don't want a page number to be printed. Its preamble looks like this:
    Code:
    \documentclass[a4paper,10pt]{article}
    \usepackage[left=2.5cm,right=1.85cm,top=2.5cm,bottom=2cm,noheadfoot]{geometry}
    \usepackage[utf8]{inputenc}
    \usepackage{indentfirst}
    \usepackage{url}
    \pagestyle{empty}
    \title{}
    \author{Ferio}
    \date{}
    I've just learned from Guide to LaTeX, 4th edition, by Helmut Kopka and Patrick W. Daly, that the "\pagestyle{empty}" command should do the trick, but it doesn't work. Am I wrong? If so, how could I do it?

    Thank you in advance.

  2. #2
    Join Date
    Mar 2007
    Beans
    267

    Re: LaTeX page numbering

    I just copied your lines, added

    \begin{document}
    TEST
    \end{document}


    .. and got an empty page with the word TEST on. Seems to work as it should.

    (But if want a title you also need to add \maketitle after begin{document})
    Last edited by xadder; March 26th, 2007 at 07:56 AM.

  3. #3
    Join Date
    Sep 2005
    Beans
    463
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: LaTeX page numbering

    Hi there, I've just started with latex myself and when I use the \pagestyle{empty} option it doesn't work either when I use article as a document class in the preamble. However when I change this the class to book the option does work...

  4. #4
    Join Date
    Mar 2007
    Location
    BC, Canada
    Beans
    358
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: LaTeX page numbering

    Hi. Your latex code works for me.
    Code:
    \documentclass[a4paper,10pt]{article}
    \usepackage[left=2.5cm,right=1.85cm,top=2.5cm,bottom=2cm,noheadfoot]{geometry}
    \usepackage[utf8]{inputenc}
    \usepackage{indentfirst}
    \usepackage{url}
    \pagestyle{empty}
    \title{}
    \author{Ferio}
    \date{}
    \begin{document}
    Hello World.
    \end{document}
    commenting out the pagestyle line produces a document with a page number.

    I'm not sure what is going wrong, maybe you are missing a package. were there any output warnings?

  5. #5
    Join Date
    Mar 2007
    Location
    BC, Canada
    Beans
    358
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: LaTeX page numbering

    that's weird. after six hours of no response, three of us replied at exactly the same time (within 1 minute of each other).

  6. #6
    Join Date
    Jun 2005
    Location
    Madrid
    Beans
    212
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: LaTeX page numbering

    In fact I've just tested it, and the problem i's the very "\maketitle" command that is triggering the number apparition. Any idea on how to get a title but not a number?

  7. #7
    Join Date
    Jun 2005
    Location
    Madrid
    Beans
    212
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: LaTeX page numbering

    I've just found that the "\maketitle" command makes the number appear; if you're using it, try to remove it and see whether it disappears or not.

    Now it's just a question of finding out how to get a title but not a page number.

  8. #8
    Join Date
    Jun 2005
    Location
    Madrid
    Beans
    212
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: LaTeX page numbering

    There are warnings, but they're about the bullets for the lists I'm using in the body. The problem seems to be the "\maketitle" command (I thought my problem was in the preamble, not in the body); removing it makes the page number disappear, and if you take it back, the number reappears.

    Now it's just a matter of finding out how to get a title but not a number.

  9. #9
    Join Date
    Jun 2005
    Location
    Madrid
    Beans
    212
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: LaTeX page numbering

    There's not such thing as a coincidence. As they used to said in "Lost" (and I can't believe I'm quoting a TV show):
    Everythng happens for a reason
    You three replying at once, LaTeX behaving weird...

  10. #10
    Join Date
    Sep 2005
    Beans
    463
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: LaTeX page numbering

    I was looking for arguments for the \maketitle command, but no luck so far... it appears that the package uses \pagestyle to generate the pagenumber...

    Now I've been messing around a bit with a document I already had and when changing the document class to book instead of article, adding \thispagestyle{empty} to the title section the first page number is gone!

    To restart numbering at the first page after the title I added
    \setcounter{page}{1}

    It's a work around, but not the best solution imo! Keep us updated when you come up with something!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •