2 of 4
added 3508 characters in body
Qrrbrbirlbel
  • 85.5k
  • 6
  • 213
  • 359

Update

I guess one could produce page-breaking real braces, where the lengths of the parts on each page is calculated and this length is added to the current page y value to draw outside of the paper. (Drawing two braces with their full lengths, but only a part of them is on the paper.)

Code

\documentclass{article}
\newcounter{tikzmarkbracecounter}
\usepackage{tikz}
\usetikzlibrary{calc,arrows}
\tikzset{
    mymarginbrace/.style={
        thick,
        rounded corners=10pt
    }
}
\newcommand*{\tikzbracemargindistance}{11em} % probably should be some \marginwidth stuff
\newcommand*{\tikzbraceleveldistance}{.5em}
\newcommand*{\tikzbracestartheight}{2ex}
\newcommand*{\tikzbraceendheight}{\baselineskip-.5ex} % \tikzmark lands in the following par so we cheat ;)
\newcommand*{\tikzbracestartlength}{1.5em}

\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture] \coordinate[#1] (#2) at (#3);}
\newcommand{\tikzstart}[4][]{% % #1 = brace line, #2 = level, #3 = node argment, #4 = node text
    \stepcounter{tikzmarkbracecounter}%
    \tikzmark{bracestart-\thetikzmarkbracecounter}{perpendicular cs: horizontal line through={(0,\tikzbracestartheight)}, vertical line through={($(current page.south west)+(\tikzbracemargindistance-#2*\tikzbraceleveldistance,0pt)$)}}
    \tikzmark{bracestartpage-\thetikzmarkbracecounter}{perpendicular cs: horizontal line through={(current page.south)}, vertical line through={(bracestart-\thetikzmarkbracecounter)}}%
    \tikz[overlay,remember picture] {
        \draw[mymarginbrace,#1]
            ($(bracestart-\thetikzmarkbracecounter)+(\tikzbracestartlength+#2*\tikzbraceleveldistance,0)$)
         -- (bracestart-\thetikzmarkbracecounter)
         -- node[swap,#3] {#4} (bracestartpage-\thetikzmarkbracecounter);
        }%
}
\newcommand{\tikzthrough}[4][]{% #1 = brace line, #2 = level, #3 = node argment, #4 = node text
    \tikz[overlay, remember picture]{
        \draw[mymarginbrace,#1]
            ($(current page.north west)+(\tikzbracemargindistance-#2*\tikzbraceleveldistance,0pt)$)
         -- node[swap,#3] {#4} ($(current page.south west)+(\tikzbracemargindistance-#2*\tikzbraceleveldistance,0pt)$);
    }
}
\newcommand{\tikzend}[4][]{% #1 = brace line, #2 = level, #3 = node argment, #4 = node text
    \stepcounter{tikzmarkbracecounter}%
    \tikzmark{braceend-\thetikzmarkbracecounter}{perpendicular cs: horizontal line through={(0,\tikzbraceendheight)}, vertical line through={($(current page.north west)+(\tikzbracemargindistance-#2*\tikzbraceleveldistance,0pt)$)}}
    \tikzmark{braceendpage-\thetikzmarkbracecounter}{perpendicular cs: horizontal line through={(current page.north)}, vertical line through={(braceend-\thetikzmarkbracecounter)}}%
    \tikz[overlay,remember picture] {
        \draw[mymarginbrace,#1]
            ($(braceend-\thetikzmarkbracecounter)+(\tikzbracestartlength+#2*\tikzbraceleveldistance,0)$)
         -- (braceend-\thetikzmarkbracecounter)
         -- node[#3] {#4} (braceendpage-\thetikzmarkbracecounter);
        }%
}
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]
\tikzstart[blue]{0}{auto}{Whee!}
\lipsum[5-6]
\tikzend[blue]{0}{auto}{Here we are!}
\lipsum[7-9]
\tikzstart{2}{auto}{Again \ldots}
\lipsum[10-11]
\tikzthrough{2}{auto,text width=5em,align=center}{\ldots the whole page \ldots}
\tikzstart{0}{sloped,below,rotate=180}{Inner Brace!}
\lipsum[12]
\lipsum[13-17]
\tikzend{0}{}{}
\tikzend{2}{auto}{\ldots end}
\end{document}

Output

None. (Compile a few times for yourself.)

First draft

I have something of the following in mind [no MWE :( and I haven't looked at your linked question].

Problem with braces will be to calculate the middle where that “nipple” part is.

Code

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,arrows}

\newcommand{\tikzmark}[3][]{\tikz[overlay,remember picture] \node[#1] (#2) at (#3) {};}
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]
\tikzmark{up}{$(0,0)+(-2em,0)$}
\tikzmark{pageup}{$(current page.south west)+(4em,0em)$}
\tikz[overlay,remember picture] \draw[very thick] (up) to[out=180,in=95] node [sloped,midway,above] {Where do we go?} (pageup);
\lipsum[5-6]
\tikzmark{down}{$(0,0)+(-2em,0)$}
\tikzmark{pagedown}{$(current page.north west)+(4em,0em)$}
\tikz[overlay,remember picture] \draw[-latex,very thick] (pagedown) to[out=-85,in=180] node [above,sloped,pos=.8] {Whee!} (down);
\lipsum[7-9]
\end{document}

Output

enter image description here

Qrrbrbirlbel
  • 85.5k
  • 6
  • 213
  • 359