Eigene Frage mit eigener Antwort. Ich möchte in longtable die Funktionen der sections(part bis subparagraph) nutzen und pro Tabelle eine Inhaltsverzeichnis ausgeben. Wie geht das? gefragt 06 Mai '14, 03:00 ctansearch |
Open in writeLaTeX
\documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{longtable,array} \usepackage[ngerman]{babel} \usepackage{longtable} \newwrite\thetabcontents \immediate\openout\thetabcontents=\jobname.tcon \newcounter {tabpart} \newcounter {tabsection} \newcounter {tabsubsection}[tabsection] \newcounter {tabsubsubsection}[tabsubsection] \newcounter {tabparagraph}[tabsubsubsection] \newcounter {tabsubparagraph}[tabparagraph] \makeatletter \renewcommand\thetabpart {\@Roman\c@tabpart} \renewcommand\thetabsection{\@arabic\c@tabsection} \renewcommand\thetabsubsection{\thetabsection.\@arabic\c@tabsubsection} \renewcommand\thetabsubsubsection{\thetabsubsection.\@arabic\c@tabsubsubsection} \newcommand{\thetabcontent}{\textbf{\tablename\ \thetable}\par \immediate\closeout\thetabcontents \input\jobname.tcon \setcounter{tabpart}{0}} \makeatother \newcommand\tabpart[1]{\refstepcounter{tabpart}\setcounter{tabsection}{0}\vskip0.5\baselineskip\huge{\textsl{\thetabpart. #1}}\vskip0.5\baselineskip \immediate\write\thetabcontents{\thetabpart. #1 \hfill \par}\normalsize} \newcommand\tabsection[1]{\refstepcounter{tabsection}\vskip0.5\baselineskip\Large{\textsl{\thetabsection. #1}}\vskip0.5\baselineskip \immediate\write\thetabcontents{\thetabsection. #1 \hfill \par}\normalsize} \newcommand\tabsubsection[1]{\refstepcounter{tabsubsection}\vskip0.5\baselineskip\large{\textsl{\thetabsubsection. #1}}\vskip0.5\baselineskip \immediate\write\thetabcontents{\thetabsubsection. #1 \hfill \par}\normalsize} \newcommand\tabsubsubsection[1]{\refstepcounter{tabsubsubsection}\vskip0.5\baselineskip\normalsize{\textsl{\thetabsubsubsection. #1}}\vskip0.5\baselineskip \immediate\write\thetabcontents{\thetabsubsubsection. #1 \hfill \par}\normalsize} \newcommand\tabparagraph[1]{\vskip0.5\baselineskip\normalsize{\textsl{#1 }} \normalsize} \newcommand\tabsubparagraph[1]{\vskip0.5\baselineskip\normalsize{\textsl{#1 }}\normalsize} \begin{document} \begin{longtable}{|p{4cm}|p{4cm}|p{4cm}|}\caption{Longtable mit Sections}\\ \tabpart{Part} Erster Teil \tabsection{Tabsection}Some Text. \tabsubsection{Tabsubsection}Some Text. Some Text. \tabsubsubsection{Tabsubsubsection}Some Text. Some Text. Some Text. Some Text. Some Text. \tabparagraph{Tabparagraph}Some Text. Some Text. \tabsubparagraph{Tabsubparagraph}Some Text. Some Text. Some Text. Some Text. Some Text.& \tabpart{Part}Zweiter Teil \tabsection{Tabsection}Some Text. Some Text. \tabsubsection{Tabsubsection}Some Text. Some Text. Some Text. Some Text. Some Text. \tabsubsubsection{Tabsubsubsection}Some Text. Some Text. \tabparagraph{Tabparagraph}Some Text. \tabsubparagraph{Tabsubparagraph}Some Text. Some Text.& \tabpart{Part}Dritter Teil \tabsection{Tabsection}Some Text.Some Text. \tabsubsection{Tabsubsection}Some Text. Some Text. \tabsubsubsection{Tabsubsubsection}Some Text. Some Text. \tabparagraph{Tabparagraph}Some Text. Some Text. Some Text. Some Text. \tabsubparagraph{Tabsubparagraph}Some Text. Some Text. Some Text. Some Text. Some Text.\\ \end{longtable} \thetabcontent \newpage \end{document} beantwortet 06 Mai '14, 03:01 ctansearch |