Jump to content

TeXnicCenter: Difference between revisions

From IdeaWazaWiki
wikademia>Jinzishuai
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.
Line 8: Line 8:
===Integration setup===
===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).
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 :
 
  view project's output:  [v] DDE command.
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")]
  command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
  server: acroview
  server: acroview
  topic: control
  topic: control


  forward search: [v] DDE command.
  forward search:
[x] DDE command
  command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
  command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
  server: acroview
  server: acroview
  topic: control
  topic: control


  Close document before running (La)TeX: [v] DDE command
  Close document before running (La)TeX:
[x] DDE command
  command: [DocClose("%bm.pdf")]
  command: [DocClose("%bm.pdf")]
  server: acroview
  server: acroview
  topic: control
  topic: control


Alternatively, the following command can be used for "forward search", which opens the pdf-document on page <pageno>+1:
====Manual forward search====
forward search: [v] DDE command.
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>)]
server: acroview
topic: control


If you want Acrobat to reopen the file after a recompilation at the same location as it was just before, set:
====Semi-automatic forward search====
view project's output:  [v] DDE command.
An much more useful solution would be to use the [http://www.tug.org/applications/hyperref/manual.html <tt>hyperref</tt> package]:
  command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][MenuitemExecute("GoBack")]
 
server: acroview
1. Make sure the <tt>hyperref</tt> package is loaded: <tt>\usepackage{hyperref}</tt>
topic: control
 
2. Define the following command: <tt>\def\acrobat{\hyperdef{jump}{here}{}}</tt>
 
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 <tt>\acrobat</tt> 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 <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.


forward search: [v] DDE command.
====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")]
  command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")][MenuitemExecute("GoBack")]
server: acroview
topic: control
Close document before running (La)TeX: [v] DDE command
command: [DocClose("%bm.pdf")]
server: acroview
topic: control


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.
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.

Revision as of 04:51, 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.

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

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>)]

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.


de:TeXnicCenter es:TeXnicCenter nl:TeXnicCenter pl:TeXnicCenter