* KOMA-srcartcl Type Area: How to count header and footer to text area?
@ 2011-12-13 11:33 Paul Menzel
2011-12-13 13:24 ` Aditya Mahajan
0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2011-12-13 11:33 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1.1.1: Type: text/plain, Size: 2823 bytes --]
Dear ConTeXt folks,
having heard nice things about the KOMA script type area I wanted to use
it too and tried out the example in the Wiki [1].
% Set binding correction value (mode=BCOR turns it on).
\doifmodeelse{BCOR}{\def\bindingcorr{3mm}}{\def\bindingcorr{0pt}}
% Set visible page width.
\newdimen\PageWidth
\PageWidth=\dimexpr(\paperwidth-\bindingcorr)
% Determine the paper aspect ratio.
\edef\Ratio{\withoutpt{\the\dimexpr(2\paperheight/(\PageWidth/32768))}}
% Set the textarea width to 2.6 alphabets.
\setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}
\newdimen\Width \Width=\dimexpr(2.6\wd\scratchbox)
% Set the textarea height proportional to the width.
\newdimen\Height \Height=\dimexpr(\Ratio\Width)
% Set the margin/gutter widths to be equal on a full spread.
\newdimen\Back
\doifmodeelse{oneside}
{\Back=\dimexpr(((\PageWidth - \Width) / 2) + \bindingcorr)}
{\Back=\dimexpr(((\PageWidth - \Width) / 3) + \bindingcorr)}
% Set the top and bottom margins in a 1:2 ratio, ignoring headers.
\edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - 3\lineheight)}
% Redefine \Height to include header and footer space.
\Height=\dimexpr(\Height + 8\lineheight)
% Set up the page layout using the calculated parameters.
\setuplayout[
backspace=\the\Back,
height=\the\Height,
width=\the\Width,
header=2\lineheight,
headerdistance=\lineheight,
footer=2\lineheight,
footerdistance=3\lineheight,
topspace=\Top]
\starttext
\framed[width=\textwidth,height=\textheight]{}
\stoptext
I only want to add a page number to the footer [3] and I do not want to
use any header [2, and ConTeXt manual]. Therefore I set
\setupheader[][state=none]
\setuppagenumbering[alternative=doublesided, location={footer}]
\enablemode[BCOR]
According to the KOMA-Script manual [4] having just a page number in the
footer it should be counted as belonging to the margin. The only way I
found out to achieve that was setting `\footdistance=0`.
Is that the “correct” way to comply with the KOMA-Script type area
recommendation?
Please find the adapted example attached.
Thanks,
Paul
[1] http://wiki.contextgarden.net/KOMA-scrartcl_Type_Area
[2] http://wiki.contextgarden.net/Layout
[3] http://wiki.contextgarden.net/Reference/en/setuppagenumbering
[4] ftp://ftp.dante.de/pub/tex/macros/latex/.../koma-script/scrguide.pdf
[-- Attachment #1.1.2: koma.pdf --]
[-- Type: application/pdf, Size: 9318 bytes --]
[-- Attachment #1.1.3: koma.tex --]
[-- Type: text/x-tex, Size: 1586 bytes --]
% Set binding correction value (mode=BCOR turns it on).
\doifmodeelse{BCOR}{\def\bindingcorr{5mm}}{\def\bindingcorr{0pt}}
% Set visible page width.
\newdimen\PageWidth
\PageWidth=\dimexpr(\paperwidth-\bindingcorr)
% Determine the paper aspect ratio.
\edef\Ratio{\withoutpt{\the\dimexpr(2\paperheight/(\PageWidth/32768))}}
% Set the textarea width to 2.6 alphabets.
\setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}
\newdimen\Width \Width=\dimexpr(2.6\wd\scratchbox)
% Set the textarea height proportional to the width.
\newdimen\Height \Height=\dimexpr(\Ratio\Width)
% Set the margin/gutter widths to be equal on a full spread.
\newdimen\Back
\doifmodeelse{oneside}
{\Back=\dimexpr(((\PageWidth - \Width) / 2) + \bindingcorr)}
{\Back=\dimexpr(((\PageWidth - \Width) / 3) + \bindingcorr)}
% Set the top and bottom margins in a 1:2 ratio, ignoring headers.
\edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - 3\lineheight)}
% Redefine \Height to include header and footer space.
\Height=\dimexpr(\Height + 8\lineheight)
% Set up the page layout using the calculated parameters.
\setuplayout[
backspace=\the\Back,
height=\the\Height,
width=\the\Width,
header=2\lineheight,
headerdistance=\lineheight,
footer=2\lineheight,
footerdistance=0\lineheight,
topspace=\Top,
]
\setupheader[][state=none]
\setuppagenumbering[alternative=doublesided, location={footer}]
\enablemode[BCOR]
\starttext
\framed[width=\textwidth,height=\textheight]{}
\input tufte
\stoptext
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: KOMA-srcartcl Type Area: How to count header and footer to text area?
2011-12-13 11:33 KOMA-srcartcl Type Area: How to count header and footer to text area? Paul Menzel
@ 2011-12-13 13:24 ` Aditya Mahajan
2011-12-13 14:01 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2011-12-13 13:24 UTC (permalink / raw)
To: mailing list for ConTeXt users
Have you seen http://modules.contextgarden.net/typearea
Aditya
On Dec 13, 2011, at 6:33 AM, Paul Menzel <paulepanter@users.sourceforge.net> wrote:
> Dear ConTeXt folks,
>
>
> having heard nice things about the KOMA script type area I wanted to use
> it too and tried out the example in the Wiki [1].
>
> % Set binding correction value (mode=BCOR turns it on).
> \doifmodeelse{BCOR}{\def\bindingcorr{3mm}}{\def\bindingcorr{0pt}}
>
> % Set visible page width.
> \newdimen\PageWidth
> \PageWidth=\dimexpr(\paperwidth-\bindingcorr)
>
> % Determine the paper aspect ratio.
> \edef\Ratio{\withoutpt{\the\dimexpr(2\paperheight/(\PageWidth/32768))}}
>
> % Set the textarea width to 2.6 alphabets.
> \setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}
> \newdimen\Width \Width=\dimexpr(2.6\wd\scratchbox)
>
> % Set the textarea height proportional to the width.
> \newdimen\Height \Height=\dimexpr(\Ratio\Width)
>
> % Set the margin/gutter widths to be equal on a full spread.
> \newdimen\Back
> \doifmodeelse{oneside}
> {\Back=\dimexpr(((\PageWidth - \Width) / 2) + \bindingcorr)}
> {\Back=\dimexpr(((\PageWidth - \Width) / 3) + \bindingcorr)}
>
> % Set the top and bottom margins in a 1:2 ratio, ignoring headers.
> \edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - 3\lineheight)}
>
> % Redefine \Height to include header and footer space.
> \Height=\dimexpr(\Height + 8\lineheight)
>
> % Set up the page layout using the calculated parameters.
> \setuplayout[
> backspace=\the\Back,
> height=\the\Height,
> width=\the\Width,
> header=2\lineheight,
> headerdistance=\lineheight,
> footer=2\lineheight,
> footerdistance=3\lineheight,
> topspace=\Top]
>
> \starttext
> \framed[width=\textwidth,height=\textheight]{}
> \stoptext
>
> I only want to add a page number to the footer [3] and I do not want to
> use any header [2, and ConTeXt manual]. Therefore I set
>
> \setupheader[][state=none]
> \setuppagenumbering[alternative=doublesided, location={footer}]
> \enablemode[BCOR]
>
> According to the KOMA-Script manual [4] having just a page number in the
> footer it should be counted as belonging to the margin. The only way I
> found out to achieve that was setting `\footdistance=0`.
>
> Is that the “correct” way to comply with the KOMA-Script type area
> recommendation?
>
> Please find the adapted example attached.
>
>
> Thanks,
>
> Paul
>
>
> [1] http://wiki.contextgarden.net/KOMA-scrartcl_Type_Area
> [2] http://wiki.contextgarden.net/Layout
> [3] http://wiki.contextgarden.net/Reference/en/setuppagenumbering
> [4] ftp://ftp.dante.de/pub/tex/macros/latex/.../koma-script/scrguide.pdf
> <koma.pdf>
> <koma.tex>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: KOMA-srcartcl Type Area: How to count header and footer to text area?
2011-12-13 13:24 ` Aditya Mahajan
@ 2011-12-13 14:01 ` Paul Menzel
0 siblings, 0 replies; 3+ messages in thread
From: Paul Menzel @ 2011-12-13 14:01 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1.1: Type: text/plain, Size: 3411 bytes --]
Am Dienstag, den 13.12.2011, 08:24 -0500 schrieb Aditya Mahajan:
> On Dec 13, 2011, at 6:33 AM, Paul Menzel <paulepanter@users.sourceforge.net> wrote:
> > having heard nice things about the KOMA script type area I wanted to use
> > it too and tried out the example in the Wiki [1].
> >
> > % Set binding correction value (mode=BCOR turns it on).
> > \doifmodeelse{BCOR}{\def\bindingcorr{3mm}}{\def\bindingcorr{0pt}}
> >
> > % Set visible page width.
> > \newdimen\PageWidth
> > \PageWidth=\dimexpr(\paperwidth-\bindingcorr)
> >
> > % Determine the paper aspect ratio.
> > \edef\Ratio{\withoutpt{\the\dimexpr(2\paperheight/(\PageWidth/32768))}}
> >
> > % Set the textarea width to 2.6 alphabets.
> > \setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}}
> > \newdimen\Width \Width=\dimexpr(2.6\wd\scratchbox)
> >
> > % Set the textarea height proportional to the width.
> > \newdimen\Height \Height=\dimexpr(\Ratio\Width)
> >
> > % Set the margin/gutter widths to be equal on a full spread.
> > \newdimen\Back
> > \doifmodeelse{oneside}
> > {\Back=\dimexpr(((\PageWidth - \Width) / 2) + \bindingcorr)}
> > {\Back=\dimexpr(((\PageWidth - \Width) / 3) + \bindingcorr)}
> >
> > % Set the top and bottom margins in a 1:2 ratio, ignoring headers.
> > \edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - 3\lineheight)}
> >
> > % Redefine \Height to include header and footer space.
> > \Height=\dimexpr(\Height + 8\lineheight)
> >
> > % Set up the page layout using the calculated parameters.
> > \setuplayout[
> > backspace=\the\Back,
> > height=\the\Height,
> > width=\the\Width,
> > header=2\lineheight,
> > headerdistance=\lineheight,
> > footer=2\lineheight,
> > footerdistance=3\lineheight,
> > topspace=\Top]
> >
> > \starttext
> > \framed[width=\textwidth,height=\textheight]{}
> > \stoptext
> >
> > I only want to add a page number to the footer [3] and I do not want to
> > use any header [2, and ConTeXt manual]. Therefore I set
> >
> > \setupheader[][state=none]
> > \setuppagenumbering[alternative=doublesided, location={footer}]
> > \enablemode[BCOR]
> >
> > According to the KOMA-Script manual [4] having just a page number in the
> > footer it should be counted as belonging to the margin. The only way I
> > found out to achieve that was setting `\footdistance=0`.
> >
> > Is that the “correct” way to comply with the KOMA-Script type area
> > recommendation?
> >
> > Please find the adapted example attached.
> Have you seen http://modules.contextgarden.net/typearea
Yes I did. But it does not seem to provide all options like
`headinclude` or `footinclude`.
At least
\usemodule[typearea]
\setupTypeArea[bcor=0mm, headinclude=false, footinclude=false]
did not change anything.
Thanks,
Paul
> > [1] http://wiki.contextgarden.net/KOMA-scrartcl_Type_Area
> > [2] http://wiki.contextgarden.net/Layout
> > [3] http://wiki.contextgarden.net/Reference/en/setuppagenumbering
> > [4] ftp://ftp.dante.de/pub/tex/macros/latex/.../koma-script/scrguide.pdf
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-13 14:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 11:33 KOMA-srcartcl Type Area: How to count header and footer to text area? Paul Menzel
2011-12-13 13:24 ` Aditya Mahajan
2011-12-13 14:01 ` Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).