TeX by Topic: back in print

The very recommendable book TeX by Topic by Victor Eijkhout, originally published by Addison-Wesley 1991, is now available printed and bound from lulu.com. The author himself announced it today in the usenet group comp.text.tex.

The book has been published under GNU Free Documentation License 2007 and will remain downloadable from savannah.nongnu.org. It’s also available on the author’s homepage.

Even if it’s freely available I recommend to purchase this really great book to support the author. And of course to have a printed version. Its 319 pages are paperback bound to keep the price low at €11.30.

12. July 2008 by stefan
Categories: Uncategorized | Leave a comment

Beamer: frame number in split theme footline

Yet again somebody in the mrunix forum asked for an advice how to put the frame number into the footline of his beamer presentation. He was using the “Warsaw” outer theme. The first solution

\setbeamertemplate{footline}[frame number]

will just overwrite the “Warsaw” footline.

Edit 2021: A very short solution proposed by samcarter on LaTeX.org is:

\setbeamertemplate{page number in head/foot}[totalframenumber]

Full code by samcarter:

\documentclass{beamer}
\usetheme{Warsaw}
\title{Beamer Example}
\setbeamertemplate{page number in head/foot}[totalframenumber]
\begin{document}
\begin{frame}
abc
\end{frame}
\end{document}

Old way posted 2008: We could use a different outer theme or to change the “Warsaw” footline. “Warsaw” uses the split outher theme, a workaround for insertion of the frame number should consider that and will be usable for other themes like “Copenhagen”, “Luebeck” and “Malmoe”. Inspection of the file beamerouterthemesplit.sty reveals that the footline uses the \insertshorttitle macro in its right part. So a quick workaround could be to redefine that macro:

\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
  \oldmacro\hfill%
  \insertframenumber\,/\,\inserttotalframenumber}

If you want to see more details you could look at example source code and its pdf output.

This topic was discussed on mrunix.de and in the Matheplanet forum.

12. July 2008 by stefan
Categories: Uncategorized | 24 comments

pdfTeX 1.40.8 released

The new stable release of pdfTeX 1.40.8 has been released. pdfTeX is an extended TeX version with the ability to create pdf files directly from TeX source files supporting pdf specific features. Changes include:

  • Implementation of SyncTeX,
  • incorporated the new TeX version 3.1415926,
  • use of the current public release libpng 1.2.29,
  • bugfixes.

For more information see pdfTeX News page on tug.org.

11. July 2008 by stefan
Categories: Uncategorized | Leave a comment

Updating babel

Today I had seen a post on mrunix.de where a user called for help, after an update of his MiKTeX installation he was not able to compile even simple latex files. Quickly it turned out that there had to be a problem with babel, because it was compilable without that package. Of course I wanted to help and I installed the same babel version on my TeXlive system, with the result that no tex file was compilable any more that used babel. I found out that there was a problem with hyphen.cfg. babel.def called a macro that’s defined by hyphen.cfg but the compiler said it wasn’t defined.

hyphen.cfg can be loaded into the format files, so I rebuilt all my format files:
fmtutil --all
Problem solved, at least for me, because the mrunix questioner uses MiKTeX. The corresponding call for MiKTeX should be
initexmf --dump
but of course I booted Windows to test that. I’ve purchased Windows Vista (Business) with my Computer but generally I don’t use it, so to give some advice is a good reason to start that OS. I started MiKTeX Update, updated babel and tried to compile a simple file using babel by TeXnicCenter, as anticipated it did not compile. Instead of calling initexmf I tested the way using MiKTeX Options:

miktex rebuild format

Called MiKTeX Option in the Windows start menu, changed to the Format tab, clicked the pdflatex format and then the Build button. This way I only rebuilt the pdflatex profile, afterwards pdflatex was working fine again together with babel.

To sum up, one could say that if you update the babel package or if you want to use a new language with babel or change hyphenation, it’s recommendable to rebuild the format files as described above.

This topic was discussed on mrunix.de.

10. July 2008 by stefan
Categories: LaTeX Distributions, MiKTeX | 8 comments

Speed up the work by shell scripts

When writing LaTeX and redefining macros I frequently have to look at the source code of macros in LaTeX class files or plain TeX sources. I got used to kpsewhich, find, grep and xargs, but because I needed it often it became necessary to speed it up.
In order to find and edit tex files of the tex distribution I normally used kpsewhich with backticks like
gedit `kpsewhich scrartcl.cls`
And in order to find the source of a certain macro (beside show) I used find and grep together with xargs.

