5

This example was presented in the prior question More section headings?

\setupcolors[state=start]
\usemodule[subsub]
\setuphead[section][color=red,style=\bfc]
\setuphead[subsection][color=blue,style=\bfb]
\setuphead[subsubsection][style=\bfa]
\setuphead[subsubsubsection][style=bold]
\starttext
\section{first section}
\subsection{a}
\subsubsection{b}
\subsubsubsection{c}
\subsubsubsubsection{d}
\subsubsubsubsubsection{e}
\subsubsubsubsubsubsection{f}
\subsubsubsubsubsubsubsection{g}
\subsubsubsubsubsubsubsubsection{h}
\subsubsubsubsubsubsubsubsubsection{i}
\stoptext

I have TeXLive 2016 installed on FreeBSD 10.3

The command context yourfile.tex results in an error, I enter an x to end the process. The log file is below.

If the h and i sections are commented out, there is no error.

Can someone offer an explanation or point me in a direction?

open source     > 1 > 1 > /usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv

ConTeXt  ver: 2016.05.17 19:20 MKIV current  fmt: 2016.10.14  int: english/english

system          > 'cont-new.mkiv' loaded
open source     > 2 > 2 > /usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
close source    > 2 > 2 > /usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
system          > files > jobname 'yourfile', input './yourfile', result 'yourfile'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > 2 > 3 > /common/mnt/local/sync/ark/01/a8/b2/12/MoreSectionHeadings/0/yourfile.tex
colors          > 'rgb' color space is supported
colors          > 'cmyk' color space is supported
resolvers       > modules > 'subsub' is loaded
open source     > 3 > 4 > /usr/local/texlive/2016/texmf-dist/tex/context/modules/mkiv/m-subsub.mkiv
close source    > 3 > 4 > /usr/local/texlive/2016/texmf-dist/tex/context/modules/mkiv/m-subsub.mkiv
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
structure       > sectioning > section @ level 3 : 0.0.1 -> first section
structure       > sectioning > subsection @ level 4 : 0.0.1.1 -> a
structure       > sectioning > subsubsection @ level 5 : 0.0.1.1.1 -> b
structure       > sectioning > subsubsubsection @ level 6 : 0.0.1.1.1.1 -> c
structure       > sectioning > subsubsubsubsection @ level 7 : 0.0.1.1.1.1.1 -> d
structure       > sectioning > subsubsubsubsubsection @ level 8 : 0.0.1.1.1.1.1.1 -> e
structure       > sectioning > subsubsubsubsubsubsection @ level 9 : 0.0.1.1.1.1.1.1.1 -> f
structure       > sectioning > subsubsubsubsubsubsubsection @ level 10 : 0.0.1.1.1.1.1.1.1.1 -> g

tex error       > tex error on line 8 in file /common/mnt/local/sync/ark/01/a8/b2/12/MoreSectionHeadings/0/yourfile.tex: ! Missing number, treated as zero

<to be read again> 
s
<argument> s
 amepage-11
\addaskedblankskip ..._vspacing_temp #1\dimexpr #2
                                                  \relax 
l.8 }

\spac_vspacing_yes_indeed ...ar \clf_vspacing {#1}
                                                  \fi 
\strc_sectioning_handle_page_yes ...entheadlevel ]
                                                  \fi \headparameter \c!befo...
...
l.18 \subsubsubsubsubsubsubsubsection{h}


 1     % https://tex.stackexchange.com/questions/30997/more-section-headings
 2     
 3     \setupcolors[state=start]
 4     \usemodule[subsub]
 5     \setuphead[section][color=red,style=\bfc]
 6     \setuphead[subsection][color=blue,style=\bfb]
 7     \setuphead[subsubsection][style=\bfa]
 8 >>  \setuphead[subsubsubsection][style=bold]
 9     \starttext
10     \section{first section}
11     \subsection{a}
12     \subsubsection{b}
13     \subsubsubsection{c}
14     \subsubsubsubsection{d}
15     \subsubsubsubsubsection{e}
16     \subsubsubsubsubsubsection{f}
17     \subsubsubsubsubsubsubsection{g}
18     \subsubsubsubsubsubsubsubsection{h}


? x

system          > structure > start used structure

used structure  > text: yourfile

system          > structure > stop used structure


system          > files > start used files

used file       >    1: filename=cont-yes.mkiv filetype=tex foundname=/usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv usedmethod=database
used file       >    2: filename=publ-imp-default.lua filetype=scripts foundname=/usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/publ-imp-default.lua usedmethod=database
used file       >    3: filename=cont-new.mkiv filetype=tex foundname=/usr/local/texlive/2016/texmf-dist/tex/context/base/mkiv/cont-new.mkiv usedmethod=database
used file       >    4: filename=lang-us.lua filetype=scripts foundname=/usr/local/texlive/2016/texmf-dist/tex/context/patterns/mkiv/lang-us.lua usedmethod=database
used file       >    5: filename=/common/mnt/local/sync/ark/01/a8/b2/12/MoreSectionHeadings/0/yourfile.tex foundname=/common/mnt/local/sync/ark/01/a8/b2/12/MoreSectionHeadings/0/yourfile.tex usedmethod=direct
used file       >    6: filename=m-subsub.mkiv filetype=tex foundname=/usr/local/texlive/2016/texmf-dist/tex/context/modules/mkiv/m-subsub.mkiv usedmethod=database
used file       >    7: filename=lm.lfg filetype=tex foundname=/usr/local/texlive/2016/texmf-dist/tex/context/fonts/mkiv/lm.lfg usedmethod=database
used file       >    8: filename=lmroman12-regular filetype=otf format=otf foundname=/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=database
used file       >    9: filename=latinmodern-math.otf filetype=opentypefonts foundname=/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=database
used file       >   10: filename=lmroman10-bold filetype=otf format=otf foundname=/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/lm/lmroman10-bold.otf usedmethod=database
used file       >   11: filename=lmroman12-bold filetype=otf format=otf foundname=/usr/local/texlive/2016/texmf-dist/fonts/opentype/public/lm/lmroman12-bold.otf usedmethod=database

