3

Sometimes my LaTeX document gets long and messy, and so it's hard for me to look through and find what I want. When I program, I usually have a macro in my IDE that creates a separator of comments to keep the code clean. I'm looking for something similar in TeXnicCenter. So it would insert the following

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

Or something to that effect. Now if TeXnicCenter doesn't have the capability of making macros like this, is there a way I could take advantage of the autocomplete system to do this? So I would add a custom command to the TeXnicCenter LaTeX XML files so that it would autocomplete with the percent signs. Does anyone know how to do this?

1 Answer 1

7

TeXnicCenter allows for the creation of "user text modules" that are initiated via a shortcut. To insert your own module, follow Insert>Own Text Modules>Manage Text Modules. Now you can enter a new one called (say) Separator:

Entering a new user text module in TeXnicCenter

Once you've established the correct "before cursor" and "after cursor" combination, it is accessible via the menu selection:

User text module accessible via menu

Or via the shortcut Alt+I+M+7 (in my case).

4
  • Is there anyway to make this shortcut shorter and more intuitive? Right now if I add another text module, I might need to reorder the modules and so change the shortcuts. Commented Nov 11, 2013 at 4:59
  • 1
    @JessRiedel: You could create your own hot keys via AutoHotkey. Commented Nov 11, 2013 at 5:15
  • When you create these modules, where are they saved? How can I copy them to use on another computer or to share with someone else? Commented Jan 15, 2020 at 2:21
  • @A.Ellett: It's stored in the system registry. The TeXnicCenter source code - TextModules.cpp - led me to that find. Here's a view of the Separator entry within the registry: Registry. There doesn't seem to be an easy way to capture the content and port it to a new location. Commented Jan 15, 2020 at 5:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.