Sadao Massago's Home Page

LaTeX Page

(La)TeX System on Linux

The (La)TeX system is easylly installed in linux distributions, using their own package managers. But some setup for their friends are recomended.
Here, present ssetup for common used editor and viewer, and several applications that help the LaTeX users.The almost ones is on repository of almost linux distributions (the development site will not offer binary package for your distro). Thus see on repositories of your distro before try the file on developer site. The almost aplications presented here is cross platform and will be used from windows too.

Is recomended to configure editor/viewer in way to activate editor/viewer integration (forward/inverse search).
If you country use punctuated characters and interact with windows users, is nice to configure encodding on editor to mach with encodings used by Windows of your country. For example, portuguese is ISO-8869-1 (latin1 for LaTeX). The TeXMaker/TeXmakerX will edit using more recomended UTF-8 (utf8x on LaTeX) on Windows too, but almost Windows user does not like to made any adjustments on ther environments. The best choice is to use TeX commands for  all punctuated characters that is independent of encoding used by editor.

Table of Contents


For other softwares, see the Helper Applications.

LaTeX Editor

For beginers, the kile and TeXmaker is most recomended choice as editor, and okular is best choice for viewer.
These editor and viewer is normally easy to install using package manager. Thus explain only the required setup process.
In way to use syncTeX features, need to install recent version of Okular (think that 2half latter of year 2009 or latter).

LyX

site: http://www.lyx.org/
LyX is the WYSIWYG (What You See is What You Get)  style LaTeX editorthat use LaTeX to process documents, in similar way to Scientific Work Place (comercial) for windows, TeXMacs (freeware) for Linux (run on windows using cygwin) and edoc (freeware - cross platform). edoc seems good editor, but it doen not have apropriate support for equations. TeXmacs is not light weight, but is usefull to produce scientific report due to CAS (Computer Algebvra Sistem) integration like MathCAD (comercial) for windows. The Scientific Work Place (comercial) has similar support, but the LyX skip almost of these features and becames most light weight and effcient ones to edit document (comparation include comercial ones).
These kind of applications are not the "front end". The user does not necessary to know LaTex comand. The text will edited as text editor and the mathematical equations, indec entry, cross reference, etc will created using menu and tools bar. But due to LaTeX command support on LyX and TeXMacs, permit to input LaTeX sequence of command inside formula that are interpreted and converted automatically to corresponding equations. Thus, is not necessary to use mouse, increasing significantly the typeset speed (who does not know LaTeX, will thing that use of mouse is easy form, but direct typping of  LaTeX command is much faster than use of mouse -- seems that the sequence of command on Scientific Work Place to produce equations are not same of the LaTeX ones. It is problematic for users). Due to these, the document editing on document with mathematical formula on LyX and TeXMacs are too fast as source code editing. To support more advanced user,  the LyX permit to insert LaTeX command block directly into document. Thus will use user defined command, or command that are not suported by LyX user interface, or that the user does not know how to perform on LyX.
The interface of LyX is similar to the comercial editor Scientific Work Place for Windows, but LyX is lightweight and integrate very well with LaTeX. Due to friendly interface, will produce hight quality document without or with small bit of LaTeX knowledge. Learnning more laTeX commands, increase typeset speed. In general, the medium knowledge on LaTeX will typeset more fast than basic knowledge ones. Thus, is recomended to study LaTeX  in way to increase document typeseting. The most significant diference is typeset of formula that keyboard is much faster than mouse click. The LaTeX source code exported by LyX is very celan. It was good LaTeX file import features too.
When some eror occur on compile time (if insert mistake command manually, will occur error when visualize/update DVI, PS or PDF), the error are marked using one icone on corresponding positin and the navegation tools will search these errors. When clicked on these icon, the LaTeX error are showed.
The Windows version of installer download/install all required tools, except the PS and  PDF viewer. Is recomended to install PS/PDF viewer before LyX. Note that Adobe Reader lock opened file, LyX can not update PDF file. To solve this problem, use sumatra PDF. For the install on system without network connection, the "bundle" version of installer contain all accessories except the MikTeX.  Note that the MikTeX that LyX install is Basic set. I think that almost ones want to use complete set. Of the case, install MikYeX before LyX to skip MikTeX install no LyX installer.
The very complete user manual and guide are on the help and is recomended to read.

