summaryrefslogtreecommitdiffstats
path: root/doc/prelinklisting.sty
blob: f0aff06c2bd7d564f63a78c8bb71deed6b6d65d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\NeedsTeXFormat{LaTeX2e}[2003/12/06]
\ProvidesPackage{prelinklisting}[]
\newcounter{prelinklisting}
\renewcommand\theprelinklisting{\@arabic\c@prelinklisting}
\newcommand\prelinklistingname{Listing}
\newcommand\listprelinklistingname{List of Listings}
\def\fps@prelinklisting{tbp}
\def\ftype@prelinklisting{5}
\def\ext@prelinklisting{lol}
\def\fnum@prelinklisting{\prelinklistingname~\theprelinklisting}
\newcommand\listofprelinklistings{%
\begingroup
\csname lol@parskip\endcsname
\@ifundefined{chapter}{\section}{\chapter}*{\listprelinklistingname
      \@mkboth{\MakeUppercase\listprelinklistingname}%
              {\MakeUppercase\listprelinklistingname}}%
    \@starttoc{\ext@prelinklisting}%
\endgroup
    }
\newcommand*\l@prelinklisting{\@dottedtocline{1}{1.5em}{2.3em}}
\def\JJ@caption{%
    \bgroup
    \@ifnextchar[{\egroup\JJ@c@ption\@firstofone}\JJ@capti@n}
\def\JJ@capti@n{%
  \@ifstar
    {\egroup\JJ@c@ption\@gobble[]}%
    {\egroup\@xdblarg{\JJ@c@ption\@firstofone}}}
\def\JJ@c@ption#1[#2]#3{%
  \JJ@makecaption#1\fnum@prelinklisting{#3}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
     {\let\\\space
      \hyperdef{prelinklisting}{\theprelinklisting}{}
      \let\theHprelinklisting\theprelinklisting
      \hyper@makecurrent{prelinklisting}
      \addcontentsline{lol}{prelinklisting}{\protect\numberline{\theprelinklisting}{#2}}%
      \addtocounter{prelinklisting}{1}}%
  \fi}
\def\JJ@makecaption#1#2#3{{#1{#2: }#3\endgraf\vskip\baselineskip}}
\let\prelinklistingcaption\JJ@caption
\endinput