7f35 How do FreeBSD users LaTeX? [Archive] - The FreeBSD Forums

PDA

View Full Version : How do FreeBSD users LaTeX?

Allamgir
October 5th, 2009, 16:17
I'm considering leaving Arch Linux for FreeBSD once 8 comes out, but I need a good LaTeX setup. How do the other TeX-ies around here do it? I really shy away from many GUI solutions like Kile or Texmaker. The CLI is where it's at. However, if there's some super awesome GUI solution, I'll check it out as long as it works in a tiling wm (I like XMonad).

Some things I would really like:
-Powerful syntax highlighting
-Easy compilation to PDF and side by side preview (not necessarily live, but I would like it to update whenever I compile)
-Time savers like autocompletion to end environments, placeholders, macros, etc.
-Look nice. If the GUI looks toally out of place on my system, I'll be hesitant to use it. I like the CLI because text is so consistent.
-I'll post more if I think of any.

Vim? Vim-latexsuite? Emacs and AUCTeX? Gedit with a plugin? What is the best LaTeX solution around here?

Oxyd
October 5th, 2009, 17:38
What is "the best" is highly subjective. For me, editors/vim, print/latex for writing, with KPDF and KDVI for viewing (both from graphics/kdegraphics3) do the job.

What setup do you use on Arch? You can most likely use exactly the same setup on FreeBSD as well.

RandomSF
October 5th, 2009, 17:48
texlive (http://www.tug.org/texlive/) is not hard to download and install is one of the better, more complete variants you'll find.

Allamgir
October 5th, 2009, 21:59
Thanks for the replies!

Well, on Arch I haven't had a complete setup in a while (since I've been OS hopping for a while and FreeBSD has just piqued my interest). I've tried emacs + AUCTeX, but I found it complicated to set up — it's complicated to learn, but I don't mind that so much. At one point I just edited the tex source with vim and compiled separately, although I found it a slight hassle to type everything longhand and then open a new terminal to compile, then constantly update my PDF viewer by reopening the file.* Vim-latexsuite sounds interesting, but I couldn't find it in ports. Is it there/available somewhere else?

*What's a PDF viewer that updates automatically upon changes to the file?

RandomSF
October 5th, 2009, 22:03
I use the AUCTeX plugin for vim and xpdf for viewing. Just press R to refresh after compiling a new file. No need to close and re-open.

Allamgir
October 5th, 2009, 22:09
There's AUCTeX for vim? I definitely need to look this up! This (http://www.vim.org/scripts/script.php?script_id=162) is what you're talking about, right? It doesn't seem to have been updated in a while, so either that means it's dead or it's pretty much perfect (I'm hoping for the latter, since I haven't found vim-latex for FreeBSD in a way I can easily keep up to date). And I didn't know xpdf had that feature!

Oxyd
October 5th, 2009, 22:12
Also in vim, you can just type :!latex source.tex to compile, later on it's just :! and the Up arrow which will recall the latex command from history. Or you can write a Makefile and use the :make command. :e

As for completion, there are completion plugins for vim, although I'm not a big fan of them. You may want to look for some, though.

RandomSF
October 5th, 2009, 22:15
Yes, Allamgir, that's the one. It may not be perfect, but most everything you would want is there and it's easy to modify.

vivek
October 5th, 2009, 23:44
gedit user here.
http://sourceforge.net/projects/gedit-latex/

Allamgir
October 6th, 2009, 00:44
Gedit seems tempting, but doesn't it pull in a bunch of GNOME dependencies?

Allamgir
October 6th, 2009, 02:59
Hey oxyd, I found this trick that when entering an external command in vim,
% means the file name. So I can just run :!pdflatex %

just thought you might like to know that :)

October 6th, 2009, 06:24
@Allamgir

I usually add print/tetex and print/makeindex pacakges and type whole document with plain vi/vim.

I also used geany in the past.

-Powerful syntax highlighting
Works with both vi/vim and geany.

-Easy compilation to PDF and side by side preview (not necessarily live, but I would like it to update whenever I compile)
I use pdflatex for that which is part of tetex port.

I also launch the new PDF every time I generate it, like that:

#! /bin/sh

TARGET=document
LATEX="pdflatex -halt-on-error"

[ $? -eq 0 ] &&${LATEX} ${TARGET} [$? -eq 0 ] && bibtex ${TARGET} & [$? -eq 0 ] && makeindex ${TARGET}.idx & [$? -eq 0 ] && ${LATEX}${TARGET} | tail
[ $? -eq 0 ] &&${LATEX} ${TARGET} | tail [$? -eq 0 ] && ${READER}${TARGET}.pdf &