When the setup of accesories like viewer, TeX, etc, is changed, the "tools->reconfigure" perform automatic setup (need to run for each user. If desire to applied for all user, reinstall LyX).

the spell checker: The "word list" will selected to be downloaded/installed during intall process. The spell checker is started by F7 or by menu "tools->spellchecker". The check start on the cursor position. If occur error saying that can not read the word for langage xxx", instead of check start, the corresponding one are not installed.
To add more "dictionary" (word list) that are not installed during LyX install, run the installer again and on "Reinstall", uncheck the "reinstall lyx 1.6.2-1 program files" and on the dictionary, specify your desired ones to be installed.
For brazilian, note that the portuguese word list has not the new grammar rule at now (April of 2009). In contrast of TeXMaker and TeXnicCenter, LyX does not accept spell check dictionary from Open Office ones. Thus, need to wait for someboy compile new one for aspell (used by LyX).

some notes on mathematical formula: The Lyx and TexMacs insert pair  {} uutomatically when are typping commands. Thus, x^12 are converted correctly as  x^{12}, but x^2_i are converted as x^{2_{i}}. When require that is x^2_i, need to type x^2<space or right arrow>_i that are converted correctly to x^{2}_{i}. The similar fact will occur on other sequence of commands.
The mathematic inline stype is created by <ctrl>M and in the display style is created by <cntrol><shift>M.  After LaTeX command is typed, press <SPACE> in way to LyX interpret it. The square root is \sqrt, but the n-th root  is inserted by  \root, exclusive of LyX (does not exist command \root on LaTeX). In the LaTeX, n-th root is inserted using optional parameter on \sqrt, but the optional parameter inside formula can not typed on LyX. Thus the virtual command \root is created.
If press <ctrl><ENTER> inside display formula, it is converted to eqnarray instead of align of AMS package that is recomended. To control it, use the menu "Edit->Math->Change Formula Type". Once the formula is converted apropriatelly,  <ctrl><ENTER> will used to create new line on equations. Note that is possible to create LaTeX macro suing mini buffer instead on preamble. The command created by mini buffer is interpreted to display correctly inside LyX. Teh command defined on preamble is displayed correctly only on DVI/PS or PDF output (inside LyX, the command are shown, not the result). This and other information is on the "help->user guide".

some notes on use of CAS (Computer Algebra System): The LyX will call Octave, Maxima, Mathematica (comercial), or some Maple (comercial) commands to perform calculation of formula, if corresponding ones are installed. To this, type matematical formula and cursor positioned at end of this, enter on "Edit->Math->use Computer Algebra System" and select the desired system to use. The LyX call selected system and on success, put the result as formula. Note that the octave is used for numerical calculus and maxima for symbolic calculus (such as symbolic inttegration). In way to work, the formula need to typed using correct laTeX commands, inclusing function name. When the formula is changed, need to recalculate.

