#language en ##For Translators - to have a constantly up to date translation header in you page, you can just add a line like the following (with the comment's character at the start of the line removed) ##<> ##TAG:TRANSLATION-HEADER-START ~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: [[ca/Latex|Català]] - [[de/Latex|Deutsch]] - [[Latex|English]] - [[es/Latex|Español]] - [[fr/Latex|Français]] - [[it/Latex|Italiano]]-~ ##TAG:TRANSLATION-HEADER-END (!) [[/Discussion|Discussion]] ---- This page describes how to set up a LaTeX distribution on Debian. == Installation == There is only one LaTeX distribution available for Debian: TeX Live. Depending on how many features you need, you can choose one of the following packages to install: * DebianPkg:texlive - a decent selection of packages that should suffice for the most common tasks. * DebianPkg:texlive-base - essential programs and files required for any TeX system (no LaTeX). * DebianPkg:texlive-full - a metapackage which pulls in all the relevant texlive packages. There are also several add-on macro packages available: * DebianPkg:texlive-games * DebianPkg:texlive-humanities * DebianPkg:texlive-music * DebianPkg:texlive-pictures * DebianPkg:texlive-publishers * DebianPkg:texlive-science * DebianPkg:texlive-xetex If you want to add support for your language (other than english) in TeX Live, search for DebianPkg:texlive-lang and install your language. NOTE: If you choose to install DebianPkg:texlive-full, the above-mentioned add-on macro packages and texlive-lang-* packages will all be installed automatically. For all texlive packages, see DebianPkg:texlive or run {{{ aptitude search ~n^texlive }}} or, in case you do not have `aptitude` installed {{{ apt search '^texlive' }}} == Custom packages == If you want to install a custom TeX package that is not already in Debian's repositories, take a look at [[http://www.ctan.org|CTAN's web site]]. Download the package and extract it with `tar -xvf foo.tar.gz`. Enter the directory, if you see ''foo.ins'', run it trough LaTeX {{{ latex foo.ins }}} This generates ''foo.sty''. Now you have to copy it to the system LaTeX tree or your personal tree. After installation, you can use the new package by inserting '''\usepackage{foo}''' in the preamble of the document. We will show now, briefly, how to perform the installation in both cases, more detailed information can be found in the [[https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages#Installing_a_package|LaTeX wikibook]]. === User install === This method creates a personal ''texmf'' tree to your home folder. The files are installed only to the original user. Create the directory structure: {{{ mkdir -p ~/texmf/tex/latex/foo }}} It's a good idea to create separate subdirectories in ''latex'' for different custom packages. Copy the newly generated `foo.sty` to your tree. After this, update the LaTeX package cache with {{{ texhash ~/texmf }}} === System install === This method installs the package in the LaTeX system tree. The new package is available to all users. Create a new directory as root {{{ mkdir /usr/share/texmf/tex/latex/foo }}} Copy the new file `foo.sty` to the new folder, and update the LaTeX package cache {{{ texhash }}} == Basic usage == First, make sure the DebianPkg:texlive-binaries package is installed, which is the case if you have followed the installation process above. 1. Create or edit an input file `file.tex` 1. Running LaTeX {{{ latex file.tex }}} will create a `.dvi` file which can be opened using xdvi. 1. You can also produce a PDF directly using: {{{ pdflatex file.tex }}} == Editors == LaTeX files are plain-text files and thus can be edited with any text editor, like DebianPkg:nano, DebianPkg:vim or DebianPkg:emacs. In addition text editors such as [[https://wiki.debian.org/VisualStudioCode| Visual Studio Code]] can edit LaTeX files using extensions such as [[https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop|LaTex Workshop]]. There are also other text editors which can edit LaTeX files by means of extensions, for instance, `vim` with DebianPkg:vim-latexsuite and `gedit` with DebianPkg:gedit-latex-plugin. There are also GUI editors, which make editing and compiling the document more user friendly. * DebianPkg:gummi * DebianPkg:latexila * DebianPkg:lyx * DebianPkg:kile * DebianPkg:texmaker * DebianPkg:texworks * DebianPkg:texstudio == Documentation == * Documentation about the TeX Live LaTeX distribution is available through specific packages, e.g.: * DebianPkg:texlive-latex-base-doc * DebianPkg:texlive-latex-recommended-doc * DebianPkg:texlive-science-doc * Documentation for specific latex package or commands is then accessible using DebianMan:texdoc or DebianMan:texdoctk programs, e.g.: {{{ texdoc makeindex texdoc graphicx }}} == See also == * http://tug.org/texlive/ and http://tug.org/texlive/debian.html * [[http://tug.org/texlive/debian.html#vanilla|Vanilla TeX Live 2008 on Debian]] * [[http://en.wikibooks.org/wiki/Latex|Wikibook on LaTeX]] * [[https://www.overleaf.com/learn| Overleaf learn LateX]] ---- CategorySoftware