Changes

Jump to navigation Jump to search
752 bytes added ,  08:55, 11 October 2010
m
continuing
\xmlflush{#1}
\stopxmlsetups
</texcode>
 
What happens here? We want a blank line before the title of the book. Then, we take the value of the <tt>n</tt> attribute (that's what the construct <code>\xmlatt{#1}{n}</code> expands to: the value of the attribute <tt>n</tt> of the current tag) and typeset it midaligned. We add another, smaller blank. And don't forget to "flush" the content of the <code><div></code> element!
 
For the next level, the <tt>chapter</tt>, we need again three steps: add it to the setsetup, define a setup command and a ConTeXt macro for it:
 
<texcode>
\startxmlsetups xml:teisetups
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{TEI|text|body}{xml:*}
\xmlsetsetup{#1}{div[@type='chapter']}{xml:div:chapter}
\stopxmlsetups
 
\startxmlsetups xml:div:chapter
\PhilSection{\xmlatt{#1}{n}}
\xmlflush{#1}
\par
\stopxmlsetups
 
\defineinmargin [PhilSection] [outer] [normal] [distance=0.3em,style=\tfa\bf]
</texcode>
 
So: here, the argument of the <tt>n</tt> attribute is passed to a ConTeXt macro <code>\PhilSection</code>. This macro is defined as an <code>\inmargin</code> which will be typeset in the outer margin, in a bigger, bold font.
--[[User:Thomas|Thomas]] 11:37, 10 October 2010 (UTC)
gardener
111

edits

Navigation menu