I use it with simple Makefile, so everytime I want to create new PDF, I just type make, same for cleaning, a script for cleaning all generated stuff is cleared with make clean.

-Time savers like autocompletion to end environments, placeholders, macros, etc.
If I remember geany autocompletes stuff, but vi/vim do not, at least not stock vim.

Also, about macros you mentioned, I just use my functions in LaTeX, for code listings, for putting images and so ...

vivek
October 6th, 2009, 14:21
Actually, I've Gnome installed and I liked the simplicity of gedit. YMMV.

dennylin93
October 6th, 2009, 14:26
I use Vim to do the editing, although I occasionally open up Texmaker. It's possible to set a key combination for building the PDF files in Vim.

graudeejs
October 6th, 2009, 15:04
have you tried lyx? I like it

RandomSF
October 6th, 2009, 15:07
Lyx, while nice for a beginner, makes LaTeX that is hard to maintain. If you are working alone, it may work very well, but when several people are working on a doc and some of them work directly with the TeX doc, as experienced LaTeXers generally do, they will not be happy.

Oko
October 6th, 2009, 18:56
I'm considering leaving Arch Linux for FreeBSD once 8 comes out, but I need a good LaTeX setup. How do the other TeX-ies around here do it?
We don't. We are waiting Hiroki Sato to port TeXLive to FreeBSD from 2001 or something like that. In the mean time if you really need to use TeX with BSD you have two options. One is two switch to OpenBSD or more recently to NetBSD. The other one is to use unofficial port of Romain Tartière which is not allowed to ports three because we do not want to hurt Mr. Sato's feelings.

Allamgir
October 6th, 2009, 19:16
What's wrong with teTeX? Slackware uses that too.

October 6th, 2009, 19:20
What's wrong with teTeX? Slackware uses that too.

I also use tetex without any problems, dunno whats the case generally.

Oko
October 6th, 2009, 19:30
What's wrong with teTeX? Slackware uses that too.
It is dead since 2005! TeXLive is only official distribution of TeX and friends for *nix. If you were serious TeX user you would know why teTeX is useless for advanced work.

Allamgir
October 6th, 2009, 21:12
Normally I just write some essays and reports, etc. occasionally with some mathematics and Greek letters. I use the default font or Latin modern, and I set the margins with the geometry package. As long as tetex can handle that and maybe some more, I'm OK.

But how have we not yet ported texlive? I would think the FreeBSD community could do it within 4 years!

October 6th, 2009, 23:28
It is dead since 2005! TeXLive is only official distribution of TeX and friends for *nix. If you were serious TeX user you would know why teTeX is useless for advanced work.

I wrote my whole master's thesis in tetex and find it fully usable:

But maybe I do not use some real advanced features, I do not feel like \texitit{LaTeX} expert by any means.

Allamgir
October 6th, 2009, 23:35
It looks like vermaden has plenty of graphics, non-English characters (which I normally don't need, but I hate when WYSIWYG or some other document/word processors have strange boxes and alignment issues with them), a well-organized table of contents and index, etc. I didn't really see any mathematics, but I would assume they work fine since the original TeX was designed to typeset math well way back in the 20th century ;)

So far what I'm planning to do now is use vim to edit .tex files by hand, maybe without any macros or helpers (if it really is a pain then I'll look at auctex.vim or something else), and use normal CLI commands to do my compiling. I'll view with xpdf since it has that awesome R for refresh feature.

jrick
October 7th, 2009, 04:42
For me it's vim and Texlive (I installed it manually). I also prefer to use xelatex because of its excellent support for OpenType fonts.

mix_room
October 7th, 2009, 08:33
But maybe I do not use some real advanced features

It is hard to say if you use advanced features or not. To me it looks like you have long document with some images included, where the images were taken from other sources \includegraphics[file.eps]

More complicated stuff would include drawing the images directly in LaTeX, tikz for example: http://www.texample.net/tikz/examples/timing-diagram.

Basically anything where MS Office (or OpenOffice.org) would suffice is simply in my mind. TOC, well organized bibliography, etc etc are the basis on which LaTeX is built.

October 7th, 2009, 09:38
It is hard to say if you use advanced features or not. To me it looks like you have long document with some images included, where the images were taken from other sources \includegraphics[file.eps]

Most of the graphics are SVG images exported as PDF in Inkscape (because I havent found a way to import SVG images into LaTeX), there are also some PNG/JPG.

