Command Line Arguments

TeXnicCenter supports the following command line syntax:

Important:

TEXCNTR filename
Start up and open the specified file.
If the file is a project file, the project will be opened, otherwise the file will be opened in the editor.
TEXCNTR /l linenumber filename
Start up and open the specified file in the editor and place the cursor at the specified line.
TEXCNTR /p file
Prints the specified file to the default printer.
TEXCNTR /pt filename printer driver port
Prints the specified file to the specified printer.
TEXCNTR /dde
Start up and await a DDE command
TEXCNTR /ddecmd "DDE-commands"
If there is already a running instance of TeXnicCenter, then forward the specified DDE commands to this instance, otherwise start up and execute the given DDE-commands.
TEXCNTR /nosplash
Start TeXnicCenter without displaying the splash screen.

Open a file in TeXnicCenter using another application or the command line

The DVI-viewer YAP, shipped together with the MikTeX distribution supports a feature called "inverse search". If a DVI file opened in the viewer has been generated using source specials, you can double click on a paragraph in the viewer and the viewer places the cursor in your favorite LaTeX editor at the line in the LaTeX source, the given paragraph has been generated from.

To do so, your favorite LaTeX editor has to support the feature to go to a line and a source file, specified on the command line.

TeXnicCenter supports these features with the command line arguments listed here.

Multiple Instance Support

If you specify the command line

TECNTR /l linenumber filename

in the inverse search settings of your viewer, each time you perform an inverse search, a new instance of TeXnicCenter will be started and the new instance will open the specified file and place the cursor at the specified line.

Single Instance Support

If you would like to run only one instance of TeXnicCenter (and this is what makes sense most) you can specify the following command line in your viewers inverse search settings:

TEXCNTR /ddecmd "[goto('filename', 'linenumber')]"

If you perform an inverse search now, the system will check, if there is already a running instance of TeXnicCenter. In this case the specified DDE command will be send to this running instance, which will open the specified file and place the cursor at the specified line. If there is no running instance, a new instance will be started and this new instance will open the specified file at the specified line.