TColorBox e Tikz, as setas não estão no diagrama

TColorBox e Tikz, as setas não estão no diagrama

Abaixo incluí um mwe. Como você pode ver, no último diagrama, os erros das últimas três caixas são renderizados na próxima página. Como posso consertar isso? Eu compilo usando o TexShop que usa esse comando pdftex --file-line-error --synctex=1. Sim, compilei mais de duas vezes.

\documentclass[11pt, letterpaper, oneside]{memoir}

\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{enumitem, amssymb}
\usepackage{textcomp}
\usepackage[tracking = true, letterspace = 125]{microtype}
\usepackage{soul}
\usepackage{mfirstuc}
\usepackage{scalerel}
\usepackage[skins, raster]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.markings}
\usepackage{etoolbox}
\usetikzlibrary{optics}
\usepackage{draftwatermark}
\usepackage[pass]{geometry}
\usepackage[hyphens]{url}
\usepackage{hyperxmp}
\usepackage{hyperref}
\usepackage{xfrac}
\usepackage{multicol}

\usepackage[english]{babel}
\usepackage{blindtext}

% force LaTeX to write the author, title, and copyright into the PDF
\makeatletter
  \AtEndDocument{\hyxmp@find@metadata\hyxmp@embed@packet}
\makeatother
\hypersetup{
    colorlinks=true,
    linktoc=all,
    urlcolor=blue,
    linkcolor=part,
    draft=false,
    pdfauthor={some authoer},
    pdftitle={some org},
    pdfcopyright={Copyright \copyright~2019 by author. Some rights reserved.},
    pdfpagelabels=true,
    implicit=false
}

\chapterstyle{ell}

\setlength{\emergencystretch}{6pt}
\setlrmarginsandblock{1in}{1in}{*}
\checkandfixthelayout
\linespread{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%
%   The Document
%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\title{A Title}
\author{An Author}
\date{}
\maketitle

\frontmatter

\blindtext

\mainmatter

\Blindtext
\tcbset{enhanced, nobeforeafter, sidebyside align=top,box align=center, width=1.6in}

\begin{center}
\begin{tcolorbox}[remember as=one]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=two]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=three]
Many more somethings happen and the world nearly dies
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=four]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=five]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=six]
a result
\end{tcolorbox}
\end{center}

\begin{tikzpicture}[overlay,remember picture,line width=0.5mm]
\draw[->] (one.east) to (two.west);
\draw[->] (three.east) to (four.west);
\draw[->] (five.east) to (six.west);
\end{tikzpicture}

\blindtext
\begin{center}
\begin{tcolorbox}[remember as=1]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=2]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=3]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=4]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=5]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=6]
a result
\end{tcolorbox}
\end{center}

\begin{tikzpicture}[overlay,remember picture,line width=0.5mm]
\draw[->] (1.east) to (2.west);
\draw[->] (3.east) to (4.west);
\draw[->] (5.east) to (6.west);
\end{tikzpicture}

\backmatter

\blindtext

\end{document}

as setas não estão no diagrama

Responder1

Basta colocar a imagem tikz no mesmo centerambiente para forçá-la a ficar na mesma página... O LaTeX decidiu colocar a caixa de cores na próxima página, mas mudou de ideia e forçou isso depois de pensar duas vezes na anterior... a imagem tikz estava fora o ambiente e não segui o segundo pensamento do LaTeX porque ele é impresso após a segunda compilação interna (precisa de mais um do que uma imagem tikz real como sobreposição)... Espero ter ajudado.

\documentclass[11pt, letterpaper, oneside]{memoir}

\usepackage{libertine}
\usepackage{libertinust1math}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{enumitem, amssymb}
\usepackage{textcomp}
\usepackage[tracking = true, letterspace = 125]{microtype}
\usepackage{soul}
\usepackage{mfirstuc}
\usepackage{scalerel}
\usepackage[skins, raster]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.markings}
\usepackage{etoolbox}
\usetikzlibrary{optics}
\usepackage{draftwatermark}
\usepackage[pass]{geometry}
\usepackage[hyphens]{url}
\usepackage{hyperxmp}
\usepackage{hyperref}
\usepackage{xfrac}
\usepackage{multicol}

\usepackage[english]{babel}
\usepackage{blindtext}

% force LaTeX to write the author, title, and copyright into the PDF
\makeatletter
  \AtEndDocument{\hyxmp@find@metadata\hyxmp@embed@packet}
\makeatother
\hypersetup{
    colorlinks=true,
    linktoc=all,
    urlcolor=blue,
    linkcolor=part,
    draft=false,
    pdfauthor={some authoer},
    pdftitle={some org},
    pdfcopyright={Copyright \copyright~2019 by author. Some rights reserved.},
    pdfpagelabels=true,
    implicit=false
}

\chapterstyle{ell}

\setlength{\emergencystretch}{6pt}
\setlrmarginsandblock{1in}{1in}{*}
\checkandfixthelayout
\linespread{1.3}

%%%%%%%%%%%%%%%%%%%%%%%%%%
%   The Document
%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\title{A Title}
\author{An Author}
\date{}
\maketitle

\frontmatter

\blindtext

\mainmatter

\Blindtext
\tcbset{enhanced, nobeforeafter, sidebyside align=top,box align=center, width=1.6in}

\begin{center}
\begin{tcolorbox}[remember as=one]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=two]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=three]
Many more somethings happen and the world nearly dies
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=four]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=five]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=six]
a result
\end{tcolorbox}

\begin{tikzpicture}[overlay,remember picture,line width=0.5mm]
\draw[->] (one.east) to (two.west);
\draw[->] (three.east) to (four.west);
\draw[->] (five.east) to (six.west);
\end{tikzpicture}
\end{center}

\blindtext
\begin{center}
\begin{tcolorbox}[remember as=1]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=2]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=3]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=4]
a result
\end{tcolorbox}
\end{center}

\begin{center}
\begin{tcolorbox}[remember as=5]
Something happens
\end{tcolorbox}
\qquad
\begin{tcolorbox}[remember as=6]
a result
\end{tcolorbox}
\begin{tikzpicture}[overlay,remember picture,line width=0.5mm]
\draw[->] (1.east) to (2.west);
\draw[->] (3.east) to (4.west);
\draw[->] (5.east) to (6.west);
\end{tikzpicture}
\end{center}
\clearpage
\backmatter

\blindtext

\end{document}

informação relacionada