[texhax] \@startsection and \@starttoc

Matthew Leingang leingang at math.harvard.edu
Tue Feb 6 15:35:28 CET 2007


On 2/6/07 8:53 AM, "HRE" <hre> wrote:

> How can I find the file which contains both \@startsection and \@starttoc?

Dear Hugo,

Short answer: It¹s in latex.ltx.

Long answer When you latex a file, you can see what files are being included
in the standard error output or the log file.  A lot of these will be coming
from a system-level directory.  Look for 'tex/latex/base' in the path.  You
can change into that directory and grep.   On my machine I typed

$grep -Rn '\\def\\@startsection'
/usr/local/teTeX/share/texmf.tetex/tex/latex/base/*

(all one line) Out popped

/usr/local/teTeX/share/texmf.tetex/tex/latex/base/latex.ltx:5610:\def\@start
sect
ion#1#2#3#4#5#6{%

You can also use \show within latex to reveal the definitions of macros:

$ latex
This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
**\makeatletter\show\@startsection
entering extended mode
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german,
ngerman, d
utch, italian, norsk, portuges, spanish, swedish, nohyphenation, loaded.
> \@startsection=macro:
#1#2#3#4#5#6->\if at noskipsec \leavevmode \fi \par \@tempskipa #4\relax
\@afterin
denttrue \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse
\f
i \if at nobreak \everypar {}\else \addpenalty \@secpenalty \addvspace
\@tempskipa
 \fi \@ifstar {\@ssect {#3}{#4}{#5}{#6}}{\@dblarg {\@sect
{#1}{#2}{#3}{#4}{#5}{
#6}}}.
<*> \makeatletter\show\@startsection

Hope this helps!

--Matt

-- 
Matthew Leingang
Preceptor in Mathematics
Harvard University

http://www.math.harvard.edu/~leingang/vCard.vcf




More information about the texhax mailing list