Feature Suggestions ⇒ Add self-defined commands to the auto-complete list
-
- Posts: 25
- Joined: Tue Sep 16, 2008 6:05 am
Add self-defined commands to the auto-complete list
I would like that new command to show up in the auto-complete list.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 27
- Joined: Wed Jan 17, 2007 12:35 pm
Add self-defined commands to the auto-complete list
It is stored in XML format. This is for example what I have added for AMSMath's align environment (it autocompletes upon typing "align"):
Code: Select all
<lxEnvironment name="align"expafter="}\label{eq:}\end{align}"expbefore="\begin{"/>
I hope this helps and solves this problem
-
- Posts: 25
- Joined: Tue Sep 16, 2008 6:05 am
Re: Add self-defined commands to the auto-complete list
Of course, I will probably lose my changes to that file if I install a new version of TeXnicCenter....so it would be nice if there is a 'user-file' (for 1 user? for all users? Both?) to which we can add these kinds of commands....maybe even via a GUI

Re: Add self-defined commands to the auto-complete list
Thanks!
-
- Posts: 27
- Joined: Wed Jan 17, 2007 12:35 pm
Re: Add self-defined commands to the auto-complete list
Yes, I agree with this. These files should maybe rather somewhere to "Documents and Settings" folder. However, for now I always make a backup of these files on installation directory, and when I install new version I simply copy those files from backup. It works ok.
@dba
I believe you're searching for a command CTRL+SPACE. But you have to know, what when you want to "autocomplete" the environment, you have to write "equ", and than press CTRL+SPACE. Rather than typing "\begin{equ" and pressing CTRL+SPACE. Once you get used to this, you realize that this is really good.
-
- Posts: 1
- Joined: Tue Mar 24, 2009 4:52 pm
Re: Add self-defined commands to the auto-complete list
You just create your own file with the extention "xml" in the folder (C:\Program Files\TeXnicCenter\packages" in my case). TXC scans the folder for xml-files and will use all autocompletions in the program.
I have attached afile that adds fixme autocompletion to TXC.
- Attachments
-
- Fixme.xml
- Autocompletion for the fixme package
- (622 Bytes) Downloaded 2137 times
-
- Posts: 1
- Joined: Mon May 04, 2009 11:07 am
Add self-defined commands to the auto-complete list
I did successfully as wellYes, I agree with this. These files should maybe rather somewhere to "Documents and Settings" folder. However, for now I always make a backup of these files on installation directory, and when I install new version I simply copy those files from backup. It works ok.

pret auto
Re: Add self-defined commands to the auto-complete list
a) replace the original TeX.xml file at each TXC installation
b) creating a new file (for example My_Tex.xml) with my own commands
I liked the second best and tried it.
However, one should notice that the commands cannot have the same name as in TeX.xml. For example, if Tex.xml has
<lxEnvironment name="figure"
then your command should not be named figure. This created me the following problem, if I change it in My_Tex.xml to
<lxEnvironment name="myfigure"
I end up with a:
\begin{myfigure}[htbp]
...
\end{figure}
because TXC cannot delete that I typed myfigure, and it only creates text before and after what I typed.
So, my conclusion at this moment is that the best is solution a).