Ich möchte Tabelleninhalte(Zelleninhalte) mit einem Label versehen und diese an beliebiger Stelle im Text referenzieren. Dazu müssten als Wert des Labels " Open in writeLaTeX
\documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{longtable} \begin{document} Text Text Text Text Text Text Text Text Text Text Text Text Text \begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{First}\\ Hauptzutat&Fleisch&Gemüse\\ \\ Kartoffeln&Frikadellen&Zwiebeln\\ Kartoffeln&\label{tablinecol}Frikadellen&Rotkohl\\ Kartoffeln&Bratwurst&Rotkohl\\ \end{longtable} Wie in Tabelle \ref{tablinecol} erwähnt, sind Frikadellen die Fleischzutat.\\ Text Text Text Text Text Text Text Text Text Text Text Text Text \end{document} gefragt 15 Mär '14, 23:21 ctansearch esdd |
Open in writeLaTeX
\documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{longtable,array} \newcounter{tabrow} \newcounter{tabcol} \renewcommand\thetabcol{\thetable.\thetabrow.\arabic{tabcol}} \newcommand\inittable{\setcounter{tabcol}{0}% \setcounter{tabrow}{0}} \newcommand\initrow{\setcounter{tabcol}{0}% \refstepcounter{tabrow}% \thetabrow~%zum sehen der Zeilennummer } \newcommand\countcol{\refstepcounter{tabcol}} \begin{document} Text Text Text Text Text Text Text Text Text Text Text Text Text \inittable \begin{longtable}[l]{>{\initrow\countcol}p{3cm} >{\countcol}p{2cm} >{\countcol}p{2cm}} \caption{First}\\ Hauptzutat&Fleisch&Gemüse\\ \multicolumn{1}{c}{}\\ Kartoffeln&Frikadellen&Zwiebeln\\ Kartoffeln&\label{tablinecol}Frikadellen&Rotkohl\\ Kartoffeln&Bratwurst&Rotkohl\\ \end{longtable} Wie in Tabelle \ref{tablinecol} erwähnt, sind Frikadellen die Fleischzutat.\\ Text Text Text Text Text Text Text Text Text Text Text Text Text \end{document} Natürllich musst du in beantwortet 21 Mär '14, 10:07 Ulrike Fischer esdd @Ulrike Fischer Sehr schön,danke
(21 Mär '14, 20:44)
ctansearch
|
Aktualisiert 21.03.2014 Habe nun eine
Open in writeLaTeX
% **************************************** % * tabrefnotes % **************************************** % % Date of this version: 2014-03-19 % Matthias Borck-Elsner % %% Based on endnotes.sty Copyright 2002 John Lavagnino %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.2 %% of this license or (at your option) any later version. %% The lambe version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.2 or later is part of all distributions of LaTeX %% version 1999/12/01 or later. %% %% **************************************** %% * tabrefnote MACROS * %% **************************************** \newcounter{tabcols}%relevant \newcounter{tabrows}%relevant \@definecounter{tabrefnote}% \newcommand{\trfl}{\\\stepcounter{tabrows}\setcounter{tabcols}{0}} \def\thetabrefnote{\@arabic\c@tabrefnote}% \def\@maketabrefmark{\hbox{{{\textsuperscript{\tiny(\@thetabrefmark)}}}}}% \def\maketabrefmark{\@maketabrefmark}% \def\thetabrefmark{\@thetabrefmark}% \newdimen\tabrefnotesep% \def\tabrefnote{\@ifnextchar[\@xtabrefnote{\stepcounter{tabrefnote}% \protected@xdef\@thetabrefmark{\thetabrefnote}% \@tabrefnotemark\@tabrefnotetext}}% \def\@xtabrefnote[#1]{% \begingroup% \c@tabrefnote=#1\relax% \unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}% \endgroup% \@tabrefnotemark\@tabrefnotetext}% \let\@doantabrefnote=0% \let\@endantabrefnote=0% \newwrite\@tabrefnotes% \newif\if@tabrefnotesopen\global\@tabrefnotesopenfalse% \def\@opentabrefnotes{\immediate\openout\@tabrefnotes=\jobname.tabref\relax% \global\@tabrefnotesopentrue}% \long\def\@tabrefnotetext#1{% %relevant #2 um tabcols heraufzusetzen \stepcounter{tabcols}% \if@tabrefnotesopen \else\@opentabrefnotes\fi% \immediate\write\@tabrefnotes{\@doantabrefnote{(\@thetabrefmark)% \thetable.\thetabrows.\thetabcols }}%%relevant zur Ausgabe der rows und cols \begingroup% \def\tabrefnote{#1\ }% %%%%%%%%%%%%%% %bezug definieren? \xdef\test{\noexpand\textsl{test \thetable.\thetabrows.\thetabcols}\ }%relevant zur defintion des Bezugs %bezug definieren? %%%%%%%%%%%%%%% \newlinechar='40% \immediate\write\@tabrefnotes{\meaning\tabrefnote}% \endgroup% \immediate\write\@tabrefnotes{\@endantabrefnote}}% \long\def\addtotabrefnotes#1{% \if@tabrefenotesopen\else\@opentabrefnotes\fi% \begingroup% \newlinechar='40% \let\protect\string% \immediate\write\@tabrefnotes{#1}% \endgroup}% \def\tabrefnotemark{% \@ifnextchar[\@xtabrefnotemark% {\stepcounter{tabrefnote}% \protected@xdef\@thetabrefmark{\thetabrefnote}% \@tabrefnotemark}}% \def\@xtabrefnotemark[#1]{% \begingroup% \c@tabrefnote #1\relax% \unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}% \endgroup% \@tabrefnotemark}% % \def\@tabrefnotemark{% \leavevmode% \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi% \maketabrefmark% \ifhmode\spacefactor\@x@sf\fi% \relax}% % \def\tabrefnotetext{% \@ifnextchar [\@xtabrefnotenext% {\protected@xdef\@thetabrefmark{\thetabrefnote}% \@tabrefnotetext}}% % \def\@xtabrefnotenext[#1]{\begingroup \c@tabrefnote=#1\relax% \xdef\@thetabrefmark{\thetabrefnote}\endgroup\@tabrefnotetext}% % \def\@xtabrefnotenext[#1]{% \begingroup% \c@tabrefnote=#1\relax% \unrestored@protected@xdef\@thetabrefmark{\thetabrefnote}% \endgroup% \@tabrefnotetext}% \def\tabrefnotesname{tabrefnotes} % \def\tabrefnoteheading{\subsection*{\footnotesize{\tabrefnotesname} \@mkboth{\MakeUppercase{\tabrefnotesname}}{\MakeUppercase{\tabrefnotesname}}}% }% \def\tabrefnoteformat{% \leavevmode\llap{\maketabrefmark}}%% \def\tabrefnotesize{\scriptsize}%%relevant für Größe der tabrefnote in \thetabrefnotes \def\thetabrefnotes[#1]{\def\tabrefnotesname{#1}\immediate\closeout\@tabrefnotes \global\@tabrefnotesopenfalse% \begingroup% \makeatletter% \edef\@tempa{`\string >}% \ifnum\catcode\@tempa=12% \let\@ResetGT\relax% \else% \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}% \@makeother\>% \fi% \def\@doantabrefnote##1##2>{\def\@thetabrefmark{##1}\begingroup% \@ResetGT% \edef\@currentlabel{\csname p@tabrefnote\endcsname\@thetabrefmark}% \tabrefnoteformat}% \def\@endantabrefnote{\endgroup}% \tabrefnoteheading % \tabrefnotesize% \input{\jobname.tabref}% \setcounter{tabrefnote}{0} % \setcounter{tabrows}{0} % \setcounter{tabcols}{0} % \endgroup}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Open in writeLaTeX
\documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tabularx,longtable,tabrefnote} \usepackage{xcolor} \parindent=0pt \begin{document} \section{Dummy} Ein Text vor dem Problem. \section{longtable} \begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{First}\\ Zähler&Nenner&Bruch\trfl 1\tabrefnote{null}&2&$\frac{1}{2}$\trfl 1\tabrefnote{Atest}&2\tabrefnote{Btest}&$\frac{1}{2}$\tabrefnote{Ctest}\trfl 1\tabrefnote{Dtest}&2\tabrefnote{Etest}&$\frac{1}{2}$\tabrefnote{Ftest}\trfl 1&2&$\frac{1}{2}$\trfl \thetabrefnotes[] \end{longtable} \begin{longtable}[l]{p{2cm}p{2cm}p{2cm}}\caption{First}\\ Zähler&Nenner&Bruch\trfl 1\tabrefnote{null}&2&$\frac{1}{2}$\trfl 1\tabrefnote{Atest}&2\tabrefnote{Btest}&$\frac{1}{2}$\tabrefnote{Ctest}\trfl 1\tabrefnote{Dtest}&2\tabrefnote{Etest}&$\frac{1}{2}$\tabrefnote{Ftest}\trfl 1&2&$\frac{1}{2}$\trfl \thetabrefnotes[] \end{longtable} \section{Dummy} Ein Text \test nach dem Problem. \end{document} beantwortet 17 Mär '14, 01:47 ctansearch esdd |