Can identical code produce two different .pdf? Awe NiceTabular

Darío darioslc at protonmail.com
Fri Sep 8 05:21:57 CEST 2023


Hello! I am confused about this.
This behavior in tables using Nice Tabular has been giving me a headache for a long time. I consulted him in tex.stackexchange: https://tex.stackexchange.com/questions/694224/horizontal-rules-or-not-horizontal-rules-in-nicetabular
was closed for unlessclarity.

But today I find myself writing a code, and then compile the tables was perfect, as I wanted, ie: vertical lines, double vertical lines and the colors in the rows. For clarity, this file will be called good file.tex

Seeing that it worked, I tried copying a code that wasn't working for me to another file, called filebad.tex.

I copied the portion that didn't work to the filegood.tex, then compile and perfect! the tables that don't work in filebad work fine in filegood. Is it possible?? It baffles me.

Both files it have the same package, the only difference is that filebad is a book and filegood is an article and the book have \tableofcontents ¿?

The compilation use this command line (I use geany to compile with F8 key, on Debian 12):
latex --file-line-error-style -output-directory=/tmp "%f" && dvipdf /tmp/"%e.dvi"

The pdf's file produce for filebad is in [1], and filegood in [2].

This is the code for some tables:
\documentclass[12pt,a4paper]{article}
\usepackage{nicematrix}
\usepackage[version=4]{mhchem}
\usepackage{booktabs}
\usepackage{float}
\begin{document}
	\begin{table}[H]
	\begin{NiceTabular}{|l|c|c|c|c|c|c|}
	\CodeBefore
	%\rowlistcolors{1}{red} % sólo la primer fila
	\rowlistcolors{2}{red!15,blue!15}
	\Body
		\toprule
		Isótopo & Nombre & $Z$ & $A$ & $p^{+}$ & $n$ & $e^{-}$\\\toprule
		\ce{^{80}_{35}Br} & & 35 & 80 & & & 35\\\midrule
		\ce{^{54}_{26}Fe} & & & & 26 & &\\\midrule
		\ce{^{204}_{82}Pb} & Plomo 204 & 82 & & 82 & & \\\midrule
		\ce{^{131}_{53}I} & & & & & & \\\midrule
		\ce{^{208}_{82}Pb} & & & 208 & & 126 & \\\midrule
                \ce{^{235}_{92}U} & Uranio 235 & & 235 & & & \\\bottomrule
	\end{NiceTabular}
\end{table}
\end{document}

If I compile only this, really good but in the filebad.tex not; and incredibly in the filegood.tex compile correctly. Really don't understand this behavior.

I could share both full codes, they are a bit long and I have separate files, to see if someone can help me to find the error. I repeat both files have identical packages in use.

Thanks a lot, apologies if it is not understood, but I do not understand these different behaviors.
Darío

[1] https://postimg.cc/vcM6x8Yh
[2] https://postimg.cc/F7Zkyt14



More information about the texhax mailing list.