I've been working on environment based on framed package, but wanted to port to mdframed due to fact that it plays better with footnotes and has more features and more active development. The issue is that I do not know mdframed internals or how to create more advanced styles with it. Also, I found the manual lacking in description on how to create advanced styles.

Is there any porting guide/reference for conversion of framed environments to mdframed environments? Or maybe at least ideas for converting this specific environment?

The environment in question is placing a line and one or two of 6 icons on margin. It has separate version for line and set of icons for odd, onepage and even situations, also separate icon sets for frames that fit on page, start of longer frames, middle frames and final frames. Frames could look like this:

icon | ......
     |               ( on this even page, line is placed on left
     |                 and icon on top, because it is start of frame)
     | ......
  ~ page break
       ...... |
              |      ( on this odd page, line is placed on right
              |icon    and icon in middle, because it's internal frame)
       ...... |
  ~ page break
     | ......        ( and here it's on left again,
icon | ......          while ending icon is at bottom of frame)

or differently depending on how they lay out on pages. I got this working like I want. The relevant code looks a little like this (you can skip the %config block, but I placed it for for code to be complete and working) with lines and icons replaced by simpler versions:


% config
\newcommand\decorleft[1]{\vrule height #1 width 0.5pt\hspace{1mm}}
\newcommand\decorright[1]{\hspace{1mm}\vrule height #1 width 0.5pt}

% \mirrorframe{left content}{right content}{minimum height}{content}
\advance\dimen2 by -0.5\dimen0%
\def\1{\llap{\vbox to \dimen0{#1}\decorleft{\dimen0}}\0}%
\def\2{\0\rlap{\decorright{\dimen0}\vbox to \dimen0{#2}}}%

% \begin{mirrortest}[minimum height] ... \end{mirrortest}
\MakeFramed{\advance\hsize-\width \FrameRestore}\ignorespaces}{\endMakeFramed}

I use it like this:


The mdframed package internals seems to be a lot more complicated, that's why I don't know yet how to approach the conversion. Any help/directions would be appreciated!

closed as too localized by Marco Daniel, Joseph Wright Sep 21 '12 at 7:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome! First time I hear the documentation is lacking ;-). However the package doesn't support the odd/even combination of lines. I think this can be redefine very simple. A small question: Why do you want to switch? Which framemethod do you use? – Marco Daniel Jul 24 '12 at 17:54
  • I do not use mdframed yet, so I don't use any framemethod yet. Looking at docs, I will probably use TikZ framemethod, because my icons are in TikZ anyway. I tried working with \newmdenv, but I do not know where to plug my own definition of commands equivalent to \FirstFrameCommand, \MidFrameCommand, etc. This is true, that docs for package framed are even shorter, but it's code is just more compact so I was able to "read it all" in relatively short time. – Andrzej Giniewicz Jul 24 '12 at 18:08
  • Now that I think about it, is single/first/...extra what I am looking here for? – Andrzej Giniewicz Jul 24 '12 at 18:15
  • You are right. All frame methods use the command \mdf@putbox@first, \mdf@putbox@middle and \mdf@putbox@second to draw the relevant part (see attachment of documentation). Have a closer look to the command \mdf@@setzref which test odd and even pages. You can setup the environment with hidealllines=true,leftline=true and after this expand the command with \mdfsetup{leftline=true} or \mdfsetup{rightline=true} related to odd and even pages. – Marco Daniel Jul 24 '12 at 18:22
  • With no further info, this looks 'too localized'. – Joseph Wright Sep 21 '12 at 7:21

Browse other questions tagged or ask your own question.