Difference between revisions of "TeXnicCenter"

From ConTeXt wiki
Jump to navigationJump to search
m
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
{{note| This page is outdated and needs to be updated}}
 +
 
== Adapting TeXnicCenter for processing ConTeXt documents ==
 
== Adapting TeXnicCenter for processing ConTeXt documents ==
  
You can build and view a ConTeXt document in TeXnicCenter as follows:
+
You can build and view a ConTeXt document in [http://www.toolscenter.org/ TeXnicCenter] as follows:
* Follow the instructions for installing ConTeXt under Windows.  
+
* Follow the instructions for [[Windows Installation|installing ConTeXt under Windows]].
 
* Make sure that ruby and perl are in your PATH ''(Start menu -> Settings -> Control Panel -> System -> Advanced -> Environment Variables; then edit PATH)''. In my system (root = C:\ConTeXt) the first items are: C:\ConTeXt\usr\local\context\ruby\bin; C:\ConTeXt\usr\local\context\ruby\lib; C:\ConTeXt\usr\local\context\perl\bin; C:\ConTeXt\usr\local\context\perl\lib
 
* Make sure that ruby and perl are in your PATH ''(Start menu -> Settings -> Control Panel -> System -> Advanced -> Environment Variables; then edit PATH)''. In my system (root = C:\ConTeXt) the first items are: C:\ConTeXt\usr\local\context\ruby\bin; C:\ConTeXt\usr\local\context\ruby\lib; C:\ConTeXt\usr\local\context\perl\bin; C:\ConTeXt\usr\local\context\perl\lib
 
* Start TeXnicCenter. From the menu select: Build -> Define Output Profiles.
 
* Start TeXnicCenter. From the menu select: Build -> Define Output Profiles.
Line 8: Line 10:
 
* Check "Run (La)TeX in this profile".
 
* Check "Run (La)TeX in this profile".
 
* Under "Path to the (La)TeX compiler" enter:  
 
* Under "Path to the (La)TeX compiler" enter:  
C:\ConTeXt\usr\local\context\tex\setuptex.bat & C:\ConTeXt\usr\local\context\tex\texmf-mswin\bin\texmfstart <br>
+
C:\ConTeXt\usr\local\context\tex\setuptex.bat & C:\ConTeXt\usr\local\context\tex\texmf-mswin\bin\texmfstart
 
If you have another root, then change C:\ConTeXt accordingly.
 
If you have another root, then change C:\ConTeXt accordingly.
 
* Under "Command line arguments to pass to the compiler" enter:
 
* Under "Command line arguments to pass to the compiler" enter:
texexec.rb, the parameters and "%bm" for the file to be compiled.
+
texexec.rb, the parameters and "%bm" for the file to be compiled.
 
In my case this line reads as follows:<br>
 
In my case this line reads as follows:<br>
texexec.rb --bat --nonstop --pdf --interface=nl --color "%bm"  
+
texexec.rb --bat --nonstop --pdf --interface=nl --color "%bm"  
  
 
Now your ConTeXt file should compile after selecting "Build -> Build" from the menu or pressing Ctrl+F7 or clicking on the corresponding toolbar icon.
 
Now your ConTeXt file should compile after selecting "Build -> Build" from the menu or pressing Ctrl+F7 or clicking on the corresponding toolbar icon.
  
 +
=== With Adobe Acrobat Reader ===
 
* For installing Acrobat Reader as your viewer again select: Build -> Define Output Profiles.
 
* For installing Acrobat Reader as your viewer again select: Build -> Define Output Profiles.
 
* Select the tab "Viewer".
 
* Select the tab "Viewer".
Line 25: Line 28:
 
* Same choices for "Forward Search" and "Close document before running (La)TeX", except for the Command which in the latter case should be: [DocClose("%bm.pdf")]
 
* Same choices for "Forward Search" and "Close document before running (La)TeX", except for the Command which in the latter case should be: [DocClose("%bm.pdf")]
  
 +
=== With SumatraPDF ===
 +
With SumatraPDF you get forward and inverse search capabilities. To enable them, you have to adjust the texexec arguments accordingly and add the "--synctex=-1" option:
 +
texexec.rb --batch --nonstop --pdf --interface=en --color "%bm" --synctex=-1
 +
* In the Viewer tab enter in the field for the executable path
 +
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance <br> -inverse-search "\"C:\Program Files\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto('%f', '%l')]\""
 +
* Under 'View Project's output':
 +
select DDE-command
 +
Command: [Open("%bm.pdf",0,1,1)]
 +
Server: SUMATRA
 +
Topic: control
 +
* Under 'Forward search':
 +
Select option 'DDE command'
 +
Command: [ForwardSearch("%bm.pdf","%Wc",%l,0,0,0)]
 +
Server: SUMATRA
 +
Topic: control
 +
* Under 'Close document before running (La)TeX':
 +
Select 'Do not close'
 +
 +
=== Cleaning up ===
 
Automatically deleting unnecessary auxiliary files after compilation is realised as follows:
 
Automatically deleting unnecessary auxiliary files after compilation is realised as follows:
 
* Select: Build -> Define Output Profiles.
 
* Select: Build -> Define Output Profiles.
Line 30: Line 52:
 
* Create a new item "cleanup" by clicking on the first icon after the text "Postprocessors to run after the (La)TeX-compiler".
 
* Create a new item "cleanup" by clicking on the first icon after the text "Postprocessors to run after the (La)TeX-compiler".
 
* In the edit line after "Executable" enter:<br>
 
* In the edit line after "Executable" enter:<br>
C:\context\usr\local\context\tex\texmf-mswin\bin\texutil.bat --purgeall<br>
+
C:\ConTeXt\usr\local\context\tex\setuptex.bat & C:\ConTeXt\usr\local\context\tex\texmf-mswin\bin\texmfstart.exe
 +
 
 +
And in the edit line after "Arguments" enter:
 +
texutil.rb --purgeall.
 
If you have another root, then change C:\ConTeXt accordingly.
 
If you have another root, then change C:\ConTeXt accordingly.
 +
 +
{{Installation navbox}}
 +
 +
[[Category:Text Editors]]

Latest revision as of 22:04, 3 April 2016


NOTE: This page is outdated and needs to be updated

Adapting TeXnicCenter for processing ConTeXt documents

You can build and view a ConTeXt document in TeXnicCenter as follows:

  • Follow the instructions for installing ConTeXt under Windows.
  • Make sure that ruby and perl are in your PATH (Start menu -> Settings -> Control Panel -> System -> Advanced -> Environment Variables; then edit PATH). In my system (root = C:\ConTeXt) the first items are: C:\ConTeXt\usr\local\context\ruby\bin; C:\ConTeXt\usr\local\context\ruby\lib; C:\ConTeXt\usr\local\context\perl\bin; C:\ConTeXt\usr\local\context\perl\lib
  • Start TeXnicCenter. From the menu select: Build -> Define Output Profiles.
  • Add a Profile with the name ConTeXt.
  • Check "Run (La)TeX in this profile".
  • Under "Path to the (La)TeX compiler" enter:
C:\ConTeXt\usr\local\context\tex\setuptex.bat & C:\ConTeXt\usr\local\context\tex\texmf-mswin\bin\texmfstart

If you have another root, then change C:\ConTeXt accordingly.

  • Under "Command line arguments to pass to the compiler" enter:
texexec.rb, the parameters and "%bm" for the file to be compiled.

In my case this line reads as follows:

texexec.rb --bat --nonstop --pdf --interface=nl --color "%bm" 

Now your ConTeXt file should compile after selecting "Build -> Build" from the menu or pressing Ctrl+F7 or clicking on the corresponding toolbar icon.

With Adobe Acrobat Reader

  • For installing Acrobat Reader as your viewer again select: Build -> Define Output Profiles.
  • Select the tab "Viewer".
  • Under "Path of Executable" you enter the path to the program AcroRd32.exe
  • Under "View project's output" select: "DDE command".
  • The Command should be: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
  • Server is "acroview" and Topic: "control"
  • Same choices for "Forward Search" and "Close document before running (La)TeX", except for the Command which in the latter case should be: [DocClose("%bm.pdf")]

With SumatraPDF

With SumatraPDF you get forward and inverse search capabilities. To enable them, you have to adjust the texexec arguments accordingly and add the "--synctex=-1" option:

texexec.rb --batch --nonstop --pdf --interface=en --color "%bm" --synctex=-1
  • In the Viewer tab enter in the field for the executable path
"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance 
-inverse-search "\"C:\Program Files\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto('%f', '%l')]\""
  • Under 'View Project's output':
select DDE-command
Command: [Open("%bm.pdf",0,1,1)]
Server: SUMATRA
Topic: control
  • Under 'Forward search':
Select option 'DDE command'
Command: [ForwardSearch("%bm.pdf","%Wc",%l,0,0,0)]
Server: SUMATRA
Topic: control
  • Under 'Close document before running (La)TeX':
Select 'Do not close'

Cleaning up

Automatically deleting unnecessary auxiliary files after compilation is realised as follows:

  • Select: Build -> Define Output Profiles.
  • Select the tab "Postprocessor".
  • Create a new item "cleanup" by clicking on the first icon after the text "Postprocessors to run after the (La)TeX-compiler".
  • In the edit line after "Executable" enter:
C:\ConTeXt\usr\local\context\tex\setuptex.bat & C:\ConTeXt\usr\local\context\tex\texmf-mswin\bin\texmfstart.exe

And in the edit line after "Arguments" enter:

texutil.rb --purgeall.

If you have another root, then change C:\ConTeXt accordingly.