Remark 1: The defualt mode for document is "use AMS package automatically" (LaTeX format file is compiled to load AMS package automatically). Are recomended to select "use AMS package", because almos LaTeX does not load AMS package automatically. is is valid when import laTeX document with AMS package. enter on the option "Document->settings" and on "math package", uncheck the "use AMS package automatically" and check the "use AMS package".
The user with knowledge of LaTeX will put several \usepackage command and definitions on the preamble of documents.
Remark 2: The compiler and viewer option will be adjusted by "tools->preferences". On the [file handling], the "converters" list the convertesr (and compilers) and "file formats" list the viewers. these setup will changed is desired.
Remark 3: In way to edito japanese document on LyX using  pTeX, is necessary to install the additional support file for babel, dsitributed by  http://wiki.lyx.org/Windows/Japanese (does not use huphenation in japanese, but LyX insist in use to compile). Unpack the file japanese.zip and put the file japanese.ins and  japanese.dtx on the subfolder "/usr/share/texmf/tex/latex/japanese".
Now, go to above folder, and call platex to compile japanese.ins
/usr/share/texmf/tex/latex/japanese$ sudo platex japanese.ins
It generates the file japanese.ldf for babel packages. Other files will erased now.
Execute the texhash to update filen name list
#sudo texhash
If not super user, will keep japanese.ldf file on same foldera as lyx files.

TeXMaker/TeXStudio

site: http://www.xm1math.net/texmaker/
site: http://www.texstudio.org/.

The TeXStudio is enhaced version of TeXMaker and will configured using same parameter. Only difference is the program name texstudio instead of texmaker that need attention when setup okular or like.
.
To setup TeXMaker, enter on menu
Options->Configure TeXMaker

Fonts, Encodings, and spell checking

If use accents or like and desire to have compatibility with windows user, recomend to configue encodings as your desired windows ones. The TeXMaker will works in several encodings on windows, but it is not true for almost editor on windows.

