GeneralExtra line breaks when inserting environment

General information and discussion about TeXnicCenter
Post Reply
schweinhundert
Posts: 5
Joined: Thu Sep 12, 2013 8:01 am

Extra line breaks when inserting environment

Post by schweinhundert »

I may be being dense, and I have searched but didn't find the answer. I used version 1 of Texniccenter extensively in the past. I've now upgraded to the most recent version, and am having a peculiar (to me) problem. If I'm writing a document in the editor, I will include an equation like this:

Code: Select all

Lorem ipsem
\begin{equation}
  e^{i \pi} + 1 = 0
\end{equation}
It's logical that there's no empty line between "lorem ipsem" and "\begin{equation}" because the equation environment is part of the paragraph. So far so good, but when I insert an equation in TexnicCenter now (via a keyboard shortcut that I set up), when my cursor is just after "ipsem" I get, instead

Code: Select all

Lorem ipsem

\begin{equation}

\end{equation}

That is, the program is automatically putting an empty line (two line breaks) before and after the environment, which I must then go delete. I checked the math.xml definition for this:

Code: Select all

<lxEnvironment name="equation" 
		parameters="1" 
		desc="Math environment"
		icon="math.bmp"
		index="10"
		expafter="}

\label{eq:}
\end{equation}" 
		expbefore="\begin{"/>
which must only apply to the autocomplete, not the insertion of an environment via a shortcut key or the Insert menu. How can I stop these extra line breaks from happening? As a workaround, I tried defining an "Own Text Module", but I see no obvious way to assign a keyboard shortcut to that.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Tino Weinkauf
Posts: 25
Joined: Sat Aug 09, 2008 6:00 pm

Re: Extra line breaks when inserting environment

Post by Tino Weinkauf »

You cannot change that for the menu commands.

You can change it in the XML, which only applies to the autocompletion.

I will look into the issue. Would be best, if you filed a user report.
TeXnicCenter Maintainer
http://www.texniccenter.org/
Tino Weinkauf
Posts: 25
Joined: Sat Aug 09, 2008 6:00 pm

Re: Extra line breaks when inserting environment

Post by Tino Weinkauf »

I found it and will take care of it tonight. Expect it to be fixed with the next release.
TeXnicCenter Maintainer
http://www.texniccenter.org/
schweinhundert
Posts: 5
Joined: Thu Sep 12, 2013 8:01 am

Re: Extra line breaks when inserting environment

Post by schweinhundert »

Thanks!
Post Reply