13

I've posted an answer to this question, but Zarko has correctly pointed out that my solution doesn't fit the text width.

That is clearly visible using \usepackage{showframe}, but I don't have any Overfull \hbox... in my log, why?

\documentclass[12pt,a4paper,twoside]{report}
\usepackage{amsmath, amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows, tikzmark, calc}
\usepackage{showframe}
\begin{document}
    \begin{table}
        \centering
        \bgroup
        \def\arraystretch{2.0}
        \begin{tabular}{|c|c|c|}
            \hline
            $\mu \in Y$& Condition applied on $\delta(\mu)$  & Implication upon lifting \\ \hline
            $-4$ & $\bigg(\dfrac{13\cdot1789}{q}=-1\bigg)$  & $n \not\equiv k-4 \pmod{2k}$  \\ \hline
            $-3$ & $\bigg(\dfrac{5\cdot29}{q}=-1\bigg)$  & $n \not\equiv k-3 \pmod{2k}$  \\ \hline
            $-2$ & - & - \tikzmark{here} \\ \hline
            $-1$ & $\bigg(\dfrac{5\cdot29}{q}=-1\bigg)$  & $n \not\equiv k-1 \pmod{2k}$  \\ \hline
            $0$ & $\bigg(\dfrac{13\cdot1789}{q}=-1\bigg)$  & $n \not\equiv k \pmod{2k}$  \\ \hline
            $3$ & $\bigg(\dfrac{5333\cdot97324757}{q}=-1\bigg)$  & $n \not\equiv k+3 \pmod{2k}$  \\ \hline
        \end{tabular}
        \egroup
        \caption{Conditions following from pushing up modulus.\label{condition}}
    \end{table}

\begin{tikzpicture}[overlay,remember picture]
\node at ($(pic cs:here)+(2.7,0.1)$) {$\rightarrow$};
\node[draw, rounded corners, align=left] at ($(pic cs:here)+(5,0.2)$) {%
    Refer Theorem \dots \\ in Section \dots \\ of Chapter 5
    };
\end{tikzpicture}
\end{document}

enter image description here

CarLaTeX
  • 62,716

1 Answers1

17

The overlay option means that the tikzpicture, or its bounding box at least, will have zero size, so as far as TeX is concerned, it doesn't stick out in the margin. However, the picture drawing commands are passed to the engine as lowlevel instructions. They are just not processed by the TeX paragraph typesetting algorithm. If the picture was inline, in fact, the picture would be overwritten by the text following it. This key can also be supplied to individual drawing commands for excluding from bounding box computations. When given to the TikZ picture all content inherits this key.

Quoting the manual, here is the first paragraph of the description of the overlay key:

This option is mainly intended for use when nodes in other pictures are referenced, but you can also use it in other situations. The effect of this option is that everything within the current scope is not taken into consideration when the bounding box of the current picture is computed.

(From section 17.13.1 Referencing a Node in a Different Picture, page 248. Manual for version 3.0.1a, dated August 29, 2015.)


By the way, note that the \bgroup/\egroup is not necessary I think, the table environment forms a group, so the arraystretch will be local to this table anyway.


As an aside, if you instead place everything inside the tikzpicture, without [overlay,remember picture], you will get the overfull box.

\documentclass[12pt,a4paper,twoside]{report}
\usepackage{amsmath, amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows, tikzmark, calc}
\usepackage{showframe}
\begin{document}
\begin{table}
  \centering
  \begin{tikzpicture}
     \node [inner sep=0pt] (tab) {%
        \def\arraystretch{2.0}
        \begin{tabular}{|c|c|c|}
            \hline
            $\mu \in Y$& Condition applied on $\delta(\mu)$  & Implication upon lifting \\ \hline
            $-4$ & $\bigg(\dfrac{13\cdot1789}{q}=-1\bigg)$  & $n \not\equiv k-4 \pmod{2k}$  \\ \hline
            $-3$ & $\bigg(\dfrac{5\cdot29}{q}=-1\bigg)$  & $n \not\equiv k-3 \pmod{2k}$  \\ \hline
            $-2$ & - & - \\ \hline
            $-1$ & $\bigg(\dfrac{5\cdot29}{q}=-1\bigg)$  & $n \not\equiv k-1 \pmod{2k}$  \\ \hline
            $0$ & $\bigg(\dfrac{13\cdot1789}{q}=-1\bigg)$  & $n \not\equiv k \pmod{2k}$  \\ \hline
            $3$ & $\bigg(\dfrac{5333\cdot97324757}{q}=-1\bigg)$  & $n \not\equiv k+3 \pmod{2k}$  \\ \hline
        \end{tabular}};
      \node [right=3mm] (arrow) at (tab.east) {$\rightarrow$};
      \node[draw, rounded corners, align=left,right=3mm] at (arrow.east) {%
         Refer Theorem \dots \\ in Section \dots \\ of Chapter 5
         };
\end{tikzpicture}
\caption{Conditions following from pushing up modulus.\label{condition}}
\end{table}
\end{document}
percusse
  • 157,807
Torbjørn T.
  • 206,688