My current setup is this:

% TOC setup

\setupcombinedlist[content]%
[ list={defaultchapter,defaultsection,defaultsubsection},%
  after={\blank[10pt]},%
  alternative=c,%
  criterium=all,%
]
\definelist[defaultchapter][chapter]%default first layer
\definelist[defaultsection][section]
\setuplist[defaultsection]
[ margin=1em,%
  alternative=c%
]
\definelist[defaultsubsection][subsection]
\setuplist[defaultsubsection]
[ margin=2em,%
  alternative=c%
]
\definelist[defaultsubsubsection][subsection]
\setuplist[defaultsubsubsection]
[ margin=3em,%
  alternative=c%
]

\def\TOC{%
    \blank[-24pt,back]%
    \placecontent
}

\def\TocChapter#1{%
    \writetolist[defaultchapter]{}{#1}%
}
\def\TocSection#1{%
    \writetolist[defaultsection]{}{#1}%
}
\def\TocSubsection#1{%
    \writetolist[defaultsubsection]{}{#1}%
}
\def\TocSubsubsection#1{%
    \writetolist[defaultsubsubsection]{}{#1}%
}
\def\TocSubsubsubsection#1{%
    \writetolist[defaultsection]{}{#1}%
}


And then I use commands like 
\TocChapter{I. Von den katechetischen Grundwahrheiten, oder
von den Gründen der christlichen Religion}
\HeadingSubjectSub{Das erste Hauptstück,
\TocSection{1. Von der natürlichen Erkentnis
Gottes}

To write the TOC entries because in some instances they deviate from the 
chapter headlines.

Thanks for your help!
Johannes
-----Ursprüngliche Nachricht-----
Von: Wolfgang Schuster <wolfgang.schuster.li...@gmail.com> 
Gesendet: Mittwoch, 21. Mai 2025 13:45
An: ntg-context@ntg.nl
Betreff: [NTG-context] Re: Hanging indent in TOC

Am 21.05.2025 um 10:45 schrieb Gottschalt, Johannes:
> Hi everyone,
> 
> I need some help customizing the default TOC so that it has hanging 
> indents. Meaning that, if a heading spans more the one line, all lines 
> after the second one should be indented. For example, if you look at 
> this screen:
> 
> I would want “den” to be indented to the same level of “Von” in the 
> line above. How would I set this up in ConTeXt?

You have to provide a minimal example for your problem because the default 
layout indents the text on all lines.

%%%% begin example
\usemodule[visual]

\starttext

\completecontent[alternative=c]

\chapter{\fakewords{30}{40}}
\section{\fakewords{10}{15}}

\stoptext
%%%% end example

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) 
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to