[NTG-context] Completecontent has problems with chapter, in table

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Mon Dec 3 11:58:25 CET 2018


Huseyin Özoguz schrieb am 03.12.18 um 10:13:
>> You should keep a copy of your current installation for your existing 
>> books.
>>
>> When you use the installation from the ConTeXt garden you can have
>> multiple installations without problems.
> 
> Thank you, so thats the way to go for us. (Sorry for my late reply.)
> 
> 
>> Where exactly should the image appear in the output?
> 
> Originally it should on the left from the chapter-title. But meanwhile 
> the design changed and it appears now in the center above the title, so 
> the question dissolved (but still I dont know, how to make it safely).

The best solution is to create your own layout for the chapter etc.
title and pass the name of the graphic with the second argument
of the \startchapter command.

With this method you keep your document clean and all the magic
happens in the style file.

\startsetups [chapter:image]
   \vbox {
 
\doifsomething{\structureuservariable{image}}{\midaligned{\externalfigure[\structureuservariable{image}]}\endgraf}
     \headsetupspacing
     \setbox\scratchbox\hbox{\headnumbercontent}
     \hangindent\dimexpr\wd\scratchbox+\headnumberdistance\relax
     \noindent
     \box\scratchbox\hskip\headnumberdistance
     \headtextcontent
   }
\stopsetups

\defineheadalternative
   [chapterimage]
   [alternative=vertical,
    renderingsetup=chapter:image]

\setuphead
   [chapter]
   [distance=2ex,
    alternative=chapterimage]

\setupexternalfigure [location={local,global,default}]

\starttext

\startchapter [title={Knuth}]
\samplefile{Knuth}
\stopchapter

\startchapter [title={Zapf}] [image=cow]
\samplefile{zapf}
\stopchapter

\stoptext

Wolfgang



More information about the ntg-context mailing list