LaTeX Editors

From Klaus' wiki
Jump to: navigation, search

There are a wealth of editors available for editing documents for LaTeX.

You can basically use a simple line editor like ed, vi, vim, edlin, notepad or the like. But nowadays you may want some kind of graphical environment in front of us while editing, hence a look for suites, that will enable you to write in an editor with menus windows and such, may be preferable.

For the Linux environment I came across these:

Texmaker, Texstudio, Texworks and Kile.

I prefer currently to prepare my documents in Texmaker, but this may change as I become a real LaTeX hacker. Look into your distribution to find out what is distributed with it.

For other OS's please browse the web for options - since LaTeX is and always has been Open Source - there are possibly a large number of editor suites available for your environment as well.

Texmaker

Texmaker-overview.png

(click to enlarge)

Texmaker has a number of windows:

  • To the left the document structure is shown.
  • Next comes the main editor window and
    • below that the output from the compilation of the document.
  • To the right a preview of the PDF is shown

The windows can be switched on or off by clicking on the buttons down in the left part of the application window.

By configuration F1 key enables you to Quick Build your document - typically using PDFLaTex and view PDF in a combination. This means that you do not see the final output until you compile and view the PDF. The general idea in LaTeX environments is to keep focus on the documents content and structure and the PDF is just an option. As you become more and more familiar with working this way you just writes along for longer and longer periods and only now and then checks the output for the typesetting.

Texmaker-overview1.png

This is the main editor window in where you'll edit the document.

Find below the top of my document as I use it currently in order to setup a large document - a book.

\documentclass[a4paper,11pt, twoside]{book}
\usepackage[left=5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[english]{babel} % Quotes won't work without babel
\usepackage[utf8]{inputenc}  % This is very important!
\usepackage[T1]{fontenc}
 
%Enables inclusion of PDF files
\usepackage{pdfpages}
 
%For graphichs in the document
\usepackage{graphicx}
\usepackage[pdfborder={0 0 0}, breaklinks=true, pdftex=true, raiselinks=true]{hyperref}
 
%% For source code listings
\usepackage{listings}
\usepackage{color}
% find color definitions on http://en.wikibooks.org/wiki/LaTeX/Colors
\usepackage[usenames,dvipsnames]{xcolor} 
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\lstset{
    backgroundcolor=\color{lbcolor},
    tabsize=4,
    rulecolor=,
%    language=Erlang,
    basicstyle=\scriptsize,
    upquote=true,
    aboveskip={1.5\baselineskip},
    columns=fixed,
    showstringspaces=false,
    extendedchars=true,
    breaklines=true,
    prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
    frame=single,
    showtabs=false,
    showspaces=false,
    showstringspaces=false,
    identifierstyle=\ttfamily,
    keywordstyle=\color{Purple},
    identifierstyle=\color{Black},
    commentstyle=\color{BrickRed},
    stringstyle=\color{RubineRed},
}
\lstloadlanguages{
		% Check Dokumentation for further languages ...
        %[Visual]Basic
        %Pascal
        C,
        C++,
        %XML
        HTML,
        %Java,
        Erlang
}
 
%Set pagestyle for the forthcomming pages 
\pagestyle{headings}
 
% Set a box around the figures
\usepackage{float}
\floatstyle{boxed} 
\restylefloat{figure}
 
\title{Progress Report}
\author{Klaus Kolle}
\date{2012-03-28}
 
\begin{document}
\frontmatter
 
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\input{./title.tex}
 
\thispagestyle{plain}
 
% Set no box around figures
\floatstyle{plain}
\restylefloat{figure}
 
 
\chapter*{Thank You}
<\source>