A very powerful feature of TeXnicCenter are placeholders. They are used on occasions when values or commands need to be specified that will change dynamically during runtime. This feature allows the user a very flexible configuration of TeXnicCenter because command line arguments, DDE-commands or other values do not have to be specified statically, but will be dynamically generated by TeXnicCenter when needed.
Placeholders are a kind of variables. The user specifies the name of the variable and TeXnicCenter sets the variable's value dynamically by replacing its name with the current value, when needed.
There a two types of placeholders in TeXnicCenter:
Placeholders referring to single files are used in such cases, where arguments for command line tools (like LaTeX) and DDE-commands need to be defined.
Placeholders for single files have to begin with a percent sign % followed by up to three characters. The last character specifies which files the placeholder refers to:
The character before the last character describes how to reference the specified file:
The percent sign % can be followed by an :placeholder:`s`. In this case, the placeholders will be replaced with paths matching the old 8.3 path convention.
To get a percent sign in the resulting string you have to use the placeholder :placeholder:`%%` which will always be replaced by %.
The following placeholders are used as a reference to a project's main file. If the :menuselection:`Build --> Current File...` command is used, these placeholders will be replaced with the equivalents for the current file.
The examples in brackets show how the placeholder will be replaced, if the current project's main file is :file:`C:\\My Documents\\TxcTest\\JustATest.tex`.
The following placeholders are used to reference the current file. The current file is the file opened in the editor, i.e it has the input focus. If no file is open in the editor the placeholders will not be replaced.
The examples in brackets show how the placeholder will be replaced, if the current file is :file:`C:\\My Documents\\TxcTest\\SubDir\\AnotherTest.tex` and the current project's main file is :file:`C:\\My Documents\\TxcTest\\JustATest.tex`.
Placeholders can be used for handling sets of files.
These placeholders will never generate duplicates of a filename.
$Starts the placeholder. Use :placeholder:`$$` to get $.
qAll filenames will be separately quoted using ".
sAll filenames will be issued in 8.3-format.
fThe forward slash / is used as directory separator.
The filenames will be given relative to the working directory of the project.
One of the following:
Lists all (La)TeX-files reported by the structure parser of TeXnicCenter. File names in quotes and separated by a space, like:"D:\Temp\test\curvature3d.tex" "D:\Temp\test\definitions\macros.tex" "D:\Temp\test\chaptertwo.tex"
Lists all BibTeX-files reported by the structure parser of TeXnicCenter. The forward slash is used as directory separator. File names separated by a space, like:D:/Temp/test/xbib.bib D:/Temp/test/morebibs/morexbib.bib
Lists all files, which are currently opened in the editor. File names separated by a space (no quotes!), like:D:\Temp\test\curvature3d.tex D:\Program Files\texmf\pdftex\latex\config\pdflatex.ini
Lists all files of the project as reported by the structure parser of TeXnicCenter. File names displayed in 8.3-format, path relative to the working directory, file names separated by a space, like:"curvat~1.tcp" "curvat~1.tps" "curvat~1.tex" "xbib.bib" "morebibs\morexb~1.bib" "defini~1\macros.tex" "chapte~1.tex"
A good idea to use placeholders is a tool like the one defined below. This tool will build a ZIP archive of all files of the current project. A compression program (like WinZip or WinRAR) is required. Adjust path and arguments for that program.