Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to be able to put an mdframed object inside of an outline environment without it being indented to the indentation level that I'm at, and so that I can continue the outline after the mdframed like below:

    I. text text text
         A. text text text
    __________________________
    |                         |
    |  MD FRAMED STUFF        |
    |                         |
    |                         |
    |_________________________|
         B. text text text 

Below is the code that I'm trying to use, but I can't get back to level \2 after level \0. I've tried adding the leftmargin =-1.75cm and that will move the mdframed over, but I have to guess at the amount by which to move it over (ie, -1.75 cm or -1.7cm or ...) and then if I add more to my outline, it is a less than ideal strategy. Please help!

\documentclass[11pt]{article}

\usepackage{enumerate}
\usepackage{outlines}
\usepackage{enumitem}
\setenumerate[1]{label=\Roman*.}
\setenumerate[2]{label=\Alph*.}
\setenumerate[3]{label=\arabic*.}
\setenumerate[4]{label=\alph*.}

\usepackage{mdframed}

\title{Notes}
\author{}
\date{}

\begin{document}
\maketitle

\begin{outline}[enumerate]
    \1 text text text 
             \2 text text text 
\0
\begin{mdframed}[frametitle=MD FRAMED STUFF:]
MD FRAMED STUFF
\end{mdframed}
             \2 text text text
\end{outline}

\end{document}

At this site, in section 1.4 they seem to be doing something like what I'm interested in, but I don't understand what each part means, and if I could just adjust set those items for the area I want the mdframed, and not the entire paper. http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/outlines/outlines.pdf

share|improve this question

2 Answers 2

up vote 5 down vote accepted

No sledgehammers: the amount of indentation in a list is stored in \@totalleftmargin.

\documentclass[11pt]{article}
\usepackage[pass,showframe]{geometry} % just for the example

\usepackage{enumerate}
\usepackage{outlines}
\usepackage{enumitem}
\setenumerate[1]{label=\Roman*.}
\setenumerate[2]{label=\Alph*.}
\setenumerate[3]{label=\arabic*.}
\setenumerate[4]{label=\alph*.}

\usepackage{mdframed}

\usepackage{color}
\mdfsetup{linecolor=red} % just for the example

\begin{document}

\begin{outline}[enumerate]
    \1 text text text 
             \2 text text text 
\begin{mdframed}[
  frametitle=MD FRAMED STUFF:,
  leftmargin=-\csname @totalleftmargin\endcsname % the devious trick
]
MD FRAMED STUFF
\end{mdframed}
             \2 text text text
\end{outline}

\end{document}

Adjust the vertical spacing with skipabove and skipbelow.

enter image description here

share|improve this answer
    
This is absolutely wonderful, as I can set it as a default for all the mdframed sections in my document. Thanks!!! –  ruya Feb 10 '13 at 0:30

LaTeX lists are based on \parshape. If you don't mind bashing a sledgehammer through all the latex interfaces you can just zero out the parshape locally: enter image description here

\documentclass[11pt]{article}

\usepackage{enumerate}
\usepackage{outlines}
\usepackage{enumitem}
\setenumerate[1]{label=\Roman*.}
\setenumerate[2]{label=\Alph*.}
\setenumerate[3]{label=\arabic*.}
\setenumerate[4]{label=\alph*.}

\usepackage{mdframed}

\title{Notes}
\author{}
\date{}

\begin{document}
\maketitle
\makeatletter
\begin{outline}[enumerate]
    \1 text text text 
             \2 text text text 
\par{\parshape0 \linewidth\textwidth
\begin{mdframed}[frametitle=MD FRAMED STUFF:]
MD FRAMED STUFF
\end{mdframed}
\par
}
             \2 text text text
\end{outline}

\end{document}
share|improve this answer
    
Why, thanks! I don't mind at all :-P Maybe I should? –  ruya Feb 8 '13 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.