system          > files > stop used files


system          > options > start commandline options

used option     > currentrun="1"
used option     > fulljobname="./yourfile.tex"
used option     > input="./yourfile.tex"
used option     > kindofrun="1"
used option     > maxnofruns="9"
used option     > no-parse-first-line="true"

system          > options > stop commandline options

system          > options > start commandline files

used file       >    1: ./yourfile.tex

system          > options > stop commandline files


mkiv lua stats  > used config file: selfautoparent:/texmfcnf.lua;selfautoparent:/texmf-dist/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: readable: '/usr/local/texlive/2016/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9' | readable+writable: '/home/bob/.texlive2016/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9'
mkiv lua stats  > resource resolver: loadtime 0.089 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 11 found files, scanned paths: <none>
mkiv lua stats  > stored bytecode data: 387 modules (0.312 sec), 82 tables (0.008 sec), 469 chunks (0.320 sec)
mkiv lua stats  > traced context: maxstack: 1175, freed: 0, unreachable: 1175
mkiv lua stats  > cleaned up reserved nodes: 44 nodes, 9 lists of 444
mkiv lua stats  > node memory usage: 72 hlist, 8 vlist, 32 boundary, 1 disc, 16 local_par, 1 dir, 109 glue, 64 penalty, 79 glyph, 355 attribute, 39 glue_spec, 89 attribute_list, 2 temp, 7 if_stack, 16 late_lua
mkiv lua stats  > node list callback tasks: 6 unique task lists, 4 instances (re)created, 104 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf output)
mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.001 seconds loading
mkiv lua stats  > callbacks: 253 direct, 334 indirect, 587 total
mkiv lua stats  > randomizer: resumed with value 0.44926483810379
mkiv lua stats  > loaded tex modules: 1 requested, all found (*-subsub)
mkiv lua stats  > loaded patterns: en::2, load time: 0.000
mkiv lua stats  > result saved in file: yourfile.pdf, compresslevel 3, objectcompresslevel 3
mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf, lmroman10-bold.otf, lmroman12-bold.otf, lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.020, afm 1.512, tfm 1.000, 8 instances, 2 shared in backend, 0 common vectors, 2 common hashes, load time 0.182 seconds 
mkiv lua stats  > used platform: freebsd-amd64, type: unix, binary subtree: bin
mkiv lua stats  > luatex banner: this is luatex, version 0.95.0 (tex live 2016)
mkiv lua stats  > control sequences: 44071 of 65536 + 100000
mkiv lua stats  > lua properties: engine: lua, used memory: 76 MB (ctx: 76 MB), hash type: lua, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 4.159 seconds
6

ConTeXt inserts a \blank[samepage-\currentheadlevel] after each \sub...section to prevent page breaks after the section head. By default, \blank[samepage-\num...] is only defined until samepage-10. So, when you use a section head at level 11, you get an error that samepage-11 is not defined.

The simplest solution is to define samepage-11. I simply use a definition similar to that used for samepage-1 to samepage-10 from spac-ver.mkiv:

\dorecurse{10}
  {\normalexpanded{\definevspacing[\v!samepage-\recurselevel][penalty:\the\numexpr\c_spac_vspacing_special_base+\c_spac_vspacing_special_step*\recurselevel\relax]}}

To be safe, let's also define samepage-11 to samepage-20:

\unprotect
\dostepwiserecurse{11}{20}{1}
  {\normalexpanded{\definevspacing[\v!samepage-\recurselevel][penalty:\the\numexpr\c_spac_vspacing_special_base+\c_spac_vspacing_special_step*\recurselevel\relax]}}
\protect

and the example now works. Here is the complete MWE:

\setupcolors[state=start]
\usemodule[subsub]

\unprotect
\dostepwiserecurse{11}{20}{1}
  {\normalexpanded{\definevspacing[\v!samepage-\recurselevel][penalty:\the\numexpr\c_spac_vspacing_special_base+\c_spac_vspacing_special_step*\recurselevel\relax]}}
\protect


\setuphead[section][color=red,style=\bfc]
\setuphead[subsection][color=blue,style=\bfb]
\setuphead[subsubsection][style=\bfa]
\setuphead[subsubsubsection][style=bold]
\starttext
\section{first section}
\subsection{a}
\subsubsection{b}
\subsubsubsection{c}
\subsubsubsubsection{d}
\subsubsubsubsubsection{e}
\subsubsubsubsubsubsection{f}
\subsubsubsubsubsubsubsection{g}
\subsubsubsubsubsubsubsubsection{h}
\subsubsubsubsubsubsubsubsubsection{i}
\stoptext
  • 1
    To get section number for the lower levels you have to extend the prefixset settings: \defineprefixset[all][section-1,section-2,...,section-11,section-12]. – Wolfgang Schuster Oct 24 '16 at 9:51
  • You should send the fixes to Hans because the module should work without additional work for a user. – Wolfgang Schuster Oct 24 '16 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.