[Editor]
  Editor font family: <your desired ones>
  Editor font size: {your desired size like 12>
  Editor font encoddings: <your desired ones>
    Same examples of encodings:
        ISO-8859-1
        Portuguese version of windows use it.
        On preamble of LaTeX document, put
      \usepackage[latin1]{inputenc}
      Unicode (UTF-8)
        linux use it as default. If using LaTeX on windows, need to specify in preamble
        \usepackage[utf8x]{inputenc}
  spelling dictionary: <add your desired>
  [v] inline (keep checked)
  Obs.: To install new dictionary, get openoffice one from suggested link
  http://wiki.services.openoffice.org/wiki/Dictionaries
  and put into /usr/share/texmaker
  (or your own, if not super user)

source specials and syncTeX (forward/inverse search on DVI/PDF)

[commands]
LaTeX: latex --synctex=1 --src -interaction=nonstopmode """%.tex"""
PDFLaTeX: pdflatex --synctex=1 -interaction=nonstopmode """%.tex"""
Note: synctex optiions create auxiliar file need for sync between PDF viewer and editor. The --src option is to create special version of DVI to sync DVI viewer and editor. The  synctex=1 on latex is necessary to sync viewer/editor for PDF converted from DVI (dvipdfm ou dvips+ps2pdf). When use "-synctex=1" (or "--synctex=1"), apply gzip compression on info file geneated by synctex in way to reduce their size. If use "-synctex=-1" (or "--synctex=-1") with "-1" instead of "1", no compression performed.

TeXMaker case:
DVI viewer: okular --unique "file:%.dvi##src:@ %.tex"
PDF viewer (x) Embeeded viewer ( )External Viewer: okular --unique "file:%.pdf##src:@ %.tex"
TeXMakerX case:
DVI viewer: okular --unique "file:%.dvi#src:@ ?c:m.tex"
PDF viewer: okular --unique "file:%.pdf#src:@ ?c:m.tex"

Note that embeeded PDF viewer of TeXMaker 2.1 support syncTeX (for inverse search, cic wit right button on PDF). The embeeded PDF viewer is fast than oklar. Thus, recomended to keep embeeded viewer as default and external viewer as opional. Since embeeded viewer does not have print and like, wil call external viewer clicking on right upper coerner "external viewer"  on embeeded pdf viewer.

If prefer xdvi than okular, set
DVI viewer (TeXMaker case): xdvi -editor "texmaker %f -line" %.dvi -sourceposition @:%.tex
DVI viewer (TeXMaker case): xdvi -editor "texmakerx %f -line" %.dvi -sourceposition @:%.tex
Obs.: Only difference between TeXMaker and TeXMakerX is program names.

Note: for Okular, no way to setup for file name path that contains spaces (""" used for compilation does not works due to okular).

Setup Okular

Currrent version of okular (2010)
Settings->Configure Okular
[editor]
  editor: custon text editor
  command: texmaker  -line %l
Obs.: If for TeXmakerX, put
  command: texmakerx  -line %l

In the case of kdvi (perphaps, some version of okular too), need %f on parameter. Remembr that kdvi does not works for pdf.
[editor]
  editor: custon text editor
  command: texmaker %f -line %l
Obs.: If for TeXmakerX, put
  command: texmakerx %f -line %l

On currente version of okular (2010), use <shift> <left button> for inverse search on DVI or PDF.
On kdvi and xdvi (perphaps, some version of okular too), use <ctrl> <left button> for inverse search on DVI.

TeXStudio's instant preview setup:
On [preview] tab.
Reccomend to change "segment preview command:" to "preview with pdflatex", because the code that require pdf specials like tikz graphics will not work for default dvipng.
To use instant preview for eauqtions, move mouse to end of equations and wait bit of times.
To use instant preview for code block like tikz pictures, select it and on right mouse button, select "preview selection/parenteses".


For more documents for TeXMaker and TeXStudio, see
http://www.xm1math.net/texmaker/doc.html
and
http://texstudio.sourceforge.net/manual/current/usermanual_en.html

Kile

Kile is most popular laTeX editor for person that does not use emacs (emacs is prefered for power users).
Initially is based on TeXmaker, but works only on linux.

To configure kile, enter on menu
Settings->Configure Kile

Fonts
[Editor]
  Fonts & Colors
    [font] select desired font and size

Encodings
If use accents or like and desire to have compatibility with windows user, recomend to configue encodings as your desired windows ones. The TeXMaker will works in several encodings on windows, but it is not true for almost editor on windows.

[Editor]
  Open/Save
Encoding: <select your desired encodings>
Same examples:
western european (ISO-8859-1)
  Portuguese version of windows use it.
  On latex document, put
  \usepackage[latin1]{inputenc}
Unicode (UTF-8)
  linux use it as default. If using latex outside linux, put
  \usepackage[utf8x]{inputenc}

Spell Check

[Editor]
    Editing
    [spellcheck]
    Default language: <select your desired one>
    [v] automatic spell checking enabled by default

forward/inverse search on DVI/PDF

[tools]
  build
    latex
      select: modern
      Note: The default is to support only the source specials on DVI. In way to support syncTeX on PDF converted from DVI (using dvipdfm ou dvips+ps2pdf), add "-synctex=1" on options that it becames
        -synctex=1 -src-specials -interaction=nonstopmode '%source'   
    pdflatex
      select: modern

Setup Okular

settings->configure okular
[editor]
  editor: kile

On currente version of okular (2010), use <shift> <left button> for inverse search on DVI or PDF.
On kdvi and xdvi (perphaps, some version of okular too), use <ctrl> <left button> for inverse search on DVI.

TeXWorks (no stable edition yet)

site: http://www.tug.org/texworks/
The TeXWorks is cross platform TeX Editor/Viewer with easy to use clear interface. It becames with syncTeX enabled by default.
It is in development stage (April, 2010) and mising error line finding and symbol panel, but almost other important feature are implemented and works fine.

Gummi (in development)

site: http://gummi.midnightcoding.org/
O gummi is the editor with live preview features. It mean that the PDF are updated when change source code, as made in some classical TeX on MacOS. The sincronization between source and PDF are made by sincTeX tecnology.

Other editors

The emacs is classical editor for TeX, but there exists several other editors such as emacs and winefish. Some programmer editor like geany, gedit, etc has plugins for LaTeX too. Each of these require apropriate setup to increase functionality.

For other softwares, see the Helper Applications.