TeXnicCenter: Difference between revisions
wikademia>El floz restructured the document a bit to facilitate readability and added a more sophisticated approach to forward searching, that does not require the full version of acrobat. |
wikademia>El floz m changed the heading levels to a more senseful hierarchy |
||
| Line 11: | Line 11: | ||
Integration is setup in the ''Build'' → ''Define Output Profiles'' menu option. Select a profile "LaTeX=>PDF" or "LaTeX=>PS=>PDF", and click on the viewer window. | Integration is setup in the ''Build'' → ''Define Output Profiles'' menu option. Select a profile "LaTeX=>PDF" or "LaTeX=>PS=>PDF", and click on the viewer window. | ||
===Without forward search=== | |||
To simply (re)open the document in the Acrobat Reader, use : | To simply (re)open the document in the Acrobat Reader, use : | ||
view project's output: | view project's output: | ||
| Line 31: | Line 31: | ||
topic: control | topic: control | ||
===Manual forward search=== | |||
Alternatively, the following command can be used for "view project's output" and "forward search". It opens the pdf-document on page <pageno>+1: | Alternatively, the following command can be used for "view project's output" and "forward search". It opens the pdf-document on page <pageno>+1: | ||
command: [DocOpen("%bm.pdf")][DocGoTo("%bm.pdf",<pageno>)] | command: [DocOpen("%bm.pdf")][DocGoTo("%bm.pdf",<pageno>)] | ||
===Semi-automatic forward search=== | |||
An much more useful solution would be to use the [http://www.tug.org/applications/hyperref/manual.html <tt>hyperref</tt> package]: | An much more useful solution would be to use the [http://www.tug.org/applications/hyperref/manual.html <tt>hyperref</tt> package]: | ||
| Line 49: | Line 49: | ||
Note that steps 1. and 2. have to be done in the header of your document. If you use pdfTeX, you should load the <tt>hyperref</tt> package via <tt>\usepackage[pdftex]{hyperref}</tt>; if you use dvips, load it using <tt>\usepackage[dvips]{hyperref}</tt>. If several <tt>\acrobat</tt> commands are issued, the reader always jumps to the "latest" one. | Note that steps 1. and 2. have to be done in the header of your document. If you use pdfTeX, you should load the <tt>hyperref</tt> package via <tt>\usepackage[pdftex]{hyperref}</tt>; if you use dvips, load it using <tt>\usepackage[dvips]{hyperref}</tt>. If several <tt>\acrobat</tt> commands are issued, the reader always jumps to the "latest" one. | ||
===Open and jump back to previous position=== | |||
If you want Acrobat to reopen the file after a recompilation at the exact same location as it was just before, and ''if you have the full version of Acrobat'' (the following is ''not'' supported by the free Acrobat Reader!) set the "view project's output" and "forward search" DDE command to: | If you want Acrobat to reopen the file after a recompilation at the exact same location as it was just before, and ''if you have the full version of Acrobat'' (the following is ''not'' supported by the free Acrobat Reader!) set the "view project's output" and "forward search" DDE command to: | ||
command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][MenuitemExecute("GoBack")] | command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][MenuitemExecute("GoBack")] | ||
Revision as of 04:52, 2 July 2006
TeXnicCenter is a free open source program, IDE for LaTeX in Windows, using the MiKTeX or TeXLive distributions. It allows the user to type documents in LaTeX and to compile them in PDF, DVI or PS. A menu gives the possibility to access easily to precoded elements and environments (formulas, symbols, sections). It also makes possible to create projects to organise and access the sections and environments of your document and to insert a bibliography (using BibTeX) and an index (using MakeIndex).
To use TeXLive 2005 distribution you need to make a minor change to the output profiles ... replace each of the output argument options with their unix format variants (yes even for running on Windows) ... so that the command line arguments "%pm" becomes "%Pm" and "%bm" becomes "%Bm" etc.)
Acrobat integration
TeXnicCenter has the ability to integrate nicely with Adobe Acrobat, such that recently compiled PDF files are opened automatically, and existing open PDF files are closed automatically upon recompilation. This is done using DDE calls to Acrobat, documented in Acrobat Interapplication Communication Overview and Acrobat Interapplication Communication Reference
Integration setup
You can insert the following lines of command in TeXnicCenter to integrate it with Acrobat. This particularly enables you to compile your files in pdf without having to close the previous document first (necessary in the default option).
Integration is setup in the Build → Define Output Profiles menu option. Select a profile "LaTeX=>PDF" or "LaTeX=>PS=>PDF", and click on the viewer window.
Without forward search
To simply (re)open the document in the Acrobat Reader, use :
view project's output:
[x] DDE command
command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
server: acroview
topic: control
forward search:
[x] DDE command
command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
server: acroview
topic: control
Close document before running (La)TeX:
[x] DDE command
command: [DocClose("%bm.pdf")]
server: acroview
topic: control
Manual forward search
Alternatively, the following command can be used for "view project's output" and "forward search". It opens the pdf-document on page <pageno>+1:
command: [DocOpen("%bm.pdf")][DocGoTo("%bm.pdf",<pageno>)]
Semi-automatic forward search
An much more useful solution would be to use the hyperref package:
1. Make sure the hyperref package is loaded: \usepackage{hyperref}
2. Define the following command: \def\acrobat{\hyperdef{jump}{here}{}}
3. Change the "view project's output" and "forward search" DDE command (as described earlier on) to:
command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][DocGoToNameDest("%bm.pdf","jump.here")]
4. Use somewhere in the text (usually, where you are currently working…) the new command \acrobat and, after (re)opening, the reader should jump to that location.
Note that steps 1. and 2. have to be done in the header of your document. If you use pdfTeX, you should load the hyperref package via \usepackage[pdftex]{hyperref}; if you use dvips, load it using \usepackage[dvips]{hyperref}. If several \acrobat commands are issued, the reader always jumps to the "latest" one.
Open and jump back to previous position
If you want Acrobat to reopen the file after a recompilation at the exact same location as it was just before, and if you have the full version of Acrobat (the following is not supported by the free Acrobat Reader!) set the "view project's output" and "forward search" DDE command to:
command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][MenuitemExecute("GoBack")]
Note that Adobe Reader supports only the following DDE messages: AppExit, CloseAllDocs, DocClose, DocGoTo, DocGoToNameDest, DocOpen, FileOpen, FilePrint, FilePrintEx, FilePrintSilent, and FilePrintTo. In order to support the MenuitemExecute functionality, a full version of Adobe Acrobat is required.
External links
de:TeXnicCenter es:TeXnicCenter nl:TeXnicCenter pl:TeXnicCenter