26 July 2008 by Stefan Kottwitz
Recently Michael Downes collection of TeX challenges “Around the Bend“, originally in ASCII format, has been typeset in pdf format by Peter Wilson and has now been released on CTAN.
The document contains exercises posing a problem and one or several solutions.
Category: plain TeX |
No Comments »
17 July 2008 by Stefan Kottwitz
The stampinclude package v1.0 has been released. It replaces \includeonly and will select the files for inclusion by inspecting the time stamp of the .aux files. Files will be selected for inclusion if the .aux file doesn’t yet exist or if it’s older than the corresponding .tex file. stampinclude does a similar job like the askinclude package but not interactively. The pdftex command \pdffilemoddate is internally used, \include is redefined and \includeonly is ignored.
Category: LaTeX General |
No Comments »
17 July 2008 by Stefan Kottwitz
A new beamer class based presentation introducing LaTeX has been released these days. The author Dr. Engelbert Buxbaum created this presentation for a LaTeX course at the Biochemistry faculty at RUSM and released it for use under GNU Copyleft. It’s based on the tex-kurs by Rainer Rupprecht, translated to English using additional info from l2short. The source code is available too. For download see it’s CTAN directory.
Category: Presentations, LaTeX General |
No Comments »
15 July 2008 by Stefan Kottwitz
In addition to the shell scripts mentioned in this post I wrote another small script:
#!/bin/bash
# texcd - change into the directory
# corresponding to a certain tex related file
if [ $# -eq 0 ]; then
echo 1>&2 Usage: . texcd filename [pattern]
echo 1>&2 examples: . texcd beamer.cls
exit 1
fi
cd `kpsewhich $1 | sed 's/\(.*\)\/.*$/\1/'`
echo Changed to: `pwd`
It’s purpose is to change into the directory where a certain tex related file resides. For instance if you want to search through some beamer class theme files, you don’t have to know the directory, just type
. texcd beamer.cls
and you will enter (for instance) the directory /usr/share/texmf/tex/latex/beamer/base/. The dot at the beginning of the command is important. Thats one reason why I show this small script too. Normally if you change the directory inside a script, after the script is finished you will be back inside the directory where you were before, because the script starts a new shell for itself. If you want to run the commands inside your current shell you can use the source command, the dot I’ve used is just an abbreviation for source.
Some additional hints I didn’t mention in the other post: instead of putting the scripts into your home directory you could copy them into your local file system, for instance:
sudo cp texcd /usr/local/bin/
and those scripts should be made executable using chmod:
chmod a+x /usr/local/bin/texcd
Thats recommendable for the other scripts too.
Category: Tools for LaTeX, Linux/ Ubuntu Linux |
2 Comments »
14 July 2008 by Stefan Kottwitz
If you include a picture within a pdf document and view it with the Adobe Reader you may notice a change of color under certain circumstances. Let’s test this png file:
This short example will be enough to produce a pdf by pdflatex:
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{test}
\end{document}
You may compile by yourself or look at the pdf output. Here’s a screenshot of the Adobe Reader:
Nice blue color, but not the original one. Compare this color with a screenshot of the open source pdf viewer Evince:
Because most people use the freely available Adobe Reader it may be necessary to fix this issue. I found a solution by converting the color mode from RGB to an indexed palette using the freely available open source software GIMP. Here is the changed png file, and here the pdf file, finally the screenshot:
Using GIMP it’s possible to automate the conversion by GIMP’s batch mode using the procedure gimp-image-convert-indexed.
This topic was discussed in the LaTeX Community Forum.
Category: Graphics |
2 Comments »
12 July 2008 by Stefan Kottwitz
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.
Category: plain TeX |
No Comments »
12 July 2008 by Stefan Kottwitz
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.
Possible solutions are: to 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.
Category: Presentations, plain TeX |
3 Comments »
11 July 2008 by Stefan Kottwitz
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.
Category: plain TeX |
No Comments »
10 July 2008 by Stefan Kottwitz
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:
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.
Category: Tools for LaTeX, Linux/ Ubuntu Linux |
6 Comments »
8 July 2008 by Stefan Kottwitz
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.
Category: Tools for LaTeX, Linux/ Ubuntu Linux |
No Comments »