Comprehensive TeX Archive Network

Direc­tory tex-archive/macros/latex/contrib/etoc

Source:  etoc.dtx (v1.08b 2015/03/18)
Author:  Jean-Francois Burnol
Author for German tranlation: Christine Roemer
Info:    Completely customisable TOCs
License: LPPL 1.3c or later

Copy­right (C) 2012-2015 Jean-Fran­cois Burnol <jfbu at free dot fr>

Copy­right (C) 2014-2015 Chris­tine Roe­mer <Christine_Roemer at t-online dot de> and col­lab­o­ra­tors for the trans­la­tion into Ger­man of the doc­u­men­ta­tion.


The etoc pack­age gives to the user com­plete con­trol on how the en­tries of the ta­ble of con­tents should be con­sti­tuted from the name, num­ber, and page num­ber of each sec­tion­ing unit. This goes via the def­i­ni­tion of line styles for each sec­tion­ing level used in the doc­u­ment. The pack­age pro­vides its own cus­tom line styles. Sim­pler ones are given as ex­am­ples in the doc­u­men­ta­tion. The sim­plest us­age will be to take ad­van­tage of the lay­out fa­cil­i­ties of pack­ages deal­ing with list en­vi­ron­ments.

Re­gard­ing the global toc dis­play, etoc pro­vides pre-de­fined styles based on a multi-col­umn for­mat, with, op­tion­ally, a ruled ti­tle or framed con­tents.

The \tableofcontents com­mand may be used ar­bi­trar­ily many times and it has a vari­ant \localtableofcontents which prints ta­bles of con­tents 'lo­cal' to the cur­rent sur­round­ing doc­u­ment unit. An ex­ten­sion of the \label/\ref syn­tax al­lows to re­pro­duce (with an­other lay­out) a lo­cal ta­ble of con­tents de­fined some­where else in the doc­u­ment.

Via depth tags, one gets an even finer con­trol for each ta­ble of con­tents of which sec­tion­ing units it should, or not, dis­play.

The for­mat­ting in­her­ited (and pos­si­bly cus­tomized by other pack­ages) from the doc­u­ment class will be used when in com­pat­i­bil­ity mode.

The as­sign­ment of lev­els to the sec­tion­ing units can be changed at any time, and etoc can thus be used in a quite gen­eral man­ner to cre­ate cus­tom ''lists of'', ad­di­tion­ally to the ta­bles of con­tents re­lated to the doc­u­ment sec­tion­ing units. No aux­il­iary file is used ad­di­tion­ally to the stan­dard .toc file.


The sim­plest is to down­load


and then run unzip etoc.tds.zip -d <DEST> where <DEST> is a TDS-com­pli­ant reper­tory.

Else, to ex­tract the pack­age (.sty) and driver (.tex) files from etoc.dtx:

  • if etoc.ins is present: etex etoc.ins
  • with­out etoc.ins: etex etoc.dtx

It is also pos­si­ble to run la­tex or pdfla­tex di­rectly on etoc.dtx.

At least three ways to pro­duce etoc.pdf (method (3) is pre­ferred):

  1. la­tex etoc.dtx (four times), then dvips, then ps2pdf
  2. pdfla­tex etoc.dtx (four times)
  3. la­tex etoc.tex (four times), then dvipdfmx

Method (3) pro­duces the small­est pdf files. Op­tions can be set in etoc.tex:

  • scr­doc class op­tions (pa­per size, font size, ...)
  • with or with­out source code,
  • with dvipdfmx or with la­tex+dvips or pdfla­tex.

To pro­duce etoc-DE.pdf (Ger­man doc­u­men­ta­tion) run etex on etoc.ins or etoc.dtx to pro­duce etoc-DE.tex, then com­pile etoc-DE.tex with la­tex (thrice) then dvipdmx, or set first to 0 \Withdvipdfmx in etoc-DE.tex to al­low com­pi­la­tion with pdfla­tex.

Um etoc-DE.pdf zu erzeu­gen ist la­tex dreimal mit etoc-DE.tex laufen zu lassen, dann dvipdfmx mit etoc-DE.dvi. Im Falle von Prob­le­men mit dvipdfmx ist \Withdvidpdfmx auf 0 in etoc-DE.tex zu set­zen, dann ist pdfla­tex dreimal mit etoc-DE.tex laufen zu lassen.


etoc.sty    -> TDS:tex/latex/etoc/etoc.sty
etoc.dtx    -> TDS:source/latex/etoc/etoc.dtx
etoc.pdf    -> TDS:doc/latex/etoc/etoc.pdf
etoc-DE.pdf -> TDS:doc/latex/etoc/etoc-DE.pdf
README.md   -> TDS:doc/latex/etoc/README.md

The other files may be dis­carded.


This Work may be dis­tributed and/or mod­i­fied un­der the con­di­tions of the LaTeX Project Public Li­cense, ei­ther ver­sion 1.3c of this li­cense or (at your op­tion) any later ver­sion. This ver­sion of this li­cense is in


and the lat­est ver­sion of this li­cense is in


and ver­sion 1.3 or later is part of all dis­tri­bu­tions of LaTeX ver­sion 2005/12/01 or later.

The Authors of this Work are:

  • Jean-Fran­cois Burnol <jfbu at free dot fr> for the source code and English doc­u­men­ta­tion, and
  • Chris­tine Roe­mer <Christine_Roemer at t-online dot de> and col­lab­o­ra­tors for the trans­la­tion into Ger­man of the doc­u­men­ta­tion.

