2

I'm trying to mark some paragraphs with boxes, braces, brackets or parentheses coupled with notes in margin… My first test was using \makebox & minipage according to this discussion as you can see here & after in my code: \accoladedroite & \crochetdroit commands. But, you know, it makes problems to split across pages.

So, I want to use \mdframed, better for this job. I'm now learning \mdframed & \tikz (my teachers are \mdframed manuals & exemples, & reference discussions with @Peter_Grill here & there and @Gonzalo_Medina here). My questions :

  • How to put a beautiful typographic curly brace all the distance of the box, like in musical score, for example \} in the innerline right of \mdframed ?
  • How to add some texte or title in front of the brace center, in margin ?
  • How to repeat these titles, why not, with dots in the first… - …middle… & …second box (see here) ?

Thats my code :

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = arara
\documentclass{scrbook}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\newmdenv[hidealllines=true,
    singleextra={
        \draw;
        \draw([xshift=-0.1cm]P) -- (P) -- (P|-O) -- ([xshift=-0.1cm]P|-O);},
    firstextra={
        \draw;
        \draw([xshift=-0.1cm]P) -- (P) -- (P|-O);},
    middleextra={
        \draw;
        \draw(P) -- (P|-O);},
    secondextra={
        \draw;
        \draw(P) -- (P|-O) -- ([xshift=-0.1cm]P|-O);},
    ]{mybox}

\newcommand\accoladedroite[3]
    {\par
    \smallskip
    \makebox[\textwidth][c]
        {$\left.
        \begin{minipage}{\textwidth}#3\end{minipage}
        \right\}
        \rotatebox[origin=c]{-90}{\color{gray}#2}
        \rotatebox[origin=c]{-90}{ }
        \rotatebox[origin=c]{-90}{#1}$}
    \par
    \smallskip}

\newcommand\crochetdroit[3]
    {\par
    \smallskip
    \makebox[\textwidth][c]
        {$\left.
        \begin{minipage}{\textwidth}#3\end{minipage}
        \right]
        \rotatebox[origin=c]{-90}{\color{gray}#2}
        \rotatebox[origin=c]{-90}{#1}$}
    \par
    \smallskip}

\begin{document}
\lipsum[1]
\accoladedroite{Titre 1}{Titre 1.1}{\lipsum[2]}
\crochetdroit{Titre 2}{Titre 2.1}{\lipsum[3]}
\begin{mybox}
\begin{mybox}
\lipsum[4]
\end{mybox}
\lipsum[5-7]
\end{mybox}
\end{document}
% arara: xelatex

And the result :

screenshot

Thank you for your help.

  • I don't see where you are using mdframed except for the fact that you load it so I'm not sure what problem you are experiencing in using it. – cfr Aug 25 '14 at 15:29
  • @cfr in my \newmdenv I presume… – Zouib Aug 26 '14 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.