0

I'm working with a style in two columns. I would like to put a table fitting in one column as did in https://tex.stackexchange.com/questions/180543/creating-a-table-fitting-one-column-of-a-two-column-style-page.

However, if I use big strings as "large large large large large large" inside a \rotatebox, I have the error:

pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pdfstartlink. \end{document}

\begin{table}
\caption{Summary of the characteristics used in some related works.}
\label{tableRelatedWorks2}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{ccccccc}
\rotatebox[origin=c]{90}{\text{large large large large large large} }       & \text{KLSRf}   & \text{MLDFSP}       & \text{PNDND}       & \text{LDFSSVM}   & \rotatebox[origin=c]{90}{a}  & \rotatebox[origin=c]{90}{b}\\
\hline
\end{tabular}
}
\end{table}

If I put a string with 5 characters instead of "large large large large large large" in the code above, it works.

Someone could say what's wrong?

Sebastiano
  • 54,118
michael
  • 21

2 Answers2

2

The error message has nothing to do with \resizebox. The error message is created by a link (e.g., see package hyperref) that is broken across pages. Links inside \resizebox never cross page borders.

It is just accidental that a different box size of a element on a page changes the page breaks in such a way that there is now a link across page borders.

Try to avoid links across page borders, they are not well supported by the drivers. Because they do not know, which elements on a page belongs to the link, they use a heuristic to get these elements. Heuristics can work in many cases, but they also fail.

Heiko Oberdiek
  • 271,626
  • I did not understand your explanation. My error is in that code, if I change "!" by some "big" number, it works. – michael Apr 01 '18 at 16:07
  • @michael By changing the height of the \resizebox you get different page breaks. The problem is the page break in the middle of a link. – Heiko Oberdiek Apr 01 '18 at 17:57
0

I found a solution:

We need to change the ! in the brackets because it keep the aspect ratio with \columnwidth. So, let's put some distance instead of !. Ex:

\begin{table}
\caption{Summary of the characteristics used in some related works.}
\label{tableRelatedWorks2}
\resizebox{\columnwidth}{10cm}{%
\begin{tabular}{ccccccc}
\rotatebox[origin=c]{90}{\text{large large large large large large} }       & \text{KLSRf}   & \text{MLDFSP}       & \text{PNDND}       & \text{LDFSSVM}   & \rotatebox[origin=c]{90}{a}  & \rotatebox[origin=c]{90}{b}\\
\hline
\end{tabular}
}
\end{table}

If 10 cm gives an error yet, just increase it.

So, I put some rows more to show the results. For my case, 5.5cm is ideal: enter image description here

michael
  • 21
  • 1
    if you scale both x and y you distort all the text? – David Carlisle Apr 01 '18 at 00:46
  • yes, you need to find what is the nice combination for x and y. In that case, x = \columnwidth, so, changing y progressively will work. – michael Apr 01 '18 at 00:51
  • No! scaling tables at all is to be avoided, scaling by different amounts in each direction should never be done unless you are distorting text for "fun" effects. – David Carlisle Apr 01 '18 at 09:39
  • I put a picture to show my scaling. For any number below 5.5cm, I obtained the error. For some number bigger then 5.5, I will have distortions. – michael Apr 01 '18 at 15:55
  • No as Heiko says the link error is unrelated to the \resizebox and your text is distorted in all cases, this is really bad advice. For your own documents of course you can do whatever works for you. but you shouldn't post this as an answer that others may use. – David Carlisle Apr 01 '18 at 15:59
  • Ohh, ok. I don't know from which package the error comes. I just know that the code with "!" in my case does not work. If I delete the table, there is no error. If I change "!" by a "big" number, there is no error, but some distortions to be corrected. – michael Apr 01 '18 at 16:10
  • 1
    the error comes from page breaking in a link so the only relation with \resizebox is that it affects the size of the item on the page so adjusts the page breaking so some link elsewhere in the document gets broken over a page break. Heiko wrote the linking code, and I wrote \resizebox, and we are both telling you that \resizebox is not connected with the error. – David Carlisle Apr 01 '18 at 16:13