You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Hi, I am finally looking at that and can reproduce it. Easy to fix, in principle. However, cdlatex always inserts environments unindented. So if I simply no longer insert a newline, then the result might look like this:
\begin{equation}
\label{...}
\end{equation}
i.e. with the first line indented, but the others not. Should I remove the white space at before the cursor?
This is not perfect, (ideally cdlatex would detect the indent and act accordingly) but I personally think it is an okay fix and better than the behaviour right now, so you should remove it.
I have pushed a fix that does also keep the indentation. May I ask you to test it, Sinthoras, and report back? I have not yet changed the version number, so this will not yet move up into the package system.
Hey, I tested it, and it seems to not have worked. It seems to have the same behaviour as before the fix.
I am not entirely, but like 85% sure, that I have the version currently in the repository including the newest commit installed.
Currently, the environment templates, e.g.
equ
thentab
, 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.
The text was updated successfully, but these errors were encountered: