36

I wrote my diploma in LaTeX using Lyx, but now I have big problem to fit the output to universities' standards.

I need to remove Part/Section... title from header, I found that using:

 \pagestyle{empty}

does the job, but it also removes page numbers, and I spent more than an hour trying to fit them together, especially that in some pages I need no page numbers, while in others has to start from some number, so I'm using:

\setcounter{page}{3}

which also conflicts with the first command.

Any help will be highly appreciated, because I need to print it today, thank you in advance.

49

First of all, to change the behaviour of a single page, you have to use \thispagestyle instead of \pagestyle, which changes the style from the current page till the end of your document.

Moreover, to have just the page number in the page, you have to use the style plain and not the style empty.

This means that, to have a single page with only the page number you have to put, in that page:

\thispagestyle{plain}

The valid options, for both \thispagestyle and \pagestyle commands are:

  • plain - Just a plain page number.
  • empty - Produces empty heads and feet - no page numbers.
  • headings - Puts running headings on each page. The document style specifies what goes in the headings.
  • myheadings - You specify what is to go in the heading with the \markboth or the \markright commands.
5
  • Thx, didn't know about the plain thing, it almost worked, now the problem with Page numbering: at the first page i have \renewcommand{\partname}{brbrbr} \thispagestyle{empty} that suppose to remove everything in headers till i will use \thispagestyle again, right? then after couple pages (3 pages), i use \thispagestyle{plain} \setcounter{page}{5} the result is that first page only has no number, but the second has it, and page numbering is not reseting to 5.
    – TMS
    Jun 24 '13 at 7:37
  • @TMS The page after the one where \thispagestyle has been used, has header and footers as specified in your document class. No need to specify it again unless you want a new page with different behaviour. If, after a couple of pages you need a plain page numbered 3, yes, put there \thispagestyle{plain} \setcounter{page}{3} Jun 24 '13 at 7:44
  • but you said "from the current page on throughout the remainder of your document" so I understood the same behavior should be inherited till new using of the command. anyway suppose then that I want to not having page numbers for the first "50" pages, it's not reasonable to insert \thispagestyle in each page, is there any other way?
    – TMS
    Jun 24 '13 at 7:50
  • I meant "till the end of your document". Put \pagestyle{empty} at the beginning and at the 50th page \pagestyle{plain} or \pagestyle{.....} depending on what you want to achieve. Jun 24 '13 at 8:07
  • Oh I see, worked, thx for fast replay :)
    – TMS
    Jun 24 '13 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.