Hi,
i am somewhat new to latex, but i have noticed that the autocomplete for tables and figures is wrong. I believe that the caption should go before the label. anyone know how i can change this? meaning the autocomplete, not re-writing it?
General ⇒ Texnic Center auto complete figures WRONG
-
- Posts: 1
- Joined: Tue Apr 17, 2007 10:58 am
Re: Texnic Center auto complete figures WRONG
Edit the file "%TeXnicCenter_path%\packages\TeX.xml"
Find the XML tag "lxEnvironment" with 'name="table"' and edit "expafter" just as you like.
In my case the "figure" looks like this:
---
<lxEnvironment name="figure"
parameters="1"
desc="Provides a figure environment"
icon="format.bmp"
index="9"
expafter="}
\centering
\includegraphics[width=]{}
\caption{}
\label{fig:}
\end{figure}"
expbefore="\begin{"/>
---
Things I've changed:
\centering (all my figures should be centered)
[width=] (too lazy to break my fingers each time on my German keyboard)
\label{fig:} (the "fig:" is new)
swapped \caption{} and \label{} (as you suggested)
While you are at it, change "itemization" to "itemize":
<lxEnvironment name="itemize"
parameters="0"
desc="Defines an environment for an itemization"
icon="format.bmp"
index="7"
expafter="}
\item
\end{itemize}"
expbefore="\begin{"/>
BTW: If your TeXnicCenter crashes with a strange message at startup, make sure your changes to the TeX.xml produce a valid XML file.
Make sure you restart TeXnicCenter to the changes.
Hope that helps,
Marcus
Find the XML tag "lxEnvironment" with 'name="table"' and edit "expafter" just as you like.
In my case the "figure" looks like this:
---
<lxEnvironment name="figure"
parameters="1"
desc="Provides a figure environment"
icon="format.bmp"
index="9"
expafter="}
\centering
\includegraphics[width=]{}
\caption{}
\label{fig:}
\end{figure}"
expbefore="\begin{"/>
---
Things I've changed:
\centering (all my figures should be centered)
[width=] (too lazy to break my fingers each time on my German keyboard)
\label{fig:} (the "fig:" is new)
swapped \caption{} and \label{} (as you suggested)
While you are at it, change "itemization" to "itemize":
<lxEnvironment name="itemize"
parameters="0"
desc="Defines an environment for an itemization"
icon="format.bmp"
index="7"
expafter="}
\item
\end{itemize}"
expbefore="\begin{"/>
BTW: If your TeXnicCenter crashes with a strange message at startup, make sure your changes to the TeX.xml produce a valid XML file.
Make sure you restart TeXnicCenter to the changes.
Hope that helps,
Marcus
Re: Texnic Center auto complete figures WRONG
absolutely fantastic! works great! funny, i was looking around on my own and found the same file and section, problem was that i did not see the "label" because it was on the same line as caption. i had quickly dismissed the file then. Anyway thanks a lot, now texniccenter is my favorite editor.