* Re: Chapter numbers in the right margin
2005-03-22 15:50 ` Randall Skelton
@ 2005-03-22 16:25 ` Vit Zyka
2005-03-22 16:58 ` luigi.scarso
2005-03-23 18:56 ` Hans Hagen
2 siblings, 0 replies; 8+ messages in thread
From: Vit Zyka @ 2005-03-22 16:25 UTC (permalink / raw)
Randall Skelton wrote:
>>Use textcommand only for text, numbercommand only for number,
>>command for both;
>>you can see some examples in section Variations in titles .
>
>
> Thanks for the reply.
>
> The problem with separating the text and number is that the space
> separating the text and number still appears in the chapter text. On
> a similar note, why doesn't 'show makeup' display the right margin
> number?
May be I do not understand you but you introduce spaces yourself in your
\My... Write % at the end of lines as shown:
> \def\MyChapterNumberText#1{
\def\MyChapterNumberText#1{%
> \inright{\begingroup
> \midaligned{#1}
\midaligned{#1}%
> \endgroup}
\endgroup}%
> }
>
> \def\MyChapterText#1{
\def\MyChapterText#1{%
> \begingroup
> \leftaligned{#1}
\leftaligned{#1}%
> \endgroup
> }
Depends in which mode (horizontal, vertical) your code occures. (If
\midaligned expands to \ignorespaces at the end then % is not needed there.)
vit
>
> \setuphead
> [Topic, chapter]
> [numbercommand=\MyChapterNumberText,
> textcommand=\MyChapterText,
> numberstyle={\switchtobodyfont[48pt]},
> textstyle={\switchtobodyfont[12pt]},
> color=black,
> number=yes,
> page=right,
> continue=no,
> header=empty,
> before=\vbox to 3cm\bgroup,
> after=\vss\egroup]
>
> \starttext
>
> %\showmakeup
>
> \chapter{This is a Chapter Title}
> \input tufte
>
> \section{This is a section title}
> \input tufte \par \input knuth \par
>
> \subsection{This is a sub-section title}
> \input tufte \par \input knuth \par
>
> \stoptext
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
--
Vít Zýka --- http://typokvitek.com
Automatic document typesetting
Automaticka sazba dokumentu --
--
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Chapter numbers in the right margin
2005-03-22 15:50 ` Randall Skelton
2005-03-22 16:25 ` Vit Zyka
@ 2005-03-22 16:58 ` luigi.scarso
2005-03-23 18:56 ` Hans Hagen
2 siblings, 0 replies; 8+ messages in thread
From: luigi.scarso @ 2005-03-22 16:58 UTC (permalink / raw)
Randall Skelton wrote:
>>Use textcommand only for text, numbercommand only for number,
>>command for both;
>>you can see some examples in section Variations in titles .
>>
>>
>
>Thanks for the reply.
>
>The problem with separating the text and number is that the space
>separating the text and number still appears in the chapter text. On
>a similar note, why doesn't 'show makeup' display the right margin
>number?
>
>\def\MyChapterNumberText#1{
> \inright{\begingroup
> \midaligned{#1}
> \endgroup}
>}
>
>\def\MyChapterText#1{
> \begingroup
> \leftaligned{#1}
> \endgroup
>}
>
>\setuphead
> [Topic, chapter]
> [numbercommand=\MyChapterNumberText,
> textcommand=\MyChapterText,
> numberstyle={\switchtobodyfont[48pt]},
> textstyle={\switchtobodyfont[12pt]},
> color=black,
> number=yes,
> page=right,
> continue=no,
> header=empty,
> before=\vbox to 3cm\bgroup,
> after=\vss\egroup]
>
>\starttext
>
>%\showmakeup
>
>\chapter{This is a Chapter Title}
>\input tufte
>
>\section{This is a section title}
>\input tufte \par \input knuth \par
>
>\subsection{This is a sub-section title}
>\input tufte \par \input knuth \par
>
>\stoptext
>_______________________________________________
>ntg-context mailing list
>ntg-context@ntg.nl
>http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
>
Sorry Randall; i'm sure that i don't understand what you want.
Maybe next code can help you...
\def\MyChapterCommand#1#2{%
\hbox to \textwidth{#1\hss #2}%
}
% or perhaps
%
%\def\MyChapterCommand#1#2{%
%\hbox to \textwidth{\llap{#1}\hss #2}%
%}
\setuphead
[Topic, chapter]
[%numbercommand=\MyChapterNumberText,
%textcommand=\MyChapterText,
command={\MyChapterCommand},
numberstyle={\switchtobodyfont[48pt]},
textstyle={\switchtobodyfont[12pt]},
color=black,
number=yes,
page=right,
continue=no,
header=empty,
before=\vbox to 3cm\bgroup,
after=\vss\egroup]
luigi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Chapter numbers in the right margin
2005-03-22 15:50 ` Randall Skelton
2005-03-22 16:25 ` Vit Zyka
2005-03-22 16:58 ` luigi.scarso
@ 2005-03-23 18:56 ` Hans Hagen
2005-03-23 19:15 ` luigi.scarso
2 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2005-03-23 18:56 UTC (permalink / raw)
Randall Skelton wrote:
>>Use textcommand only for text, numbercommand only for number,
>>command for both;
>>you can see some examples in section Variations in titles .
>
>
> Thanks for the reply.
>
> The problem with separating the text and number is that the space
> separating the text and number still appears in the chapter text. On
> a similar note, why doesn't 'show makeup' display the right margin
> number?
>
> \def\MyChapterNumberText#1{
> \inright{\begingroup
> \midaligned{#1}
> \endgroup}
> }
>
> \def\MyChapterText#1{
> \begingroup
> \leftaligned{#1}
> \endgroup
> }
>
> \setuphead
> [Topic, chapter]
> [numbercommand=\MyChapterNumberText,
> textcommand=\MyChapterText,
> numberstyle={\switchtobodyfont[48pt]},
> textstyle={\switchtobodyfont[12pt]},
> color=black,
> number=yes,
> page=right,
> continue=no,
> header=empty,
> before=\vbox to 3cm\bgroup,
> after=\vss\egroup]
>
> \starttext
>
> %\showmakeup
>
> \chapter{This is a Chapter Title}
> \input tufte
>
> \section{This is a section title}
> \input tufte \par \input knuth \par
>
> \subsection{This is a sub-section title}
> \input tufte \par \input knuth \par
>
> \stoptext
in addition to other answers (please submit to wiki)
%%%% no need for dunny \begingroups and spaces
\def\MyChapterNumberText#1%
{\inright{\midaligned{#1}}}
\def\MyChapterText#1%
{\leftaligned{#1}}
%%%% set distance to 0pt (distance between number and text)
\setuphead
[Topic,chapter]
[numbercommand=\MyChapterNumberText,
textcommand=\MyChapterText,
numberstyle={\switchtobodyfont[48pt]},
textstyle={\switchtobodyfont[12pt]},
color=black,
number=yes,
page=right,
continue=no,
header=empty,
distance=0pt, % no number before it
before=\vbox to 3cm\bgroup,
after=\vss\egroup]
%%%% an alternativ eis to set alternative=command and alike, but more fun is to
hook in your own handler
%%%% undocumented -)
\definemarginline[MyOuter] [location=outer,width=\outermarginwidth]
\def\MyPlaceHead#1#2{\vbox{\MyOuter{\midaligned{#1}}#2}}
\defineheadplacement[MyHead][vertical]#1#2{\MyPlaceHead{#1}{#2}}
\setuphead[chapter][alternative=MyHead]
%%%% you rexample
\starttext
\showframe
\chapter{This is a Chapter Title}
\input tufte
\section{This is a section title}
\input tufte \par \input knuth \par
\subsection{This is a sub-section title}
\input tufte \par \input knuth \par
\stoptext
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread