I want to make the output same as what I can make from the code shown below. But for some reasons (e.g. some frames extend to multiple pages etc.), I do not want to use ascmac package but mdframed package. What should I write in the preamble or the option of mdframed environment?

Sorry for my bad English.

  • Welcome to TeX.SE. Thanks for providing a MWE, but unfortunately it doesn't compile for me. I get Undefined control sequence. \@itembox ...\@savetbaselineshift \tbaselineshift \tbaselineshift \z@ \par \... l.4 \begin{itembox}[l]{foo}, so I don't know the desired output. – Peter Grill Jun 13 '14 at 5:07
  • @PeterGrill It seems that the ascmac in texlive 2013 produces this error. The texlive version seems to rather out of date and may be requires the obsolete platex – Andrew Swann Jun 13 '14 at 7:01

Here is one approach, updated as per your comments. To get round boxes you need to pass the tikz option to mdframed. The title is raised so it hits the bounding box. As we are using tikz anyway, I have put the title in a box that is a tikz node with a white background, to overwrite the rule. We use innertopmargin to move the contents up correspondingly, and adjust innerbottomargin.

To move this title further right, one option is to make the tikz picture a little wider with an invisible extra point, for example via

frametitle={\tikz{\path (0,0) (20pt,0) node[anchor=base west,rectangle,fill=white] {\strut #1};}}

This will put the title box with its left edge 20pt further to the right. Putting it all together we get:

Sample output



  frametitle={\tikz{\node[anchor=base,rectangle,fill=white] {\strut #1};}}]

\usepackage{lipsum} %for dummy text



\begin{itembox}{Longer title}


See the mdframed documentation or texdoc mdframed for more parameters to adjust the spacing.

  • Thank you for your answer. This is almost exactly what I want, but I want to move the frame title a little to the right. What parameter should I change? – Merzong Jun 13 '14 at 11:26
  • @Merzong I have updated my answer with this. – Andrew Swann Jun 13 '14 at 18:36
  • Thank you for the update. However, in this way, only the frame title moves upward. There is a white space between the title and the content in the frame. In order to remove this, I wrote innertopmargin=5pt-\baselineskip in the preamble but it didn't work. How can I remove this white space and move the content upward? – Merzong Jun 15 '14 at 5:15
  • @Merzong See my updated answer. – Andrew Swann Jun 15 '14 at 11:29
  • This is the error that I've found "\DeclareListParser*{\mdf@dolist}{". What version of mdframed package? – jeecabz Nov 20 '14 at 11:36

Your Answer

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

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