Changes

Jump to navigation Jump to search
2,102 bytes added ,  21:40, 20 November 2013
m
no edit summary
<pre>
 
<fo:simple-page-master
master-name="first"
</fo:simple-page-master>
 
</pre>
Note how both page dimensions (the physical hieght height of a page) and
the layout (the margins) are contained in the simple-page-master
element. In ConTeXt, these two qualities are separate.
=Pysical Physical Page Dimensions=
Let's build different layouts in a ConTeXt document, starting
<texcode>
 
\enableregime[utf]
\setuppagenumbering[state=stop, way=bytext]
\starttext
 
</texcode>
<texcode>
 
\part{}
 
</texcode>
<texcode>
 
\definepapersize[firstPart][width=8.5in, height=11in]
\setuppapersize[firstPart]  
</texcode>
<texcode>
 
 
Some text for our first part.
 
</texcode>
<texcode>
 
 
\part{}
\definepapersize[secondPart][width=8.5in, height=11in]
\setuppapersize[secondPart]
Text for second part.
\stoptext
 
</texcode>
<texcode>
 
 
\part{}
\definepapersize[firstdPart][width=8.5in, height=11in]
\setuppapersize[firstPart]
% define layout for first part
\definelayout[
topspace=.5in, bottomspace=.5in, cutspace=1in, backspace=1in, header=2in, footer=2in, rightmargin=1in, leftmargin=1in, width=5in, height=10in, ]
Text for first part.
 
 
</texcode>
regions.
If you pages are not doublesided double sided (not part of a book), the
"backspace" value will determine how much space occurs between
the left edge of the paper and any text. It always touches the
"leftmargin" region. If you have a doublesided double sided layout, the
"backspace" value will flip from right to left side of your
pages, but will always be in the gutter, or the spine of a book
margin-top="2in"/>, <fo:region-body region-after="2in"/>,
<fo:region-body region-start="1in"/>, and <fo:region-body
region-end="1in"/> respectively. Like their FO conterpartscounterparts, the
ConTeXt values set up margins at the top, bottom, left, and right
of the page for marginal notes.
The values "leftmargin" and "rightmargin" have no affect on the
actual width of the body text. You could set "leftmargin" to 5in,
and your body text would not change its width. When you setwidth to 5 inches, the width of your body text will in fact be 5inches. (This contrasts with height, as I explain below.) If you the sum ofyour "backspace", margins, and width exceed the total pagewidth, your layout will not work.  In contrast, the "header" and"footer" do change the overall height of your body text. If youincreased the header by one inch, your body text would be 1 inchsmaller. The height actuallyrefers to the total height of the toppace, header, body text,smallerfooter, and bottomspace. You control If you set the header to 2 inches, andset the width footer to 2 inches, and set the height to 4 inches, thenthe actual body height of would be: 4 - 2 - 2 = 0 (!) You would have no room for your body text byat all. If you meant toset your body height to 4 inches, you would set height to 8inches (2 + 2 + 4 = 8). <table style="border:1px solid #DDDDDD"> <caption> FO ConTeXt conversions for physical page layouts </caption> <tr style="background-color:#DDDDDD"><th>FO </th><th>ConTeXt </th></tr> <tr><td><pre><fo:simple-page-master margin-top="x"></pre> </td><td><texcode>\definelayout topspace=x</texcode> </td></tr> <tr style="background-color:#EEEEEE"><td><pre><fo:simple-page-master margin-bottom="x"></pre> </td><td><texcode>\definelayout bottomspace=x</texcode> </td></tr> <tr><td><pre><simple-page-master margin-left="x"></pre> </td><td><texcode>\definelayout backspace=x</texcode> </td></tr> <tr style="background-color:#EEEEEE"><td><pre><simple-page-master margin-right="x"></pre> </td><td><texcode>\definelayout cutspace=x</texcode> </td></tr> <tr><td><pre><fo:region-body margin-top="x"/></pre> </td><td><texcode>\definelayout headerdistance=x</texcode> </td></tr> <tr style="background-color:#EEEEEE"><td><pre><fo:region-before extent="x"/></pre> </td><td><texcode>\definelayout header=x</texcode> </td></tr> <tr><td><pre><fo:region-after extent="x"/></pre> </td><td><texcode>\definelayout footer=x</texcode> </td></tr> the <tr style="widthbackground-color:#EEEEEE" and ><td><pre><fo:region-start extent="heightx" values./></pre> </td><td><texcode>\definelayout left-margin=x</texcode> </td></tr>
'''I ahve a <tr><td><pre><fo:region-after extent="x"/></pre> </td><td><texcode>\definelayout right-margin=x</texcode> </td></tr> </table to put in here> =Changing Layouts for First, as soon as I figure out how to do so with wiki'''Odd and Even Pages=
FO lets you create different pages sizes and layouts for the
==First Page==
In order to define different pysical dimmensions physical dimensions for your first
page, use "1" as your first option:
<texcode>
 
\definelayout[1][
topspace=.5in, % the space at the very top of the page backspace=2in, % the space in the gutter header=2in, % the space for headers footer=2in, % the space for footers leftmargin=1in, % the space for margin notes rightmargin=1.5in, % the space for right margin notes width=3in, % the width of the body text height=7in % the height of the body text
]
 
 
 
</texcode>
<texcode>
 
 
\setuppagenumbering[alternative=doublesided, state=stop]
 
</texcode>
<texcode>
 
 
\definelayout[odd]
[backspace=1in, cutspace=1.25in, width=middle, height=9in]
\definelayout[even]
[backspace=1in, cutspace=1.25in, width=middle, height=8in]
\setuplayout % needed to add this or the first page wouldn't format
\starttext
\dorecurse{12}{\input dawkins \par}
\stoptext
 
 
 
</texcode>
<pre>
 
 
<fo:static-content
flow-name="even-page">
Title
</fo:static-content>
 
</pre>
text wherever we want them with the commands
<tt>\setupheadertexts</tt> and <tt>\setupfootertexts</tt>. These
commands takes 4 arguments, the first for the left margin on evenodd
pages, the second for the right margin on odd pages, the third
for the right left margin on odd even pages, and the fourth for the leftrightmargin on odd even pages. For simplicity's sake, let's leave the
middle two options empty, so we get headers and footers on the
even and odd pages, naturally alligned with the left margin,
<texcode>
 
\setupheadertexts[left(even) header][] [][right(odd) header]
\setupfootertexts[left(even) footer][] [][right(odd) footer]
 
</texcode>
<texcode>
 
 
\setupheader[state=high]
\setupfooter[state=high]
 
</texcode>
have been stopped; "empty", which preserves the space for the
header or footer but does not show the text; and none, which
completely elminates eliminates both the space and the text for a header or
foooter.
determines the placement of text on the first page of a division
in a document, such as part. We will use this command in
conjuction conjunction with a <tt>\definetext</tt> command in this way:
<texcode>
 
\definetext[partStart1][header][Part Header]
\setuphead[part][header=partStart1]
\part{}
 
</texcode>
<texcode>
 
 
% force the odd header to the right and the even header to the left
% (where it would appear, anyway).
% forces the word to be centered
\setupheadertexts[left \hfill middle \hfill right][] [][right header]
 
</texcode>
[[page setup1]]
 
[[page setup1 texml]]
=Summary=
* The <tt>\setuphead</tt> command allows us to control the headers and foooters for a new run of pages.
* We use the <tt>\vbox</tt> and <tt>\hfill</tt> commands to format text within a header or footer.
 
 
=To Do=
 
* Find out if there is a corresponding value of footerdistnace in FO.
 
[[Category:XML]]
[[Category:Text elements]]
18

edits

Navigation menu