Archive for the ‘Linux’ Category

Latex in Inkscape

Textext is an excellent Plugin to render Latex formulas in Inkscape. Features are editing of formulas after they have been rendered and loading of latex packages in advance. Latter is especially useful for customizing latex fonts. The installation is straight forward:

Editing Latex formulas in Inkscape works like a charm using Textext.

Installation

1. You need to install Pdflatex and Pdf2Svg at first: Direct Install or

sudo apt-get install texlive-latex-extra pdf2svg

2. Download Textext Plugin for Inkscape from the Textext Side

Direct Download: textext-0.4.4.tar.gz

3. Unzip the file into the Inkscape Plugin folder

Inkscape 0.47:    ~/.config/inkscape/extensions/

Inkscape > 0.47:  ~/.inkscape/extensions/

4. After restarting Inkscape you find the Textex Plugin  in the Extensions menu:

Mathematica 7.02 on Linux – Direct Download

Wolfram provided an updated version of Mathematica 7  with the filename M-LINUX-L-7.0.2-1376260 that works much better on Ubuntu and removes among others things the annoying Java bug that caused Mathematica to take 15% of the CPU in idle.

Wolfram Mathematica 7.02 Download Page (Direct Download)

(It does not get rid though of well-known issues, for example the tremendous slowdown of the user interface for large notebooks.)

Ubuntu 10.4.1 – Released !

Latex in Examples – Greek Unicode Letters / Hypperref

An example how to use greek utf enconded text letters, like τ,Γ,π,ω…, as direct input method in latex instead of $\tau$, $\Gamma$, $\pi$,$\omega$… . Each letter requires a newcommand in the preface.

PDF: greek_unicode.pdf

Files: greek_unicode.zip

Latex Code

\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}

%small letters
\newcommand\textalpha{\ensuremath{\alpha}}
\newcommand\textgamma{\ensuremath{\gamma}}
\newcommand\textpi{\ensuremath{\pi}}
%capital letters
\newcommand\textGamma{\ensuremath{\Gamma}}
\newcommand\textPi{\ensuremath{\Pi}}
\begin{document}

Formula using Latex standard math environments versus unicode:

\begin{eqnarray*}
\mathrm{latex input} &  & \mathrm{unicode} \\
\alpha & \Leftrightarrow & α\\
\gamma \Gamma & \Leftrightarrow & γ Γ \\
\pi \Pi & \Leftrightarrow & π Π
\end{eqnarray*}

\end{document}

Hypperref Problem

When the hypperref package is used additionally  some greek letters cannot be defined via the \newcommand anymore, such as \textmu and \textbeta.  The error looks something like that

! LaTeX Error: Command \textmu unavailable in encoding OT1.
! LaTeX Error: Command \textbeta unavailable in encoding OT1.

A workaround is to remove the error causing commands and load additionally the tipa package and the textcomp package, that will do the trick.

\documentclass[10pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}
\usepackage{tipa,textcomp}

%small letters
\newcommand\textalpha{\ensuremath{\alpha}}
\newcommand\textgamma{\ensuremath{\gamma}}
\newcommand\textpi{\ensuremath{\pi}}
%capital letters
\newcommand\textGamma{\ensuremath{\Gamma}}
\newcommand\textPi{\ensuremath{\Pi}}

\begin{document}

μ, β, α, γ, π, Γ, Π

\end{document}

Latex in Examples – figure, subfloat & minipage

An example how to arrange three pictures  in columns and rows.

Files:  subfloat_1

PDF: examples

Latex Code

\documentclass[10pt,a4paper,draft]{article}
\usepackage[utf8x]{inputenc}

\usepackage{graphicx}%
\usepackage{subfig}%

\begin{document}

\begin{figure}[ht]
\begin{minipage}{0.62\textwidth}
\subfloat[]{\label{subfig:a}\includegraphics[width=1\textwidth]{fcc}}%
\end{minipage}\quad %
\begin{minipage}{0.33\textwidth}%
\subfloat[]{\label{subfig:b}\includegraphics[width=1\textwidth]{fcc}}\\%
\subfloat[]{\label{subfig:c}\includegraphics[width=1\textwidth]{fcc}}%
\end{minipage}%

 \label{fig:diamond_lattice}
 \caption{Face-Center-Cubic - \ref{subfig:a}  \ref{subfig:b} \ref{subfig:c} }

\end{figure}

Huge Latex Tables with Dokuwiki

(Ubuntu 9.04 – Jaunty Jackelope , Kernel 2.6.28-13-generic, Gnome 2.26.1)

I got stucked when I tried to render bigger tables with the nice open source web application Dokuwiki using the Latex Block Parser plugin ending in a simple Latex word left.

Rendering small Latex tables in the Dokuwiki will work even with label and caption options using the syntax

<latex>
\begin{table}[ht]
\centering
\begin{tabular}{c c c }
\hline
11 &amp; 12 &amp; 13 \\
21 &amp; 22 &amp; 23 \\
31 &amp; 32 &amp; 33 \\
\hline
\end{tabular}
\caption{This is a Caption}
\label{tab:optimizing_methods}
\end{table}
</latex>

which is definately pretty cool. So you can easily copy your whole table written in Latex to the Dokuwiki. But coming to that point, that did not work for tables which have long captions, lots of rows / columns and many information. The reason are arbitrary limitations by the renderer made inside the the file

dokuwiki/lib/plugins/latex/class.latexrender.php

Open it, scroll a bit down and find the lines saying

    var $_xsize_limit = 500;
    var $_ysize_limit = 500;
    var $_string_length_limit = 500;

I changed  the numbers to 1000, 1000 and 1500, whereas the former two give the maximum width and height of the rendered output image in whatever units the latex renderer uses. The string length limit changes the maximum amount of characters for rendering, which can be much higher than 500 for big tables. I changed it to 1500, which seemed to be enough for my purposes.

So far I haven’t experienced any complications.

eps to pdf / eps to svg / svg to pdf

epstopdf

Für Latex ist das Programm epstopdf zu bevorzugen, man findet es im texlive-extra-utils

apt-get install texlive-extra-utils

Das Programm ist einfach zu bedienen, beispielsweise

epstopdf datei.eps

gibt als output datei.pdf.

Nachtrag: Es gibt Probleme beim öffnen mancher PDFs, die wohl auf fehlende Schriftarten zurückzuführen sind. Zurzeit hab ich dafür keine Lösung.

eps to svg

Hm, man kann pstoedit benutzen, aber irgendwie funktioniert der Spaß nicht einwandfrei. Eine einfache und schnelle Methode ist das epstopdf (siehe oben). Nun könnt ihr die PDF mit Inkscape öffnen und als SVG speichern.

Einfachere Wege?

svg to pdf

Die svg-Datei am besten mit Inkscape öffnen und unter Speichern als… als *.pdf speichern.

Es gibt auch diverse andere Programme auf Linux wie pstoedit oder convert aus der graphicsmagick Bibliothek, die direkt umwandeln können, aber die oben angegeben Wege erziehlen aus eigener Erfahrung bessere Ergebnisse.

Return top