Can identical code produce two different .pdf? Awe NiceTabular

Darío darioslc at protonmail.com
Sat Sep 9 20:38:34 CEST 2023


> Hello,

Hello,

> > No one was having any problems until I mentioned a \newcommand which allowed me to print the pdf two veneers on one screen, through the 2up package:

yes, because I didn't know it was because of that issue. Then I started commenting out all the possible packages that would have problems.

> well you quite hid this information didn't you? Neither on tex.sx nor on texhax you mentioned that you are using a package that manipulates the shipout box.

Again, because that reason didn't cross my mind. That was my doubt because I had two documents with identical preambles, except for the \newcommand I was using (I didn't take it into account because I call the new commands from another file with \input), I wouldn't have thought it would be that problem.

> Well it won't work. Nicetabular relies on pgf being able to record the position on the page and your package breaks that.

Now that I found the package that causes the problem, and you explain the reason I understand what happened.

> You will have to decide if you want nicetabular or 2up. Both won't work. (And be aware that 2up is probably incompatible with more packages.)

Yes, if I need two pages in one, I will use 2up and nicetabular only when the document is finish and with only compilation, meanwhile only nicetabular.

> Ulrike

Thanks Ulrike for the clarification.

Darío

>
> > > Am Fri, 08 Sep 2023 03:21:57 +0000 schrieb Darío via texhax:
> > >
> > > Different code can produce different PDF and you obviously do not
> > > have identical code if the preambles of your files differ.
> > >
> > > But you need to ask a clear question: Create two complete files
> > > (but as short as possible) showing one of the differences you don't
> > > understand and then ask a question which shows these files.
> > >
> > > Do not overload your question with lot of speculations or side
> > > remarks.
> > >
> > > Btw: be a aware that nicetabular typically needs two compilations to
> > > get everything right.
> > >
> > > --
> > > Ulrike Fischer
> > > http://www.troubleshooting-tex.de/
>
> > Hello, I don't know how add images without add files in the email, sorry if didn't work on the cell.
>
> > Anyway, I continued to test and test. I think I found the problem.
>
> > In my templates tex's files use various call to files with \input{file.tex} in the preamble. In this files I separate by general, pstricks, maths, siunitx and newcommands; a lot of packages inside.
>
> > I tried uncommented one by one, and compile (three times at least) and for each round delete the .log and .aux. No one was having any problems until I mentioned a \newcommand which allowed me to print the pdf two veneers on one screen, through the 2up package:
>
> > \twouplegaltarget
> > \newcommand{\doscarillas}{
> > \special{landscape}
> > \TwoupWrites
> > \target{\magstepminus1}{29cm}{21cm}
> > \source{\magstep0}{21cm}{29cm}
> > }
> > this commands it is inside the archive that contain newcommands utils for me. Then if comment or uncomment \doscarillas can or can't press directly pdf.
>
> > Here is an example of a code that checks:
> > \documentclass[12pt,a4paper]{article}
>
> > \usepackage{nicematrix,float,mhchem,booktabs,2up}
>
> > \twouplegaltarget\newcommand{\doscarillas}{
> > \special{landscape}
> > \TwoupWrites
> > \target{\magstepminus1}{29cm}{21cm}
> > \source{\magstep0}{21cm}{29cm}
> > }
>
> > %\doscarillas % this
>
> > \begin{document}
> > \begin{table}[H]
> > \begin{NiceTabular}[c]{l|c|c|c}
> > \CodeBefore
> > \rowlistcolors{2}{red!15,blue!15}
> > \Body
> > \toprule
> > Tipo de ión & Carga eléctrica total & Símbolo & Ejemplo\\\toprule
> > Catión & positiva & $X^{+}$ & \ce{Na+}\\
> > Anión & negativa & $X^{-}$ & \ce{Cl-}\\
> > Catión & positiva & & \ce{Ca^3+}\\
> > Anión & negativa & & \ce{F^2-}\\
> > \end{NiceTabular}
> > \end{table}
> > \end{document}
>
> > Conjectures:
> > 1- with command \doscarillas commented Nice Tabular after at least three compilations work perfect. The package 2up can or not be declared, is indifferent.
> > 2- after these compilations if I uncomment \doscarillas, and compile ONLY once, the properties of the table are maintained, ie work fine.
> > 3- Now, if tex file is again compiled or modified and then compiled: catastrophe!! The tables lost the beauty of NiceTabular: color, vertical rules.
> > 4- If then of lost this properties, again uncomment \doscarillas and compile three times, everything is back to normal, ie NiceTabular is nice.
>
> > Conclusion: if I want use the newcommand \doscarillas, only when the files is absolutely concluded. The rest of packages, or at least they I use, do not give problems.
>
> > Observations: I compile use latex, and then dvipdf.
> > If someone can proof this example, comment and uncomment \doscarillas and compile at least three times for each %, for more corroboration.
>
> > Thanks a lot!
> > Darío
>
>
>



More information about the texhax mailing list.