1

I have a LaTeX document with a weird bug - the numbering of the theorems is not continuous. Theorem 0.0.1 is followed by Theorem 0.0.5 instead of 0.0.2. I have attached the MWE and the screenshot from the compiled PDF.

\documentclass[oneside, 12pt]{book}


\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}


\newtheorem{theorem}{Theorem}[section]

\begin{theorem}
        For every integer $k$, there exists an integer $f(k)$ such that, for all $n$ and any $k$-arc colouring of an $n$-vertex tournament, there is an absorbing set of size $f(k)$.
\end{theorem}

\begin{tblr}{
  colspec = {X[1,l,t]X[.5,c,h]},
  stretch = 0,
  rowsep = 2pt,
  colsep = 0pt,
  hlines = {black, 0pt},
  vlines = {black, 0pt},
}
\begin{theorem}
    If a $k$-arc-coloured tournament $T$ has no rainbow triplet (that is, a triplet of vertices such that all 3 arcs have different colours), then $T$ has an absorbing vertex.
\end{theorem}
&

TEST TEST TEST
\end{tblr}


\end{document}

And the compiled PDF

enter image description here

11
  • This is wrong \newtheorem{corollary}{Corollary}[theorem] should be \newtheorem{corollary}[theorem]{Corollary}, note I would to the same with all the others that are not the theorem om. Then they all count using the same counter, which is better for the reader. You only need [section] on the one that defineds theorem Commented Aug 23, 2024 at 8:01
  • @daleif Thanks for the observation. However, that doesn't fix the bug present in the output. Commented Aug 23, 2024 at 8:05
  • 1
    Do not show the output from a document unrelated to the code you post. Check that the code posted is an example of the problem you are asking about and post the output from that. Otherwise it's impossible to help. Commented Aug 23, 2024 at 8:15
  • 1
    You should look in the log file. There you will see (a) that your code does not compile and (b) that the table cells are parsed multiple times. The latter is probably causing the counter to be incremented more than once. Commented Aug 23, 2024 at 8:54
  • 1
    If you get any error always ask about the error not any pdf output that you may get if you scroll past the error. tex makes no attempt at sensible output while recovering from errors, it just tries to continue to syntax check the rest of the document. (thanks for correcting the example: it made it possible for egreg to answer) Commented Aug 23, 2024 at 9:42

1 Answer 1

0

There are several errors when trying your code; actually the same error repeated six times:

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.33 \end
         {tblr}
?

Using a minipage would help, but you also need the counter library.

\documentclass[oneside, 12pt]{book}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{counter}
\usepackage[export]{adjustbox}% also loads graphicx

\newtheorem{theorem}{Theorem}[section]

\begin{document}

\begin{theorem}
For every integer $k$, there exists an integer $f(k)$ such that, 
for all $n$ and any $k$-arc colouring of an $n$-vertex tournament, 
there is an absorbing set of size $f(k)$.
\end{theorem}

\noindent
\begin{tblr}{
  colspec = {X[1,l,t]X[.5,c,t]},
  stretch = 0,
  rowsep = 2pt,
  colsep = 0pt,
  hlines = {black, 0pt},
  vlines = {black, 0pt},
}
\begin{minipage}[t]{\dimeval{2\textwidth/3}}\begin{theorem}
If a $k$-arc-coloured tournament $T$ has no rainbow triplet 
(that is, a triplet of vertices such that all 3 arcs have 
different colours), then $T$ has an absorbing vertex.
\end{theorem}\end{minipage}
&
\quad\includegraphics[width=\dimeval{\textwidth/3-1em},valign=t]{example-image}
\end{tblr}

\end{document}

output

The same output can be obtained without tblr:

\documentclass[oneside, 12pt]{book}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{counter}
\usepackage[export]{adjustbox}% also loads graphicx

\newtheorem{theorem}{Theorem}[section]

\begin{document}

\begin{theorem}
For every integer $k$, there exists an integer $f(k)$ such that, 
for all $n$ and any $k$-arc colouring of an $n$-vertex tournament, 
there is an absorbing set of size $f(k)$.
\end{theorem}

\noindent
\begin{minipage}[t]{\dimeval{2\textwidth/3}}\begin{theorem}
If a $k$-arc-coloured tournament $T$ has no rainbow triplet 
(that is, a triplet of vertices such that all 3 arcs have 
different colours), then $T$ has an absorbing vertex.
\end{theorem}\end{minipage}\quad
\includegraphics[width=\dimeval{\textwidth/3-1em},valign=t]{example-image}


\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.