Changes

Jump to navigation Jump to search
2,781 bytes added ,  12:54, 8 June 2020
m
no edit summary
< [[Structurals]] | [[Visuals]] >
 
==Default==
<texcode>
\at{page}[hasselt-by-night].
</texcode>
(see See {{cmd|at}})</texcode>.
Note that reference labels are limited to ASCII characters in traditional TeX.
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= || ?
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]}
</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]
 
===Editing Bold Math in Section Titles===
 
When a section title is formatted in boldface text, this doesn't automatically typeset embedded math in bold. This is probably a good thing, as many math fonts do not include all characters in boldface, and often authors use boldface to distinguish between different meanings (for instance, scalar and vector variables). However, in some cases, it <i>is</i> desirable to format the math in the section titles in boldface.
 
Here a very simple example:
<texcode>
\definetypeface[boldmath][mm][boldmath][latin-modern][default]
\setuphead[section][style=\boldmath\rm\bfa]
\starttext
\section{Bold $a^2+b^2=c^2$ {\em bla}}
text: not bold $a^2+b^2=c^2$ {\em bla}
\stoptext
</texcode>
 
<context>
\definetypeface[boldmath][mm][boldmath][latin-modern][default]
\setuphead[section][style=\boldmath\rm\bfa]
\starttext
\section{Bold $a^2+b^2=c^2$ {\em bla}}
text: not bold $a^2+b^2=c^2$ {\em bla}
\stoptext
</context>
 
[[Category:Basics]]
[[Category:Fonts]]
[[Category:Graphics]]
[[Category:Text elementsMath]]

Navigation menu