Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

There’s a space added after my environment

You’ve written your own environment env, and it works except that a space appears at the start of the first line of typeset text after \end{env}. This doesn’t happen with similar LaTeX-supplied environments.

You could impose the restriction that your users always put a “%” sign after the environment … but LaTeX environments don’t require that, either.

The LaTeX environments’ “secret” is an internal flag which causes the unwanted spaces to be ignored. Fortunately, you don’t have to use the internal form: since 1996, LaTeX has had a user command \ignorespacesafterend, which sets the internal flag.


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=spaftend

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.27, released on 2013-06-07.