mavio% cat functions.tex
% --< FUNCTIONS >-- %
% \code{df.output}{df -h}
% \cmd{cmd_xm_list.output}{Wynik polecenia xm list.}
% \nicequote{Stan Lee}{With great power comes great responsibility.}
% \notion{AMD-V}
% \todo{co to ja mialem tu zrobic?}
% \logo{150mm}{drawing.pdf}{opis}
% \imagequiet{150mm}{drawing.pdf}{opis}
% \image{drawing.pdf}{opis}
% \imagewidth{80mm}{drawing.pdf}{opis}
% \imageborder{drawing.pdf}{opis}
% \imageborderscale{drawing.pdf}{opis}
% \imageborderwidth{150mm}{drawing.pdf}{opis}

\definecolor{gray0}{rgb}{0.8, 0.8, 0.8}
\definecolor{gray1}{rgb}{0.4, 0.4, 0.4}

\newcommand{\nicequote}[2] % usage: \nicequote{Stan Lee}{With great power comes great responsibility.}
{
\begin{quotation}
\small
\textit{"#2"}
\end{quotation}
\begin{flushright}
\textbf{\textit{#1}}
\end{flushright}
}

\newcommand{\code}[2] % usage: \code{df.output}{df -h}
{
\begin{figure}[!h]
\centering
\fvset{frame=leftline}
\fvset{framerule=1mm}
\fvset{framesep=2mm}
\fvset{rulecolor=\color{gray0}}
\fvset{formatcom=\color{gray1}}
\fvset{numbers=left}
\fvset{numbersep=2mm}
\VerbatimInput{#1}
\caption{#2}
\label{#1}
\end{figure}
}

\newcommand{\cmd}[2] % usage: \cmd{cmd_xm_list.output}{Wynik polecenia xm list.}
{
\begin{figure}[!h]
\centering
\fvset{frame=topline}
\fvset{framerule=1mm}
\fvset{framesep=2mm}
\fvset{rulecolor=\color{gray0}}
\fvset{formatcom=\color{gray1}}
\VerbatimInput{#1}
\caption{#2}
\label{#1}
\end{figure}
}

\newcommand{\logo}[3] % usage: \imagequiet{150mm}{drawing.pdf}{opis}
{
\begin{figure}[!h]
\makebox[\textwidth][r]
{
\includegraphics[width=#1]{#2}
}
\makebox[\textwidth][r]
{
#3
}
\end{figure}
}

\newcommand{\imagequiet}[3] % usage: \image{80mm}{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\includegraphics[width=#1]{#2}
\\
\small{#3}
\end{figure}
}

\newcommand{\image}[2] % usage: \image{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\includegraphics[scale=0.75]{#1}
\caption{#2}
\label{#1}
\end{figure}
}

\newcommand{\imagewidth}[3] % usage: \imagewidth{80mm}{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\includegraphics[width=#1]{#2}
\caption{#3}
\label{#2}
\end{figure}
}

\newcommand{\imageborder}[2] % usage: \imageborder{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\setlength \fboxsep{2.0pt}
\setlength \fboxrule{2.0pt}
\fcolorbox{gray0}{white}{\includegraphics[scale=0.75]{#1}}
\caption{#2}
\label{#1}
\end{figure}
}

\newcommand{\imageborderscale}[2] % usage: \imageborderscale{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\setlength \fboxsep{2.0pt}
\setlength \fboxrule{2.0pt}
\fcolorbox{gray0}{white}{\includegraphics[width=150mm]{#1}}
\caption{#2}
\label{#1}
\end{figure}
}

\newcommand{\imageborderwidth}[3] % usage: \imageborderwidth{150mm}{drawing.pdf}{opis}
{
\begin{figure}[!h]
\centering
\setlength \fboxsep{2.0pt}
\setlength \fboxrule{2.0pt}
\fcolorbox{gray0}{white}{\includegraphics[width=#1]{#2}}
\caption{#3}
\label{#2}
\end{figure}
}

\newcommand{\notion}[1] % usage: \notion{AMD-V}
{
\index{#1}
\textit{#1}\xspace
}

\newcommand{\todo}[1] % usage: \todo{co to ja mialem tu zrobic?}
{
\textbf{TODO:} #1
\xspace
}

mavio% cat thesis.skel
\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[polish]{babel}
\selectlanguage{polish}
\usepackage{indentfirst} % for: (indent first parapgrapch after \section)
\usepackage{mathpazo} % for: (nice font)
\usepackage{multicol} % for: columns
\usepackage{color} % for: \color
\usepackage{url} % for: \url
\usepackage{fancyvrb} % for: \VerbatimInput
\usepackage{natbib} % for: \cite
\usepackage{graphicx} % for: \includegraphics
\usepackage{xspace} % for: \xspace (remove stupid spaces)
\usepackage{hyperref} % for: \hypersetup
\usepackage{makeidx} % for: \makeindex
\usepackage{setspace} % for: \onehalfspacing (1.5 spacing)
\usepackage[font=small,labelfont=bf,up]{caption} % for: \caption
\makeindex
\onehalfspacing

\hoffset = 0pt
\voffset = 0pt
\oddsidemargin = 0pt
\topmargin = 0pt
\textheight = 675pt
\textwidth = 455pt
\marginparsep = 0pt
\marginparwidth = 0pt
\footskip = 15pt
\marginparpush = 0pt

\hypersetup
{
pdftitle={WIRTUALIZACJA SYSTEMÓW OPERACYJNYCH - Sławomir Wojciech Wojtczak},
pdfauthor={Sławomir Wojciech Wojtczak},
pdfsubject={WIRTUALIZACJA SYSTEMÓW OPERACYJNYCH},
pdfkeywords={virtualization}, % keywords
pdffitwindow=true, % fit to window
pdfnewwindow=true, % links in new window
unicode=true, % use unicode
urlcolor=blue, % color of external links
citecolor=blue, % color of bibliography links
filecolor=blue % color of file links
}

\input{functions.tex}

\begin{document}

\input{ch_cover/content.tex}

\small
\tableofcontents
\normalsize

\chapter*{Wstęp}
\input{ch_intro/content.tex}

\input{ch_01/content.tex}

\chapter{Dostępne maszyny wirtualne}
\input{ch_02/content.tex}

\chapter{Wydajność maszyn wirtualnych}
\input{ch_03/content.tex}

\chapter{Przyszłość wirtualizacji}
\input{ch_04/content.tex}

\chapter{Podsumowanie}
\input{ch_05/content.tex}

\chapter*{Technikalia}
\input{ch_tech/content.tex}

\bibliographystyle{plainnat} % other: unsrtnat/cell/jas99/abbrvnat
\bibliography{thesis.bib}
\input{SKEL}

\listoffigures

\printindex

\end{document}

Example snip from content.tex file, generally no magic there:
\vspace{20mm}

\section{Emulacja}

Na koniec wyjaśnijmy jeszcze czym jest \notion{emulacja} systemu
operacyjnego. Polega ona na stworzeniu wirtualnego środowiska,
które w praktyce dla systemu guest jest postrzegane jako
kompletny komputer. Wszystkie elementy wirtualnego komputera są
programowo emulowane, między innymi takie jak CPU, RAM, HDD,
GPU, BIOS i CD. Emulator, to więc nic innego jak kolejna
aplikacja działająca w trybie ring 3, co przedstawia
\textbf{rysunek \ref{ch_01/emulator.pdf}}. Potrzebuje on jednak
o wiele więcej zasobów niż typowa aplikacja aby realizować swoje
\\

\imageborder{ch_01/emulator.pdf}{\textit{Emulator} jest po
prostu kolejną aplikacją działającą w systemie.}

Wielką zaletą emulacji jest możliwość emulowania systemów, które
wymagają innej architektury sprzętowej niż architektura systemu
host, na przykład emulacja architektury PowerPC na
najpopularniejszej aktualnie architekturze i386, było to swego
czasu popularne dzięki emulatorowi \notion{PearPC}, który był
wykorzystywany do uruchamiania systemu \notion{Mac OS X} na
systemach Windows. Aktualnie najpopularniejszymi aplikacjami,
zapewniającymi emulację są na \notion{QEMU} \footnote{QEMU wraz
z modułem \textit{kqemu} może również służyć jako maszyna
wirtualna} oraz \notion{Bochs}.
\\

(...)

\begin{itemize}
\item \textbf{Equivalence (równoważność)} - Program działający
pod kontrolą wirtualizacji powinien zastać środowisko identyczne
jak w przypadku bezpośredniego działania na tym sprzęcie.

\item \textbf{Resource Control (kontrola zasobów)} - Monitor

\item \textbf{Efficiency (wydajność)} - Instrukcje w
większości muszą być wykonywane bez interwencji monitora.
\end{itemize}

More complicated stuff would include drawing the images directly in LaTeX, tikz for example: http://www.texample.net/tikz/examples/timing-diagram.

Basically anything where MS Office (or OpenOffice.org) would suffice is simply in my mind. TOC, well organized bibliography, etc etc are the basis on which LaTeX is built.

Ok, thanks for an example.

Generally it will be far easier (and faster) for me to draw something similar in Inkscape as SVG and then export it to PDF and inclide info LaTeX document, but maybe if you know LaTeX very good its faster.

October 7th, 2009, 09:48
-- I would do that in 1 post, but 10 000 character limit per post forces me to double post.

We don't. We are waiting Hiroki Sato to port TeXLive to FreeBSD from 2001 or something like that. In the mean time if you really need to use TeX with BSD you have two options. One is two switch to OpenBSD or more recently to NetBSD. The other one is to use unofficial port of Romain Tartière which is not allowed to ports three because we do not want to hurt Mr. Sato's feelings.

There is no texlive in ports but ...

I have just downloaded texlive2008-20080822.iso from torrents (search for texlive2008 keyword), mounted it as usual, started installer install-tl and everything installed without any problems at /usr/local/texlive/2008

# cd /mnt
# ls bin | grep freebsd
amd64-freebsd
i386-freebsd
# ./install-tl
======================> TeX Live installation procedure <=====================

=======> Note: Letters/digits in <angle brackets> indicate menu items <=======
=======> for commands or configurable options <=======

Detected platform: Intel x86 with FreeBSD

<B> binary systems: 1 out of 15

<S> Installation scheme (scheme-full)
83 collections out of 84, disk space required: 1720 MB

Customizing installation scheme:
<C> standard collections
<L> language collections

<D> directories:
TEXDIR (the main TeX directory):
/usr/local/texlive/2008
TEXMFLOCAL (directory for site-wide local files):
/usr/local/texlive/texmf-local
TEXMFSYSVAR (directory for variable and automatically generated data):
/usr/local/texlive/2008/texmf-var
TEXMFSYSCONFIG (directory for local config):
/usr/local/texlive/2008/texmf-config
TEXMFHOME (directory for user-specific files):
~/texmf

<O> options:
[ ] use letter size instead of A4 by default
[X] create all format files
[X] install macro/font doc tree
[X] install macro/font source tree
[ ] create symlinks in standard directories

<V> set up for running from DVD

Other actions:
<I> start installation to hard disk
<H> help
<Q> quit

Enter command:

After reading post install message and modifying my PATH:
See
/usr/local/texlive/2008/index.html
for links to documentation. The TeX Live web site (http://tug.org/texlive/)

TeX Live is a joint project of the TeX user groups around the world;
please consider supporting it by joining the group best for you. The
list of groups is available on the web at http://tug.org/usergroups.html.

to your PATH for current and future sessions.

Welcome to TeX Live!

My master's thesis built with texlive without any problems and looks the same as the one built using tetex package.

mavio% echo \$PATH
/usr/local/texlive/2008/bin/i386-freebsd:/sbin:/bin:(...)

mavio% make
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
(...)
LaTeX2e <2005/12/01>
Babel <v3.8l>
(...)
This is makeindex, version 2.15 [20-Nov-2007] (kpathsea + Thai support).
This is BibTeX, Version 0.99c (Web2C 7.5.7)
Output written on thesis.pdf (89 pages, 2016890 bytes).

So there is an almost instant and easy way to have fully working Tex Live 2008 on FreeBSD.

July 17th, 2010, 13:16
The other one is to use unofficial port of Romain Tartière which is not allowed to ports three because we do not want to hurt Mr. Sato's feelings.

... so a 'great' news to all LaTeX/TeXLive users here, since Hiroki Sato has been elected to FreeBSD's core team for the next 2 years, if he suck so much, why he gets elected? (as other here say)

source: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=11461+0+current/freebsd-announce

fronclynne
July 17th, 2010, 20:07
... so a 'great' news to all LaTeX/TeXLive users here, since Hiroki Sato has been elected to FreeBSD's core team for the next 2 years, if he suck so much, why he gets elected? (as other here say)

source: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=11461+0+current/freebsd-announce

I'm dubious about Oko's generous & factual statements (running openBSD regularly can lead to some unexpected social side-effects, or so I hear (http://mail-index.netbsd.org/current-users/1996/10/20/0004.html)), but instead of gum-flapping about political rumours why don't you try e-mailing the gentleman in question and asking him directly?

July 18th, 2010, 10:25
but instead of gum-flapping about political rumours why don't you try e-mailing the gentleman in question and asking him directly?

I generally do not care about all that LaTeX stuff, my works are working with TeTeX package and I have TeXLive 2008 in case.

fronclynne
July 18th, 2010, 20:48
I generally do not care about all that LaTeX stuff, my works are working with TeTeX package and I have TeXLive 2008 in case.

Ah, I just realised that you were probably arguing against the slander. My apologies.