using texniccenter

31
TeXnicCenter v1 Beta 7.01 Frank Van Puyvlde ICT for Research K.U.Leuven March 2008

Upload: luis-hernandez-g

Post on 07-Apr-2015

744 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Using Texniccenter

TeXnicCenter v1 Beta 7.01

Frank Van PuyvldeICT for Research

K.U.Leuven

March 2008

Page 2: Using Texniccenter

Contents

1 TeXnicCenter Installation 21.1 Installing TeXnicCenter . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 TeXnicCenter and a new MiKTeX installation . . . . . . . . . . . . . . 31.3 TeXnicCenter and Acrobat pdf viewer . . . . . . . . . . . . . . . . . . 5

2 Using TeXnicCenter: the basics 62.1 Typing the source file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.1.1 Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Compile the text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 TeXnicCenter: the buttons 113.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Menu bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2.1 File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.2.2 Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.3 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2.4 View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.5 Insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.6 Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.7 Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.8 Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.9 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.10 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2.11 Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.2.12 Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

1

Page 3: Using Texniccenter

Chapter 1

TeXnicCenter Installation

1.1 Installing TeXnicCenter

Note: it is better to have MiKTeX installed prior before installing TeXnicCenter.

• Download TeXnicCenter Setup from the TeXnicCenter Downloads page (www.toolscenter.org).

• Launch TXCSetup and walk through the installation. The defaults should befine, unless you have a specific desire to change theminstall to C:\Program Files\TeXnicCenter, use Typical installation, putthe shortcuts in the TeXnicCenter Start Menu folder).

• Launch TeXnicCenter from Start > Programs.

• The Configuration Wizard opens. Click Next to continue. It is importantto point to the correct locations of the executables needed to compile yourLATEXdocuments.

• For the path to the Distribution Directory,browse to C:\Program Files\ MiKTeX 2.x\miktex\bin\ (in case ofa standard MiKTex installation)and then click Next.

• At the Postscript Viewer screen, click Next.

• If prompted for a path to the PDF Viewer, browse to the location of yourPDF application, such as Adobe Reader. Click Next. Click Finish to completeinstallation.

• When the installation completes, you’re done.

2

Page 4: Using Texniccenter

1.2. TEXNICCENTER AND A NEW MIKTEX INSTALLATION

1.2 TeXnicCenter and a new MiKTeX installation

After installing a new version of MiKTeX (and de-installing the old version), TeXnic-Center might have problems in finding back the compiler, as shown in fig(1.1)

Figure 1.1: Problem finding the latex compiler

In order to update the link to MiKTeX, running the configuration wizard again willhelp. Click Build on the menu bar and select output profiles fig(1.2)

Figure 1.2: Select the Output Profile option

Select the configuration wizard to start fig(1.3)Locate the correct directory fig(1.4) and the wizard will update necessary informa-tion.

3

Page 5: Using Texniccenter

1.2. TEXNICCENTER AND A NEW MIKTEX INSTALLATION

Figure 1.3: Select to start the configuration wizard

Figure 1.4: Locate the correct directory

4

Page 6: Using Texniccenter

1.3. TEXNICCENTER AND ACROBAT PDF VIEWER

1.3 TeXnicCenter and Acrobat pdf viewer

Check the settings for the pdf viewer, use the settings as shown in fig(1.5), then theviewer will be closed and openend automatically by TeXnicCenter.

1. In the field View projects output enable the option DDE command, deletewhatever command there is in the next line and write there:[DocOpen("%bm.pdf")][DocOpen("%bm.pdf")]

2. In the field Forward Search enable the option DDE command, delete what-ever command there is in the next line and write there:[DocOpen("%bm.pdf")][DocOpen("%bm.pdf")]

3. In the field Close document before running (La)TeX enable the option DDEcommand, delet whatever command there is in the next line and write there:[DocOpen("%bm.pdf")][DocOpen("%bm.pdf")][DocClose("%bm.pdf")]

Figure 1.5: Configuration for the acrobat viewer

This information was retrieved fromhttp://dikkie.net/2007/02/16/texniccenter-and-adobe-reader-80/

5

Page 7: Using Texniccenter

Chapter 2

Using TeXnicCenter: the basics

2.1 Typing the source file