This Work con­sists of the main source file etoc.dtx and the de­rived files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.


v1.08b 2015/03/18

Bug fixes:

  • ex­tra space to­ken re­moved from \localtableofcontents (showed only for in­line TOCs.)
  • \etocpartname (a macro used by the pack­age own de­fault line styles) was de­fined to be \partname, but this is not com­pat­i­ble at least with babel+french con­text. Now sim­ply ex­pands to Part.
  • some prob­lems fixed in the Ger­man doc­u­men­ta­tion.

v1.08a 2015/03/13

\etocname, \etocnumber and \etocpage are now the ro­bust vari­ants of \etocthelinkedname, \etocthelinkednumber and \etocthelinkedpage. This should ar­guably have been done since the ad­di­tion of the lat­ter to etoc with v1.07f 2013/03/07. The ear­lier \etocname etc... con­tained the hy­per­link des­ti­na­tion only in an un­ex­panded form.

The doc­u­men­ta­tion has a brand new ti­tle page and a new sec­tion The TOC as a TikZ mind map both il­lus­trat­ing fur­ther uses of etoc to dis­play ta­bles of con­tents as trees in an au­to­matic man­ner.

v1.08 2015/03/10

\etocskipfirstprefix may now ap­pear any­where in the <start> part of a level style.

New com­mands \etociffirst, \etocxiffirst, \etocxifnumbered.

It is now pos­si­ble to is­sue line style spec­i­fi­ca­tions di­rectly with & and \\ to­kens, in or­der to type­set a TOC as a tab­u­lar or longtable with the open­ing for ex­am­ple in the first ar­gu­ment of \etocsettocstyle and the clos­ing in its sec­ond ar­gu­ment.

It is manda­tory for such uses to is­sue \etocglobaldefs which tells etoc to pro­ceed glob­ally for cer­tain def­i­ni­tions. This is also use­ful in the con­text of the in­line en­vi­ron­ments of pack­age en­u­mitem.

On this oc­ca­sion, var­i­ous old parts of the code have been im­proved.

v1.07n 2015/03/05

No more use of \toks@ when etoc con­structs \etocthelinkedname etc... Thus \toks@ can be put in the line styles in or­der to ac­cu­mu­late in­for­ma­tion. Only use­ful if it is cer­tain noth­ing else will change \toks@ ei­ther.

In the doc­u­men­ta­tion: list of main com­mands now in al­pha­betic or­der.

v1.07m 2015/01/23

Read­ing of .toc file is de­layed to \begin{document} to ac­count for pos­si­ble Ba­bel ac­tive char­ac­ters used therein. Thanks to De­nis Bi­touzé who re­ported a Ba­bel re­lated prob­lem.

Im­proved global toc dis­play em­u­la­tion un­der KOMA-script classes.

New com­mand \etocbeforetitlehook. New com­mand \etocdisplay.

v1.07l doc of 2014/04/29

Added to the doc­u­men­ta­tion an ex­am­ple of use of \etocthelinkedname to­gether with an en­u­mitem in­line item­ize* en­vi­ron­ment; moved main TOC to im­me­di­ately af­ter the ti­tle, and li­cense to the first pages.

In­cor­po­ra­tion of the trans­la­tion into Ger­man done on the ini­tia­tive of Chris­tine Römer by Felix Baral-We­ber, Jenny Rothkrämer-Vogt, Daniel Büt­tner, Clau­dia Dahl, Chris­tian Otto and Chris­tine Römer (FSU Jena). My grate­ful thanks to all!


Name Size Date Notes
README 7276 2015-03-18 22:42
README.md 7504 2015-03-18 22:42
etoc-DE.pdf 406076 2015-03-18 22:42
etoc.dtx 499861 2015-03-18 22:41
etoc.ins 3271 2015-03-18 22:42
etoc.pdf 433010 2015-03-18 22:42

Down­load the con­tents of this pack­age in one zip archive (939.6k).

etoc – Com­pletely cus­tomis­able TOCs

The pack­age gives the user com­plete con­trol of how the en­tries of the ta­ble of con­tents should be con­sti­tuted from the name, num­ber, and page num­ber of each sec­tion­ing unit. The lay­out is con­trolled by the def­i­ni­tion of ‘line styles’ for each sec­tion­ing level used in the doc­u­ment.

The pack­age pro­vides its own cus­tom line styles (which may be used as ex­am­ples), and con­tin­ues to sup­port the stan­dard for­mat­ting in­her­ited from the LaTeX doc­u­ment classes, but the pack­age can also al­low the user to del­e­gate the de­tails to pack­ages deal­ing with list mak­ing en­vi­ron­ments (such as en­u­mitem). The pack­age’s de­fault global style type­sets ta­bles of con­tents in a multi-col­umn for­mat, with ei­ther a stan­dard head­ing, or a ruled ti­tle (op­tion­ally with a frame around the ta­ble).

The \table­of­con­tents com­mand may be used ar­bi­trar­ily many times in the same doc­u­ment, while \lo­caltable­of­con­tents pro­vides a ‘lo­cal’ ta­ble of con­tents.

Pack­age De­tailsetoc
Ver­sion1.08b 2015-03-18
Li­censeThe LaTeX Project Public Li­cense 1.3
Main­tainerJean-François Burnol
TDS archiveetoc.tds.zip
Con­tained inTeX Live as etoc
MiKTeX as etoc
Topics deal with Tables of Con­tents, and of other such things
See also tocbasic
Guest Book Sitemap Contact Contact Author