Currently, the environment templates, e.g. equ then tab, insert the environment on the current line, if the cursor is at the beginning of the line; and first create a new line and then insert the environment if the cursor is at a line, where things have been typed before, i.e. the cursor is not at the beginning of the line.
This behavior is mostly great, because the begin{equation} should have its own line and not be at the end of some line. A problem arises, when there is only whitespace on the current line before the cursor. In this case, the begin{equation} should be inserted in the same line, since the line is empty modulo whitespace.
But instead - I assume because the cursor is not at the beginning of the line, since there is whitespace before it - a new line gets inserted, creating a completely empty line between the text before and the begin{equation}.
This empty line is a problem, because Latex then interprets this as a new paragraph and inserts extra space between the text and the environment, e.g. the equation. (Also for aesthetic- and clarity-reasons in the .tex file, but those are secondary.)
This problem gets enhanced, because Auctex creates these whitespaces automatically, when creating a new line in the .tex file inside an environment.
Currently, the environment templates, e.g.
equthentab, insert the environment on the current line, if the cursor is at the beginning of the line; and first create a new line and then insert the environment if the cursor is at a line, where things have been typed before, i.e. the cursor is not at the beginning of the line.This behavior is mostly great, because the
begin{equation}should have its own line and not be at the end of some line. A problem arises, when there is only whitespace on the current line before the cursor. In this case, thebegin{equation}should be inserted in the same line, since the line is empty modulo whitespace.But instead - I assume because the cursor is not at the beginning of the line, since there is whitespace before it - a new line gets inserted, creating a completely empty line between the text before and the
begin{equation}.This empty line is a problem, because Latex then interprets this as a new paragraph and inserts extra space between the text and the environment, e.g. the equation. (Also for aesthetic- and clarity-reasons in the .tex file, but those are secondary.)
This problem gets enhanced, because Auctex creates these whitespaces automatically, when creating a new line in the .tex file inside an environment.