1. start TeXnicCenter, the TeXnicCenter sreen will show up. fig(2.1)

Figure 2.1: Initial TeXnicCenter Screen

6

Page 8: Using Texniccenter

2.1. TYPING THE SOURCE FILE

2. Open a new file (either by clicking on the new file icon or selecting the optionfrom the menu (file entry). Once a blanc sheet appears, you can start typingthe source code.

Figure 2.2: Blanc Page

3. Type the LATEXsource code and save the file, an tex will be added automati-cally.

7

Page 9: Using Texniccenter

2.1. TYPING THE SOURCE FILE

Figure 2.3: Type the source code

8

Page 10: Using Texniccenter

2.2. COMPILE THE TEXT

2.1.1 Tips

The right side of the lower toolbar is full of shortcut buttons for mathematics syn-

tax ( ).The left side of the lower toolbar is full of shortcut buttons for changing font - bold-

face, italics, etc ...- ( ) and text alignment ( )

2.2 Compile the text

Once the text is completed, you can compile it, to view the output. Scroll the mousepointer over the buttons in the toolbars to get descriptions of their functions.

• In the toolbar directly below the TeXnicCenter menu bar, there are shortcut

buttons for building ( ) and viewing ( ) documents. There is a particu-

larly useful button ( ) that builds and displays your typeset document inone step.

• The result of the compilation is shown in the output pane, check this pane, iferror or warning messages appear.

9

Page 11: Using Texniccenter

2.2. COMPILE THE TEXT

Figure 2.4: Compilation result

10

Page 12: Using Texniccenter

Chapter 3

TeXnicCenter: the buttons

3.1 Overview

Most of the functionalities is available in the different toolbars. The different but-tons are grouped into categories (that can be changed. This page was inspired byAcademie Versailles (http://euler.ac-versailles.fr/)

1. Create a new document

Open an existing document

Save the current document

Save all open documents

2. Cut

Paste

Copy

3. Undo the last action

Redo the last action

4. Show navigation window (useful to get the structure of a project)

Show compile log file (errors, warnings, etc.)

5. show blancs

manage the windows of the edited files (save, close, minimize)

6. Choice of output profile (DVI, PS or PDF)

11

Page 13: Using Texniccenter

3.1. OVERVIEW

7. Compilation of the open documents

Compilation of the current document

Stop the compilation

Show the resulting output of the compiled document (the form will dependon the choice made under the output profile: Yap (.dvi), GSview (.ps) or Ac-robat reader (.pdf)

8. Go to the next error

Go to the previous error

Go to the next warning

Go to the previous warning

Go to the next bad box

Go to the previous bad box

9. LATEXenvironments

Structure (section, etc.)

Lists (environment itemize)

Numbered Lists (environment enumerate)

Figures (environment figure)

Tables (environment table/tabular)

10. Insert footnote

11. Mathematical environment (displaymath)

Multiple equations (eqnarray)

12. Toggle the math toolbar

mathematics, symbols, operators, etc. : each button shows a complete palette.

13. Search tools

Find, find next, find previous

Incremental search (forward and backward)

Replace

Go to the last change

Bookmarks (toggle, go to next, go to previous, remove all)

Find in files (next and previous result)

12

Page 14: Using Texniccenter

3.2. MENU BAR

14. Typeface commands (emphasized, bold, italic, etc.)

Alignment command (left, center, right)

15. Navigation bar (useful in case of working with a project)

16. Edit window

17. Output bar: provides information on the compilation (errors, warnings, etc.)

3.2 Menu bar

The different options on the menu bar are reviewed in order to grasp all thepossibilities. If you are familiar with windows software, most of the optionsare straightforward, and are implemented the very same way as in otherwindows software. Actions can be chosen from the drop-down menu’s,icon or even better with short-cut key combinations

3.2.1 File

The file menu pro-vides in actionsconcerning open-ing, closing, savingfiles, etc. as weare used to see inregular windowsapplications.

13

Page 15: Using Texniccenter

3.2. MENU BAR

14

Page 16: Using Texniccenter

3.2. MENU BAR

New

The New command opens a new empty file, this action can also be achieved byclicking onto the New file icon

Open a new emptyfile

New from template

Choosing this option allows to select from a list of pre-defined templates.You can create your own templates for different types of documents. You can find,and set, the directories where the templates are located using the Tools→ Optionsmenu. (See further).

Open

The Open command opens an existing file, browse through the different directo-ries to select the file.

Open an existing file

Save, Save As, Save All

The Save command saves an open file, browse through the different directories toselect a location for the file to save. The extension determining the file type can bechanged, etc. Save All saves all the open files in the editor

15

Page 17: Using Texniccenter

3.2. MENU BAR

Open an existing file

These file commandsare also repeated inthe toolbar

To project or Not to project

This information was retrieved from the TeXniccenter FAQ(http://www.toolscenter.org/).The project handling is especially useful for larger documents, which are distributedover several files.When writing a large document (book, report, etc.), the document will be split intoseveral files. The common approach is to have a main file specifying the documentclass, packages, etc. The structure of the document is set with inclusion of thedifferent chapters (using input or include).If you are working on one of the chapter files and you would like to create theoutput, you will have to open the main file first and compile this one to get theoutput. This is where TeXnicCenter’s project management comes in: when youcreate a project, you specify its main file, which is the file that should be passed tothe LaTeX compiler to generate the output for the whole document. If you are nowworking on a chapter file and you would like to generate output, you will onlyhave to choose the Build command and TeXnicCenter will start the compilation forthe main file, even if it isn’t opened in the editor at the moment.There are some additional advantages when working with projects:

1. The navigator window (docked window at the left) will show the structureof your document.

2. You can spell check all files of your project.

3. TeXnicCenter remembers which files are open and where the cursor is placedfor projects, each time you close a project. Next time, when you open it, thestate of the latest session will be restored.

Projects offer advantages, the only case where projects are unnecessary, are non-structured documents, created from a single file.

16

Page 18: Using Texniccenter

3.2. MENU BAR

New project

When starting with a new project, TexnicCenter proposes a collection of templatesto choose from, or you can start from an empty project. Enter a name for yourproject, and specify the directory where you want to save your work.

Open a new project.Specify the name ofthe project and thelocation. Check theoptions BibTeX andMakeIndex if used

In this example theproject was calledlatexexample. Themain file is latex-example.tex (samename as the project!).If in the main filethe different chaptersare included, thefiles to be writtenalready appear inthe tree view of thenavigator. If the fileis not yet created,an interrogationsign is visible onthe icon. Once thefile is created, theinterrogation signdisappears.

Open Save Close project

With open project, another project can be opened. The other options save and closespeak for themselves.

17

Page 19: Using Texniccenter

3.2. MENU BAR

Recent

With the recent options, the recent files and projects that were edited, can be se-lected. This provides a shortcut to recent files used, no need to retrieve the wholepath.

3.2.2 Edit

The Edit menu con-tains the editing com-mands that we areused to find in reg-ular windows appli-cations. The easiestway to use these fea-tures is to rememberthe shortcut.

These edit com-mands are alsorepeated in thetoolbar

undo ctrl-zredo ctrl-ycut ctrl-xcopy ctrl-cpaste ctrl-vselect all ctrl-aselect brace block ctrl-m select everything inside { }

Block comment

In the process of testing, it sometimes is necessary to restrict a part of the text, theeasiest way is to put a comment sign (%) in front of the lines of text. This is whatblock comment can do for you. Instead of putting (or removing) a % in front of eachline, just select a block of text and select the option, to perform the action on thewhole selection. Toggling will put the comment on/off.

Complete word

The complete word option (ctrl + space) is very useful if you partially (the firstfew letters of it!) remember the LATEXcommand. A list is presented with all possi-

18

Page 20: Using Texniccenter

3.2. MENU BAR

ble commands that start with the letters provided, a simple selection from the listcompletes the word.

3.2.3 Search

The search menu pro-vides in a number ofutilities for searchingand replacing text inthe files edited.

The easiest way

to use these features is to remember the shortcut (corresponds with the shortcutsfound in other windows software).

find ctrl-ffind next F3find previous shift-F3

19

Page 21: Using Texniccenter

3.2. MENU BAR

Find in files

TeXniccenter takesthe find functioneven further, you cansearch for a word orsentence in a bunchof files. Specify thedirectory (with orwithout inclusionof subdirectories) tosearch in.

The result of thesearch can be di-rected to the outputarea 1 or 2. Clickingon a search result willopen that specific fileon the specified line.

Incremental search

A very handy incremental search tool exists too. Incremental search is an inline,progressive search that allows you to find matched text as you type. The key bind-ings are part of the default window key binding. Select the key-binding first andstart typing the search string. The cursor will jump to the first occurrence. Pushingthe esc-button, will place the cursor back to its initial position.

find incremental up ctrl-i select ctrl-i first and starttyping the search string

find incremental down ctrl-shift-i

Bookmarks

Lines in open files can be bookmarked, just toggle the bookmark option. Remem-ber the key binding to jump through the different bookmarks.

20

Page 22: Using Texniccenter

3.2. MENU BAR

toggle bookmark ctrl-F2next bookmark F2previous bookmark shift-F2remove all bookmarks ctrl-shift-F2

It is also possible to explicitly enumerate the bookmarks (from 0 to 9) and jump tothese. These key-bindings are more difficult to remember.

These bookmarkcommands are alsorepeated in thetoolbar

3.2.4 View

The view option changes the appearance of the TeXniccenter editor. The navigator,gives extra information, which is very useful when working in the project mode.The output bar provides information windows displaying the results of build oper-ations, find operations and parse operations.It is possible to track white spaces, when the option display white spaces is on.If multiple files are open in the editor, the position of the tabs can be changed, aswell as the appearance of the information on the tab.

The view optionchanges the ap-pearance of theTeXniccenter editor.

These view com-mands are alsorepeated in thetoolbar

3.2.5 Insert

The insert optionprovides a bunchof LATEXfunctionsand constructions,that can be readilyincluded in the textbeing edited.

Here again, working with the shortcut keys can be helpful

21

Page 23: Using Texniccenter

3.2. MENU BAR

insert section ctrl-alt-sinsert footnote ctrl-alt-finsert tabular ctrl-alt-tinsert graphics (picture) ctrl-alt-g

Each of these inserts, calls a gui, where you can select the specific LATEXconstruction.For the section, you can choose from the different section commands possible(part, chapter, section, subsection, etc.).

All the informationneeded to insert a ta-ble in the text is pro-vided in the gui andcan be filled out assuch.

A similar GUI is provided for inserting a picture. The label is automatically filledout with the name of the file, what is a nice feature.

These insert cat-egories are alsorepeated in thetoolbar

LATEXlist commands can also be inserted in the file, by choosing the right entry fromthe menu; Or (faster) by a key combination.

enumerationsitemize (begin - end) ctrl-alt-zenumerate (begin - end) ctrl-alt-ndescription (begin - end) ctrl-alt-binsert enumeration/itemize item ctrl-alt-einsert description item ctrl-alt-l

22

Page 24: Using Texniccenter

3.2. MENU BAR

3.2.6 Math

A wealth of mathe-matical symbols isavailable in LATEX,most of them aredisplayed on themenu, so you onlyhave to choose theright symbol fromthe list.

The most impor-tant mathematicalsymbols, are alsorepeated in thetoolbar

3.2.7 Format

The format optionprovides in op-tions to change theappearance of theletters, choosingsome action will putthe correspondingLATEXcommand intothe text.

Some of these formatcommands are alsorepeated in the tool-bar

23

Page 25: Using Texniccenter

3.2. MENU BAR

3.2.8 Project

The options under the project entry in the menu bar are not that extensive. Youcan look at the properties of a project. In this screen the option to use bibtex andmakeindex are provided. Checking these options will set the right code in the mainfile of the project.

3.2.9 Build

This section is the most important one, since it concerns the building of the text toits final format.

If you want to view result of the text, you need to compile the text. On detection ofMikTeX, TeXnicCenter automatically configures several output profiles. An outputprofile specifies how the output file is to be produced. Different paths are possible:

• LATEX=⇒ DVI

• LATEX=⇒ PDF

• LATEX=⇒ PS

24

Page 26: Using Texniccenter

3.2. MENU BAR

• LATEX=⇒ PS =⇒ PDF

LATEX=⇒ DVI

This profile is commonly used during the edit-compile-debug cycle. The resultis shown in the Yap (Yet Another Previewer) previewer. Noteworthy is the re-verse search (a very handy and underexploited) feature: double clicking in the Yapwindow, moves to the corresponding point in the input file in the TeXnicCenterwindow. Putting the cursor at a point in the edited file and hitting the DVI button(F5) moves to the corresponding point in the DVI file.

LATEX=⇒ PDF

This profile uses PdfLaTeX to produce PDF files. Since PS is not an intermediateformat in this process, EPS figures must be converted to PDF format before inclu-sion.

LATEX=⇒ PS

This profile is seldom used, since PS (postscript) output files are typically used forprinting. The LATEXcompiler is used to produce a dvi file, wich is transformed intoa PS-file in a postprocessing step. A PS-viewer needs to be installed in order toview the result.

LATEX=⇒ PS =⇒ PDF

This profile uses Ghostscript to produce PDF files. This profile uses the LATEXcompilerand the result is postprocessed afterwards: dvi to PS and from PS to PDF. Thisprofile is used when the figures are eps files (that cannot be treated in the PdfLatexcompiler).

25

Page 27: Using Texniccenter

3.2. MENU BAR

Build

The easiest way to build the output is by using the shortcut keys.Build F7 when working on a project, the

project will be compiledBuild current file ctrl-F7 the current file must be compil-

ableBuild and view output ctrl-F5Build and view output current file ctrl-shift-F5View output F5

Depending on the output profile chosen, the result will be shown in the chosenformat (DVI or PS or PDF)

Errors

A nice feature of the integrated environment is the easy tracking of errors and badboxes. To find the position of the error in the source file, click on the Next Errorbutton (F9) and correct the error in the file. The same goes for warnings (F10) andbad boxes (F11).

Output profiles

You can define your own profiles and add them to the list of output profiles. Thiscan be very handy if you have some extra’s, you can add them yourself.

3.2.10 Tools

26

Page 28: Using Texniccenter

3.2. MENU BAR

Options

Different optionsconcerning the gen-eral behavior of theeditor can be setusing the Optionswindow. Generalissues concerningthe look and feel arefound in the Generaltab. Features likeautosaving files canbe changed underthe File tab, etc.

Line numbers Line numbers can be very useful, especially during debugging. Thecompiler output will reference errors, warnings to line numbers. If those line num-bers are shown, the problem can be tracked down more easily. The option to showline numbers is somewhat hidden in the option menu Text Format. Check theoption Show line numbers.

27

Page 29: Using Texniccenter

3.2. MENU BAR

Customize

Interesting (and more advanced) information can be collected at the Clemson Uni-versity page (http://www.ces.clemson.edu/linux/latex.shtml) and thepages of Prof. Schechter (Vanderbilt University) (http://www.math.vanderbilt.edu/˜schectex/).

The customize optiongoes deeper than theoptions, here you canpersonalize your edi-tor.

General gives an overview of the different commands available in the differentmenu’s. You can remove elements from the menu items by dragging them awayfrom the menu. If you want to add an item again, then open this menu, look forthe right entry and move it into the menu of your choice.Toolbar gives an overview of the different symbol groups that can be placed on thetoolbar. Depending on your needs, you can add or delete certain groups. Check-ing or unchecking the boxes will change which buttonbars are shown; New... willcreate a new buttonbar. Buttons can be moved from one to another, or deleted bydragging it away from the toolbars.Keyboard allows you to change the shortcuts for the different commands available.Tools leaves the option to incorporate other tools into the environment, as an ex-ample the windows explorer is

3.2.11 Window

Options concerningwindows

The Window option, provides in layout options for the editing windows. Youcan open the same file in another window, split a window (can be useful whenyou want to keep on viewing a certain part of the file while editing another part),browsing through the different windows, etc.

28

Page 30: Using Texniccenter

3.2. MENU BAR

3.2.12 Help

The F1-button provides context sensitive help. When a LATEXcommand is selected,the help screen provides information on the command selected (if available). Pushthe F1-button, without selecting a string, calls the help screen.

29

Page 31: Using Texniccenter

Index

autocompletion, 19

block comment, 18bookmarks, 20build (output), 24

edit shortcut, 18

fileNew, 15New from template, 15Open, 15Save, 15

find in files, 20format, 23

incremental search, 20insert LATEXcommands, 21

line numbers, 27

math, 23

project, 16

search shortcut, 19

view panes, 21

30