TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Based on the answer of Markus Scharrer, I am using the custom lstnewenvironment to get code and Section with my environment. Since I use an environment in an environment (I know it may not be the best approach, but I have to do it like this) I am not able to set the indentation of my list..

Here's my MWE:



     {Return value:
     \begin{itemize}[labelindent=\parindent, leftmargin=*, labelsep=0.5cm,itemsep=0.8pt]}

  \newcommand{\returnvalue}[2] %Name, Description
     {\item #1: #2}

which I am using like this:

  \begin{method}{SaveDocument}{Description of the Method \\
  \returnvalue{True}{Saved successfully.}
  Method Boolean SaveDocument()

Any idea why my list is not indented like I customized? I could change leftmargin to anything with no influence..

share|improve this question
This reminds me of a bug in listings that fails to set \if@nobreak to false. – egreg Jul 2 '13 at 21:01
and how can I fix it? – Kathiieee Jul 3 '13 at 6:52
@egreg: I don't think it's related to your hint. I think the calculation of the width fails. I tried the following \fbox{\vbox{\MethodDescription}} and it looks really odd. – Marco Daniel Jul 3 '13 at 19:27

Your Answer


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

Browse other questions tagged or ask your own question.