I am using tikz to put braces around an enumerated list as mentioned here. I have two curly braces with multiple comments as shown below
The problem is I am not able to get the braces at the right place when my list is at a page end. The braces appear on the next page at weird positions. Interestingly if I move my list to some other position away from the page end, I get it at the right place. Here is the code
\documentclass[sunil1]{sunil}
\usepackage{lmodern,calc,tikz,textcomp}
\usetikzlibrary{tikzmark,decorations.pathreplacing}
\usetikzlibrary{calc}
\begin{document}
\newcommand\insm{%
$\left.\rule{0pt}{1.6\baselineskip}\right\}$\parbox{\textwidth-2ex}{%
\setlist[1]{itemsep=-5pt}
\begin{itemize}
\item[] (\textit{a} to \textit{b})
\item[]Deformations
\item[] (\textit{b} to \textit{c})
\end{itemize}}
}
\newcommand\wnsm{%
$\left.\rule{0pt}{1.6\baselineskip}\right\}$\parbox{\textwidth-1ex}{%
\setlist[1]{itemsep=-2pt}
\begin{itemize}
\item[]
\item[]Rigid-Body Motion
\item[] (\textit{c} to \textit{d})
\end{itemize}}
}
\begin{enumerate}
\item A change in size (extension or contraction)\tikzmark{S}
\item A change in shape (shear or distortion) \tikzmark{E}
\item A rigid-body translation\tikzmark{W}
\item A rigid-body rotation \tikzmark{N}
\end{enumerate}
\tikz[remember picture, overlay]{%
\node [shift={(1ex,.6ex)},text width=5.5cm,anchor=west] at ($(pic cs:S)!.5!(pic cs:E)$){\insm};}
\tikz[remember picture, overlay]{%
\node [shift={(1ex,.6ex)},text width=5.5cm,anchor=west] at ($(pic cs:W)!.5!(pic cs:N)$){\wnsm};}
\end{document}

\tikzcommands. You may also need to put them before the end of theenumerateenvironment. The point is you need them to be processed before the page is shipped out. – cfr Mar 19 '16 at 14:03