<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">

<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->


<meta>
      <topic id="textswriterguidepagenumbersxml" indexer="include" status="PUBLISH">
         <title id="tit">Page Numbers</title>
         <filename>/text/swriter/guide/pagenumbers.xhp</filename>
      </topic>
   </meta>
   <body>
<bookmark branch="index" id="bm_id5918759"><bookmark_value>page numbers;inserting/defining/formatting</bookmark_value>
      <bookmark_value>page styles;page numbering</bookmark_value>
      <bookmark_value>starting page numbers</bookmark_value>
      <bookmark_value>formatting;page numbers</bookmark_value>
      <bookmark_value>defining;starting page numbers</bookmark_value>
      <bookmark_value>inserting;page numbers</bookmark_value>
      <bookmark_value>styles;page numbers</bookmark_value>
</bookmark><comment>mw inserted six index entries</comment><comment>mw added "styles;"</comment>
<h1 id="hd_id413830"><variable id="pagenumbers"><link href="text/swriter/guide/pagenumbers.xhp">Page Numbers</link>
</variable></h1>
      <paragraph id="par_id1617175" role="paragraph">In Writer, a page number is a field that you can insert into your text.</paragraph>
      <h2 id="hd_id831673188050537">To Quickly Insert a Page Number in Header or Footer of Page Style</h2>
      <paragraph role="paragraph" id="par_id771673188070892">Choose <link href="text/swriter/01/pagenumbering.xhp"><menuitem>Insert - Page Numbers</menuitem></link> to open a dialog to guide you in inserting a page number in the current page style header or footer and setting the page number alignment.</paragraph>

      <h2 id="hd_id6091494">To Insert Page Numbers</h2>
      <paragraph id="par_id8611102" role="paragraph">Choose <menuitem>Insert - Field - Page Number</menuitem> to insert a page number at the current cursor position.</paragraph>
      <tip id="par_id6604510">If you see the text "Page number" instead of the number, choose <menuitem>View - Field Names</menuitem> (<switchinline select="sys"><caseinline select="MAC"><keycode>Command+F9</keycode></caseinline><defaultinline><keycode>Ctrl+F9</keycode></defaultinline></switchinline>).</tip>
      <paragraph id="par_id2678914" role="paragraph">However, these fields will change position when you add or remove text. So it is best to insert the page number field into a header or footer that has the same position and that is repeated on every page.</paragraph>
      <paragraph id="par_id614642" role="paragraph">Choose <item type="menuitem">Insert - Header and Footer - Header - (name of page style)</item> or <item type="menuitem">Insert - Header and Footer - Footer - (name of page style)</item> to add a header or footer to all pages with the current page style.</paragraph>
      <h2 id="hd_id2551652">To Start With a Defined Page Number</h2>
      <paragraph id="par_id6111941" role="paragraph">Now you want some more control on page numbers. You are writing a text document that should start with page number 12.</paragraph>
      <list type="ordered">
         <listitem>
            <paragraph id="par_id5757621" role="listitem">Click into the first paragraph of your document.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id2632831" role="listitem">Choose <menuitem>Format - Paragraph - Text flow</menuitem> tab.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id4395275" role="listitem">In the Breaks area, enable <emph>Insert</emph>. Enable <emph>With Page Style</emph> just to be able to set the new <emph>Page number</emph>. Click <emph>OK</emph>.</paragraph>
         </listitem>
      </list>
      <note id="par_id1654408">The new page number is an attribute of the first paragraph of the page.</note>
      <h2 id="hd_id7519150">To Select the Page Number Format</h2>
      <paragraph id="par_id9029206" role="paragraph">You want roman page numbers running i, ii, iii, iv, and so on.</paragraph>
      <list type="ordered">
         <listitem>
            <paragraph id="par_id3032319" role="listitem">Double-click directly before the page number field. You see the <emph>Edit Fields</emph> dialog.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id9139378" role="listitem">Select a number format and click <emph>OK</emph>.</paragraph>
         </listitem>
      </list>
      <h2 id="hd_id5051728">Using Different Page Number Formats in Headers and Footers</h2>
      <paragraph id="par_id1558885" role="paragraph">You need some pages with the roman numbering format, followed by the remaining pages in another format.</paragraph>
      <paragraph id="par_id1541184" role="paragraph">In Writer, you will need different page styles. The first page style has a footer with a page number field formatted for roman numbers. The following page style has a footer with a page number field formatted in another look.</paragraph>
      <paragraph id="par_id18616" role="paragraph">Both page styles must be separated by a page break. In Writer, you can have automatic page breaks and manually inserted page breaks.</paragraph>
      <list type="unordered">
         <listitem>
            <paragraph id="par_id6138492" role="paragraph">An <emph>automatic page break</emph> appears at the end of a page when the page style has a different "next style".</paragraph>
          <paragraph id="par_id4569231" role="paragraph">For example, the “First Page” page style has “Default Page Style” as the next style. To see this, press <switchinline select="sys"><caseinline select="MAC"><keycode>Command+T</keycode></caseinline><defaultinline><keycode>F11</keycode></defaultinline></switchinline> to open the <menuitem>Styles</menuitem> window, click the <menuitem>Page Styles</menuitem> icon, right-click the "First Page" entry. Choose <menuitem>Edit Style</menuitem> from the context menu. On the <menuitem>General</menuitem> tab, you can see the “Next style”.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id291451" role="paragraph">A <emph>manually inserted page break</emph> can be applied without or with a change of page styles.</paragraph>
            <paragraph id="par_id3341776" role="paragraph">If you just press <switchinline select="sys"><caseinline select="MAC"><keycode>Command+Enter</keycode></caseinline><defaultinline><keycode>Ctrl+Enter</keycode></defaultinline></switchinline>, you apply a page break without a change of styles.</paragraph>
            <paragraph id="par_id5947141" role="paragraph">If you choose <menuitem>Insert - More Breaks - Manual Break</menuitem>, you can insert a page break without or with a change of style or with a change of page number.</paragraph>
         </listitem>
      </list>
      <paragraph id="par_id1911679" role="paragraph">It depends on your document what is best: to use a manually inserted page break between page styles, or to use an automatic change. If you just need one title page with a different style than the other pages, you can use the automatic method:</paragraph>
      <h3 id="hd_id9364909">To Apply a Different Page Style to the First Page</h3>
      <list type="ordered">
         <listitem>
            <paragraph id="par_id4473403" role="listitem">Click into the first page of your document.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id4313791" role="listitem">Choose <menuitem>View - Styles</menuitem> (<switchinline select="sys"><caseinline select="MAC"><keycode>Command+T</keycode></caseinline><defaultinline><keycode>F11</keycode></defaultinline></switchinline>).</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id4331797" role="listitem">In the <emph>Styles</emph> window, click the <emph>Page Styles</emph> icon.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id4191717" role="listitem">Double-click the "First Page" style.</paragraph>
         </listitem>
      </list>
      <paragraph id="par_id2318796" role="paragraph">Now your title page has the style "First Page", and the next pages automatically have the "Default Page Style".</paragraph>
      <paragraph id="par_id399182" role="paragraph">You can now for example insert a footer for the "Default Page Style" only, or insert footers in both page styles, but with differently formatted page number fields.</paragraph>
      <h3 id="hd_id5298318">To Apply a Manually Inserted Page Style Change</h3>
      <list type="ordered">
         <listitem>
            <paragraph id="par_id7588732" role="listitem">Click at the start of the first paragraph on the page where a different page style will be applied.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id95828" role="listitem">Choose <emph>Insert - More Breaks - Manual Break</emph>. You see the <emph>Insert Break</emph> dialog.</paragraph>
         </listitem>
         <listitem>
            <paragraph id="par_id3496200" role="listitem">In the <item type="menuitem">Style</item> list box, select a page style. You may set a new page number, too. Click <item type="menuitem">OK</item>.</paragraph>
         </listitem>
      </list>
      <paragraph id="par_id7599108" role="paragraph">The selected page style will be used from the current paragraph to the next page break with style. You may need to create the new page style first.</paragraph>
      <section id="relatedtopics">
      <embed href="text/swriter/01/pagenumbering.xhp#h1"/>
      <embed href="text/swriter/guide/footer_pagenumber.xhp#footer_pagenumber"/>
      <embed href="text/swriter/guide/header_footer.xhp#header_footer"/>
      <embed href="text/swriter/guide/even_odd_sdw.xhp#even_odd_sdw"/>
      <embed href="text/swriter/guide/change_header.xhp#change_header"/>
      <embed href="text/swriter/guide/header_with_chapter.xhp#header_with_chapter"/>
      <embed href="text/swriter/guide/header_with_line.xhp#header_with_line"/>
      </section>
   </body>
</helpdocument>
