diff --git a/src/formatitko/formatitko.tex b/src/formatitko/tex/formatitko.tex similarity index 87% rename from src/formatitko/formatitko.tex rename to src/formatitko/tex/formatitko.tex index 1c60d80..ad0cade 100644 --- a/src/formatitko/formatitko.tex +++ b/src/formatitko/tex/formatitko.tex @@ -76,9 +76,18 @@ \fncount=1 \def\fnmark{\superscript{\the\fncount}} \def\fn#1{\footnote\fnmark{#1}\advance\fncount by 1} -\def\section#1#2{\vfil\eject{\parskip1em\settextsize{20}\bf #1\kern 1em #2}} -\def\subsection#1#2{{\parskip1em\settextsize{18}\bf #1\kern 1em #2}} -\def\subsubsection#1#2{{\parskip1em\settextsize{16}\bf #1\kern 1em #2}} +\def\section#1#2{ + \vfil\eject{\parskip1em\settextsize{20}\bf #1\kern 1em #2} + \addtoc\tocsection{#1}{}{#2} +} +\def\subsection#1#2{ + {\parskip1em\settextsize{18}\bf #1\kern 1em #2} + \addtoc\tocsubsection{#1}{}{#2} +} +\def\subsubsection#1#2{ + {\parskip1em\settextsize{16}\bf #1\kern 1em #2} + \addtoc\tocsubsubsection{#1}{}{#2} +} \def\subsubsubsection#1#2{{\parskip1em\settextsize{14}\bf #1\kern 1em #2}} \def\subsubsubsubsection#1#2{{\parskip1em\settextsize{12}\bf #1\kern 1em #2}} \def\subsubsubsubsubsection#1#2{{\parskip1em\settextsize{10}\bi #1\kern 1em #2}} @@ -191,3 +200,17 @@ }}} }} + + + +% Obsah a odkazy +\newwrite\tocfile +\immediate\openout\tocfile=toc-new.aux + +% Voláme: \addtoc\tocmacro{number}{asterisks}{title} +\long\def\addtoc#1#2#3#4{ + \edef\brum{ + \write\tocfile{\string#1{\noexpand\the\noexpand\count0}{#2}{#3}{#4}} + } + \brum +} diff --git a/src/formatitko/tex/table_of_contents.tex b/src/formatitko/tex/table_of_contents.tex new file mode 100644 index 0000000..dc29fae --- /dev/null +++ b/src/formatitko/tex/table_of_contents.tex @@ -0,0 +1,23 @@ +{ + +\def\pagelink#1{#1} +\def\toclink#1#2{% + #2 +} + +\def\stdskip{\vskip 3pt} +\def\tocsection#1#2#3#4{ + \line{\settextsize{14}\bf\hbox to 2em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip +} +\def\tocsubsection#1#2#3#4{ + \line{\bf\hskip 1.5cm \hbox to 3em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip +} +\def\tocsubsubsection#1#2#3#4{ + \line{\bf\hskip 3cm \hbox to 4em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip +} +\def\tocpicture#1#2#3#4{} + +\vskip 1cm +\input toc.aux + +} diff --git a/src/formatitko/tex/table_of_contents_pictures.tex b/src/formatitko/tex/table_of_contents_pictures.tex new file mode 100644 index 0000000..19033bb --- /dev/null +++ b/src/formatitko/tex/table_of_contents_pictures.tex @@ -0,0 +1,18 @@ +{ + +\def\pagelink#1{#1} +\def\toclink#1#2{% + #2 +} + +\def\stdskip{\vskip 3pt} +\def\tocsection#1#2#3#4{} +\def\tocsubsection#1#2#3#4{} +\def\tocsubsubsection#1#2#3#4{} +\def\tocpicture#1#2#3#4{ + \line{\hbox to 2em{#2\hfil}#4~\hfil\pagelink{#1}}\stdskip +} + +\vskip 1cm +\input toc.aux +}