When we are writing code, editors will usually make an local indent for a logic block (shift rightwards uniformly in this block), for example, if...else..., or for (...){ }

However, I also want to apply this convention to mathematics note-writing (thus, the pdf form produced, not the about the .tex file) , for a clearer logic frame (like, a proof below a statement). Better, such local indent environment should be able to nest itself any times whenever we want to make a further local indent inside it.

"\begin / \end {itemize}" has already been able to indent itself, but I just don't want an itemize here.

Thank you in advance!

  • 1
    Welcome to the site. Does your question refer to indentation in the editing window (tex file), or on the paper document (i.e., PDF) produced by LaTeX? If the tex file, then it is a function of the editor you are using. If you are talking about a code listing in the output PDF, then it is a function of what environments you use to format the code. Commented Sep 26, 2018 at 18:12
  • Thank you! @StevenSegletes Sorry, I didn't illustrate. It's about the pdf.
    – Ruairi
    Commented Sep 26, 2018 at 18:17
  • So, are you looking for something like "pseudo code"? tex.stackexchange.com/search?q=pseudo+code Commented Sep 26, 2018 at 18:22
  • @StevenB.Segletes Well, I don't think so. I'll put another way. I hope to define a simple environment that behaves very much like 'itemize' in terms of its local indent effect ( but of course I don't need to enumerate anything here). Further, possibly, it able to change the text font also, so that the proof part in such a math note looks very distinguishable from the usual statement.
    – Ruairi
    Commented Sep 26, 2018 at 18:31
  • There are various indenting environments, such as quote and description, in addition to itemize and enumerate. With the enumitem package, you have great flexibility to structure the appearance and labels as you wish. If none of these suit you, one can fudge indenting environments with \leftskip and \rightskip. A picture of what you want would really help. Commented Sep 26, 2018 at 18:37

1 Answer 1


If you really need this, define your own special environment with the genral \list macro. Eg:

{\list{}{\rightmargin} \item\slshape\relax}{\endlist}

Here i have added \slshape as you said "able to change the text font also", but you obviously can adapt the formatting to your need.


You must log in to answer this question.

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