Changes

Jump to navigation Jump to search
1,881 bytes added ,  08:47, 16 July 2018
m
Added a backslash to make the exemple compile
<texcode>
\at{page}[hasselt-by-night].
</texcode>
(see See {{cmd|at}})</texcode>.
Note that reference labels are limited to ASCII characters in traditional TeX.
Each of these start-commands has a corresponding stop-command which should be used at the end of the section. For example:
<context mode=mkiv source=yestext=produces>
% mode=mkiv
\setuppapersize[A5]
This is an old-style \ConTeXt\ section.
\startsection [
title={New Section},
reference=sec:new,
]
This is a new-style section.
 
\stopsection
</context>
| bookmark= || The title to show in the PDF bookmarks, if different
|-
| marking= || The title to use in the section marking, if different?
|-
| label= || ?
It is also possible to set per-section variables, and retrieve them with the {{cmd|structureuservariable}} command:
<context mode=mkiv source=yestext=produces>
% mode=mkiv
\setuppapersize[A5]
Using {{cmd|setuppagenumbering|2=[alternative=doublesided]}} makes the chapters start
on the right page. However, the blank page is not truely truly empty, it contains headers andfooters. To get truely truly empty pages, use the following
<texcode>
% Redefine the toc list to include titles
\definecombinedlist[content][title, section]
</texcode>
 
== Complete Section Numbering ==
 
You might have documents in which your sections don’t follow the structure, such as in:
 
<texcode>
\section{A}
%\subsection{B}
\subsubsection{C}
</texcode>
 
In that case, you would get <code>1 A</code> <code>1 C</code>. To enable complete section numbering, you would need in this case (using a beta after 2017.08.07 11:30):
 
<texcode>
\setuphead[subsection][criterium=all]
</texcode>
<context source=yes>
\setuppapersize[A5]
\defdefine[2]\MyChapterCommand#1#2%
{\framed[frame=off,bottomframe=on,topframe=on]
{\vbox{\headtext{chapter} #1\blank#2}}}
\defineoverlay[HeaderDeco][\uniqueMPgraphic{HeaderDeco}]
\defdefine[2]\Myheader#1#2{%
\framedtext
[width= \overlaywidth,
StartPage ;
fill ((topboundary Page --cycle) enlarged(0,5mm)) shifted (0,-20mm)
withcolor \MPcolor{color:title:\namedstructureuservariable{chapter}{mycolor}} ;
StopPage ;
MyTitlePageDone.\namedstructureuservariable{chapter}{mycolor} := 1 ;
[alternative=text,distance=0pt,command=\MyHead,style=\sc]
\defdefine[2]\MyHead#1#2{\inmargin{#1 #2}}
\starttext
[command=]
\defdefine[2]\MySectionCommand#1#2%
{\externalfigure[section-\currentheadnumber]}
\stoptext
</texcode>
 
===Section head without chapter number ===
 
If you only want the section number (in mark IV) in the section title you add
 
 
 
<texcode>
\setuphead[section][sectionsegments=section]
\starttext
\chapter{Eric}
\section{Foo 1}
\subsection{Bar one}
\section{Foo 2}
\stoptext
</texcode>
 
But as once you changed one you have to change the lower ones.
So you have to add the definition of sectionsegments in subsection, subsubsection, ...
 
<texcode>
\setuphead[section][sectionsegments=section]
\setuphead[subsection][sectionsegments=section:subsection]
\setuphead[subsubsection][sectionsegments=section:subsubsection]
 
\starttext
\chapter{Eric}
\section{Foo 1}
\subsection{Bar one}
\subsubsection{Barbar one }
\subsubsection{Barbar two}
\subsection{Bar two}
\subsubsection{Barbar one}
\subsubsection{Barbar two}
\section{Foo 2}
\subsection{Bar one}
\subsubsection{Barbar one}
\subsubsection{Barbar two}
\stoptext
</texcode>
 
It's not written here but you can also change the conversion of the numbering with
 
<texcode>
\definestructureconversionset[mySet][A,R,n,n,a,r][n]
\setuphead[chapter,section,subsection,subsubsection,subsubsubsection][sectionconversionset=mySet]
</texcode>
 
The parameters in definestructureconversionset are
 
the set name
 
the codes for conversion (one for each level)
 
the default conversion for the missing level
 
You can find the conversions codes at [http://wiki.contextgarden.net/Conversions]
[[Category:Fonts]]
[[Category:Graphics]]
[[Category:Text elements]]
19

edits

Navigation menu