Graphics, Figures & TablesHow to use a self-made enumeration inside a table ?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
GroovieMan
Posts: 5
Joined: Sat Jan 20, 2024 6:56 pm

How to use a self-made enumeration inside a table ?

Post by GroovieMan »

Dear friends,

i was looking for a continuous numbering in my document (currently a letter). So i defined a number:

\declaretheoremstyle[headfont=\scshape]{receiptstyle}
\declaretheorem[style=receiptstyle]{receipt}


So here i get my exprected enumeration in a text:

\section{income}
\subsection{income GroovyMan}
\begin{receipt}
\href{run:/doc/tax/groovyManPayroll.pdf}{income of a underrated superhero}
\end{receipt}

\subsection{income GroovyWoman}
\begin{receipt}
\href{run:/doc/tax/groovyWomanPayroll.pdf}{income of the best woman}
\end{receipt}
% ...


Smokin ... that was the feature i was looking for, and now for some completly different:

\begin{tabular}{||c|l|r|r||}\hline \hline
\begin{receipt}
not working
\end{receipt} & elle & err & err \\ \hline


This does not work, i tried \receipt but it also failed. It seems, that the scope of receipt stops before the table. Any ideas?
While i was playing with this, i got the implression, that the receipt is beeing called, cause in one case the number was increased, but i am not really sure.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

How to use a self-made enumeration inside a table ?

Post by Stefan Kottwitz »

That doesn't sound too difficult, but here, we don't have any code to test. That code above may work. But it's unknown to us if you use any theorem package (amsthm, ntheorem, thmtools, ...) or a table environment around etc. Perhaps provide a Infominimal working example and mark it as code with the Code button, as you did in your other post. Such code can be compiled directly here in the forum and even corrected/tested on a smartphone.

Stefan
LaTeX.org admin
GroovieMan
Posts: 5
Joined: Sat Jan 20, 2024 6:56 pm

How to use a self-made enumeration inside a table ?

Post by GroovieMan »

Salut Stefan,

thank you for your immediate freply, here it is:

Code: Select all

\documentclass[article,
    11pt,
    a4paper
    parskip=yes]{scrlttr2}
    
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}

\declaretheoremstyle[headfont=\scshape]{mystyle}
\declaretheorem[style=mystyle]{payment}


\begin{document}
Thats me!

\begin{payment} 
first use of a counter!
\end{payment}

\begin{payment} 
Next use of my payment!
\end{payment}

\begin{tabular}{ c c c }
\begin{payment} 
\end{payment} & cell2 & cell3 \\ 

\begin{payment} 
\end{payment} & cell5 & cell6 \\  

\begin{payment} 
\end{payment} & cell8 & cell9    
\end{tabular}

\end{document}
and this ony also fails:

Code: Select all

\documentclass[article,
    11pt,
    a4paper
    parskip=yes]{scrlttr2}
    
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\usepackage[T1]{fontenc}

\declaretheoremstyle[headfont=\scshape]{mystyle}
\declaretheorem[style=mystyle]{payment}


\begin{document}
Thats me!

\begin{payment} 
first use of a counter!
\end{payment}

\begin{payment} 
Next use of my payment!
\end{payment}

\begin{tabular}{ c c c }
\payment & cell2 & cell3 \\ 
\payment & cell5 & cell6 \\  
\payment & cell8 & cell9 \\
\end{tabular}

\end{document}
I simply want a ongoing counter,similar to a cite.
Post Reply