4

I have no experience with creating latex environments, so I hope that someone would be so kind helping me trying to create a new text environment with a border and a vertical header to the right of the text area.

I've tried to depict it using my MS Paint skills:

image

Is there anyone who can help me create such an environment or give me some hints on how to do it? Any help will be much appreciated.

2

1 Answer 1

3

As I wrote in the comment I suggest the package mdframed. I am sure the packages framed or tcolorbox are also able to do this.

All listed options can be found in the documentation. I also recommend the example of the question mdframed-Put something on the start of one vertical left rule where I explain most of the following code.

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}%need for tikz let operation
\usepackage{kantlipsum}%filling text

\newmdenv[%
 skipabove=\topskip,%
 skipbelow=\topskip,%
 rightmargin=.5cm,%
 leftmargin=2cm, %
 middlelinewidth=2pt,%
 middlelinecolor=blue!70,%
 firstextra={\path[overlay]  let \p1=(P), \p2=(O) in ($(\x2,0)+1*(0,\y1)$) 
                           node[rotate=90,anchor=east,yshift=2em,font=\bfseries\large] {Short Header};},%
 singleextra={\path[overlay] let \p1=(P), \p2=(O) in ($(\x2,0)+1*(0,\y1)$) 
                           node[rotate=90,anchor=east,yshift=2em,font=\bfseries\large] {Short Header};},%
]{myframe}


\begin{document}
\kant[1]

\begin{myframe}
\kant[2]
\end{myframe}

\kant[3]


\end{document}

enter image description here

3
  • I've been trying to figure out how to add an option for changing the header in their digression-environment (Example 6 here: cloud.github.com/downloads/marcodaniel/mdframed/…), so you can use the package something like this: \begin{mdframed}[style=digressionarrows]{Header of the environment}. Do you know how to do that? :-) Commented May 3, 2012 at 10:19
  • @TommyJakobsen: Yes ;-). I recommend to ask a new question. I can't answer it know. If you ask in 2 hours again, I will be back. Commented May 3, 2012 at 14:54
  • Yes of course. Here it is :-) tex.stackexchange.com/questions/54754/… Commented May 7, 2012 at 9:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .