Given the quite long MWE:

\usepackage[thmmarks, amsmath]{ntheorem}

\nonzeroparskip             % Create space between paragraphs
\setlength{\parindent}{0pt} % Remove paragraph indentation
\setlength\columnsep{0pt}   % for multicol: still too much space in between

% From here:
% https://tex.stackexchange.com/questions/24101/theorem-decorations-that-stay-with-theorem-environment
\newcommand{\theoremhang}{% top theorem decoration
    \setlength{\unitlength}{.005\linewidth}% \linewidth/200
      \linethickness{0.45pt} \color{Black}%
      \put(-3,2){\line(1,0){206}}% Top line
      \multido{\iA=2+-1,\iB=50+-10}{5}{% Top hangs
        \put(-3,\iA){\line(0,-1){1}}% Top left hang
        \put(203,\iA){\line(0,-1){1}}% Top right hang

\newcommand{\theoremhung}{% bottom theorem decoration
    \setlength{\unitlength}{.005\linewidth}% \linewidth/200
      \linethickness{0.45pt} \color{Black}%
      \put(-3,0){\line(1,0){206}}% Bottom line
      \multido{\iA=0+1,\iB=50+-10}{5}{% Bottom hangs
        \put(-3,\iA){\line(0,1){1}}% Bottom left hang
        \put(203,\iA){\line(0,1){1}}% Bottom right hang





Code Env:

Test. Test. Test. Test. Test. Test.

Theorem Env:

Test. Test. Test. Test. Test. Test.

Multicol Code Env:



I get:

rendered output

Where I have two problems:

  1. The hang/hung bars do not have the same distance to text (In particular the space from end of theorem+listings to the hung below is too large. But there are also other problems: for example "Theorem Env:" to hung above)
  2. The multicol environment is not left aligned (may be caused by itemize which is needed to have the listings side-by-side)

I tried a lot with vspace hackery, but for at least at one of the places a problem persisted ;(

And is it possible to have the multicols/itemize in a self-defined environment to have everything more compact?

best regards, Markus

  • 2
    i believe that the multicol environment is left aligned, but the indentation of the code environment is a consequence of the fact that it's within an itemize environment. even though the \item label is absent. space is left for it at the beginning of the line.. Commented Sep 18, 2017 at 0:48
  • Thank you, yes I think so too. How can I avoid the itemize to indent? Most problems are in the vertical spacing. (For example, Theorem to hung is too close). Btw. the itemize is necessary so that the code blocks are side-by-side.
    – markus23
    Commented Sep 18, 2017 at 9:57
  • the only straightforward way i can think of to avoid the item indent is to get out of itemize. one of the list-enhancement packages, i've forgotten which, has a "resule" facility that allows one to continue numbering in an enumerate environment, but you wouldn't even need that with itemize since there's nothing you need to keep track of. just exit from itemize and go back in after the code block. Commented Sep 18, 2017 at 12:29
  • Do you mean that I just put \begin{itemize}\item[]\end{itemize} within the two code envs? Or is there a way to define column breaks in multicol without any itemize?
    – markus23
    Commented Sep 18, 2017 at 12:49
  • 1
    there is a command \columnbreak that you can use to break after the code on the left. maybe even \par would work. Commented Sep 18, 2017 at 12:55

1 Answer 1


A partial solution is to have vspace within


Initially I tried to add the vspace to theoremspuce, where it did not work.

You must log in to answer this question.

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