A simple way to speed it up is to use shell scripts. For the tasks above I wrote two bash scripts today. The first equivalent to the one-liner above called texedit is:

#!/bin/bash
# texedit - find one or several tex related files
#   and open them in the editor
if [ $# -eq 0 ]; then
  echo 1>&2 Usage: texedit file1 [file2] ...
  exit 1
fi
gedit `kpsewhich $@`
exit 0

With it I just call for instance
texedit latex.ltx report.cls article.cls
to open these three files in the editor, no matter where they are in the texmf tree.
The other script called texgrep is:

#!/bin/bash
# texgrep - searches for a text pattern contained in files
#   located inside the texmf trees
# usage: texgrep pattern [extension]
# usage examples:
#   texgrep phantomsection sty
#   texgrep \\def\\phantomsection
# Stefan Kottwitz, 2008
if [ $# -eq 0 ]; then
  echo 1>&2 Usage: texgrep pattern [extension]
  exit 1
fi
for path in TEXMFMAIN TEXMFDIST TEXMFHOME
do
 find `kpsewhich --var-value=$path` -name "*$2" |xargs grep $1
done
exit 0

I’ve described the usage inside the comments of the script together with an example. I’ve already used those scripts several times and will use similar commands for similar tasks.

Just another example, calles texls:

#!/bin/bash
# texls - list the content of the directory
#   corresponding to a certain tex related file
if [ $# -eq 0 ]; then
  echo 1>&2 Usage:    texls filename [pattern]
  echo 1>&2 examples: texls babel.sty
  echo 1>&2           texls book.cls *clo
  exit 1
fi
ls `kpsewhich $1 | sed 's/(.*)/.*$/1//'`$2
exit 0

If I want to list all files inside the directory of the babel package, I just type:
texls babel.sty
If I want to list all the language definition files of babel, I call:
texls babel.sty *ldf
Or to list all class option files of the LaTeX base classes:
texls book.cls *clo
After I found what I was looking for I usually call texedit.

The scripts are written for my own use with Ubuntu Linux and TeXlive, it should be easy to customize them for other needs and different Unix platforms.

I’ve posted similar scripts to a discussion on mrunix.de.

08. July 2008 by stefan
Categories: Tools for LaTeX | Leave a comment

New package: xstring

xstring by Christian Telllechea has been released today. The package provides macros for the manipulation of strings. Some Features:

  • tests, if one string is contained in another string (n times),
  • extraction of substrings in several ways,
  • substitution of some or all occurrences of a substring,
  • numerical calculations with string length, position of nth occurence of a substring etc.

You will find the package and its documentation on CTAN.

07. July 2008 by stefan
Categories: News | Leave a comment

listings.sty with KOMA classes on TeX Live 2007-13 (Ubuntu 8.04, hardy)

When I tried to help somebody to solve a problem in the LaTeX Community Forum, I wrote a short test file, but it was not compilable though it contained just basic commands. I reduced it to the following minimal example:

\documentclass[a4paper,10pt]{scrartcl}
\usepackage{listings}
\begin{document}
\lstlistoflistings
\end{document}

It was not compilable with TeXlive 2007 on Ubuntu Linux 8.04, the error message was:
! Undefined control sequence.
\lstlistoflistings ...\lol@heading \@parskipfalse
    \@parskip@indent \@startto...
l.5 \lstlistoflistings

After examining listings.sty it seemed to be just a compatibility issue: the listings version 1.3 of 2004/09/07 distributed with the texlive-latex-recommended package of Ubuntu Linux 8.04 (hardy) just doesn’t work with the scrartcl class of KOMA-Script v2.95b (2006/07/30) that comes with TeXlive 2007-13.

For instance scrartcl.cls v2.8 used \@parskip internally together with the parskip/halfparskip/parindent options, but that’s been changed.

After installation of version 1.4 of the listings package by the MiKTeX package manager the compilation was successful.

The line

\@parskipfalse\@parskip@indent%

of listings v1.3 had been changed in v.1.4 to

\parskip\z@\parindent\z@\parfillskip \z@ \@plus 1fil%

I’ve sent a bugreport by launchpad expecting that the new version of listings.sty will be distributed with the texlive package soon.

05. July 2008 by stefan
Categories: Uncategorized | Leave a comment

CQF.info is back

CQF.info, a forum on maths, finance and LaTeX was down for one week, today I noticed it’s back up. Currently the most recent post dates from Wed Jun 25, 2008. Good to see that it’s up, it would be a real pity to loose its content. Reading the message about the last unplanned downtime 1 month ago I expect the forum to be supported further on.

03. July 2008 by stefan
Categories: Uncategorized | Leave a comment

Adobe Reader 9 released

I’ve read it today in the Adobe Reader Weblog: the version 9 of the reader has been released. But: until know there’s no Linux version. It’s said that the new version suppports flash, launches faster and more, but I will not boot Windows just to test that. I will add an information if a Linux version would be released.

01. July 2008 by stefan
Categories: Uncategorized | Leave a comment

The MiKTeX Package Manager 2.7 on Ubuntu Linux 8.04 LTS (Hardy Heron)

The MiKTeX Package Manager (mpm) is a tool originally intended for MiKTeX users on Windows platforms. It was ported by Christian Schenk for unix systems, to provide easy access to the MiKTeX package repository also for unix user. There are some docs describing installation and use, some are obsolete now, that’s why I will give a summary how I’ve installed the mpm on the latest Ubuntu Linux version today.

The mpm sources can be downloaded from http://miktex.org/unx.

Important: have a look at the README.unx file! Below are the commands I applied during installation.

Installation of some required packages in addition to the basic setup:
$ sudo apt-get install g++ cmake libcurl3 libcurl4-gnutls-dev lynx

Decompress the archive, change into the created directory, run cmake to produce customized makefiles (I added options to use texmf in my home directory) , run make to compile and to install:
$ tar xfj miktex-2.7.2960.tar.bz2
$ cd miktex-2.7.2960/
$ cmake -G "Unix Makefiles" -DMIKTEX_INSTALLROOT="/home/stefan/texmf" -DMIKTEX_ROOTS="/home/stefan/texmf"
$ make
$ sudo make install

The MiKTeX Package Manager installation is complete. Create the file name database files:
$ sudo ldconfig
$ sudo initexmf -u
$ sudo mpm --update-db

Finally the mpm is ready to use.

Links:

01. July 2008 by stefan
Categories: Uncategorized | 32 comments

Ubuntu Linux 8.04 amd64 on Packard Bell imax 9000

The mainboard of my Shuttle ZEN XPC (ST62K) got broken recently, so I decided to look for a replacement. A big German chain of consumer electronics stores launched a campaign for just two days, I could not resist the temptation to buy a new computer 25% off. I purchased the Packard Bell imax X9000, running with a Q6600 (Quadcore) and GeForce 8600 GS.

The operating system installed does not meet my requirements, though it had to be purchased too. I downloaded the Ubuntu Linux 8.04 desktop amd64 iso, tried a first installation that failed. The next try with the alternate desktop iso was successful, Ubuntu was quickly installed. Until now I’m able to work with the 64bit version of Ubuntu 8.04 without any problems, using KILE 2.0 together with TeXlive2007 among other software.

From my perspective I can recommend the installation of the amd64 version of Ubuntu on a Q6600 system.

24. June 2008 by stefan
Categories: Uncategorized | 2 comments

blowup: new package for scaling pages

Today CTAN Announcements informed that the package blowup has been released. It can be used to upscale or downscale all pages of a document. For a first test I created this short a5paper document:

\documentclass[pdftex,a5paper,10pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
\tableofcontents
 
\section{One}
\blindtext[3]
 
\section{Two}
\blindtext[4]
 
\end{document}

It’s pdf output can be opened here. The pdfinfo tool printed:
Page size: 419.528 x 595.276 pts

Now I used the \blowUp macro to upscale the document pages to fit a4 paper size:

\documentclass[a5paper,10pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{blowup}
\blowUp{paper=a4}
\begin{document}
\tableofcontents
 
\section{One}
\blindtext[3]
 
\section{Two}
\blindtext[4]
 
\end{document}

The new pdf output can be opened here. pdfinfo output:
Page size: 595.276 x 841.89 pts (A4)

Of couse you could inspect the paper sizes by using the Adobe Reader.

The blowup package includes several source code examples. During the test I’ve noticed one small mistake in the documentation, the user-level macro \blowUp is described as \blowup, that will cause an error. But I’m sure this will be corrected soon, at least I will report it to the package author.

23. June 2008 by stefan
Categories: Uncategorized | 2 comments

← Older posts

Newer posts →