9 December 2008 by Stefan Kottwitz
Though pdflatex provides the command \pdfannot for pdf annotations it is somehow complicated to use. The new package pdfcomment offers a user-friendly way to insert comments/ annotations into pdf files.
pdfcomment requires the packages hyperref, xkeyval, ifpdf, marginnote and packages needed by them.
pdfcomment provides options for subject, author and color of annotations, supports icons used as graphics for pdf annotations.
For further information you could have a look at
Category: Tools for LaTeX, LaTeX General |
No Comments »
7 August 2008 by Stefan Kottwitz
Here’s an example illustration made with Jpgfdraw following a drawing in Singer/Thorpe Lecture Notes in Elementary Topology and Geometry, I made freehand it to illustrate homotopy of paths in my notes.
Screenshot:
Output in pdf format: homotopy.pdf
Jpgfdraw binary file: homotopy.jdr
exported tex file: homotopy.tex
LaTeX main document:
\documentclass[a4paper,10pt]{article}
\usepackage[landscape]{geometry}
\usepackage{amsmath,pgf}
\pagestyle{empty}
\begin{document}
\centering
\input{homotopy}
\end{document}
Category: Tools for LaTeX, IDEs and Editors, Graphics, Mathematics |
No Comments »
2 August 2008 by Stefan Kottwitz
The vector graphics application for LaTeX users Jpgfdraw beta version 0.5b has been released today.
The author Nicola Talbot announced:
Jpgfdraw is a graphics application written in Java. You can use Jpgfdraw to:
- Construct shapes using lines, moves and cubic Bezier segments;
- Edit shapes by changing the defining control points;
- Incorporate text and bitmap images (for annotation and background effects);
- Extract the parameters for TeX’s \parshape command and for \shapepar (defined in the shapepar package);
- Construct frames for use with the flowfram package;
- Pictures can be saved in Jpgfdraw’s native binary format (JDR) or native ascii format (AJR) or can be exported as:
- a pgfpicture environment for use in LaTeX documents with the pgf package;
- a LaTeX2e package based on the flowfram package;
- an encapsulated postscript file;
- a PNG image file;
- an SVG image file;
- Incorporate text and bitmap images (for annotation and background effects);
- Alternative text may be specified for use when exporting to a LaTeX file (e.g. if the text contains symbols or if it should be set in maths mode);
- Mappings may be used to specify what LaTeX font declarations should be used when exporting to a LaTeX file.
That sounds very promising. I made a quick test today with Ubuntu Linux 8.04. After installing sun-java6-jre I downloaded and installed jpgfdraw-0.5b-us. It worked immediately. For the test I created a drawing and exported it into a pgf picture, tex format. After including it into a tex document and compiling I got the error Illegal unit of measure (pt inserted). It was caused by the numbers of the export file, they were using a comma instead of a decimal point. That problem is mentioned in the Jpgfdraw FAQ, but contrary to the FAQ it is still occuring with version 0.5b as I noticed using the locale de_DE.UTF-8.
After correction It worked perfectly, the drawing was displayed with high quality. Jpgfdraw could establish itself as a very useful tool.
Links:
Category: Tools for LaTeX, IDEs and Editors, Graphics |
1 Comment »
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 »
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 |
No 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 »