Archive for the ‘Typography’ Category
Creating an A5 booklet from A4 paper with pdfpages
In the example below, lipsum.pdf is an A5-sized PDF file.
\documentclass[a4paper]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-, nup=1x2, booklet=true, landscape]{lipsum.pdf}
\end{document}
Or for an RTL layout book:
\includepdf[pages=-, nup=1x2, booklet=true, landscape, angle=180]{lipsum.pdf}
Create a local MikTeX package repository
MikTeX’s package manager has a pretty feeble download utility, which is quite susceptible to network interruptions, etc. An option is to download the lzma files using another utility (like Free Download Manager, a recent find). To do this one needs to create a local package repository, which in the MikTeX docs sounds like a horrendous process of downloading the entire archive. In fact…
- Create a folder
- Download
In MikTeX, the geometry package suddenly stopped working (possibly related to LyX)
Recently I installed and then uninstalled LyX. Shortly thereafter (immediately? I can’t recall), I started getting this error whenever I included the geometry package:
! Extra \else.
\Gm@detectdriver ...m@setdriver {xetex} \fi \else
\ifx \Gm@driver \Gm@xetex ...
l.46 \begin{document}
?
! Emergency stop.
\Gm@detectdriver ...m@setdriver {xetex} \fi \else
\ifx \Gm@driver \Gm@xetex ...
l.46 \begin{document}
After uninstalling and reinstalling many packages, it turned out to be the oberdiek package that needed to be replaced. I’m not at all sure of the LyX connection, but that did seem to be the proximate cause of the difficulty.
RTL text, LTR footnotes
As a matter of creating the proper output, the issue of RTL text with LTR footnotes has been solved by XeLaTeX, bidi, and polyglossia.
Things get messy in writing the input. It’s simply awkward to have an RTL paragraph with LaTeX commands in the middle of it. [This is really a problem with mixing text directions in a single document; I'm not claiming that there's some specific behavior that makes sense.]
یک \footnote{one}دو
If that is viewed in LTR mode, the visual order of the RTL chunks is messed up, and the footnote looks like it’s attached to the wrong block of text. If that is viewed in RTL mode, the LaTeX command is shown distorted.
A solution to this would be some kind of WYSIWYG interface. It happens that LyX provides this, but cannot handle Unicode Arabic text. There is lots of bragging in the LyX docs about how it can output proper Arabic text, but it can’t actually join the letters when you’re editing the document (and doesn’t order them properly, for that matter). This makes LyX a little worse than useless, because it’s not immediately apparent that this limitation can’t be overcome.
The best of the bad solutions seems to be using a regular text editor. Using Notepad++ there is an easy way to switch between RTL and LTR document mode (Ctrl+Alt+R, Ctrl+Alt+L). With liberal switching back and forth (and of course, between keyboards as well), the process becomes less painful. Particularly with code such as the following, the RTL text is rendered correctly in RTL mode, and the LTR text is rendered correctly in LTR mode.
یک%
\footnote{One} %
دو
Until a better solution is found…
Insert characters around characters in XeLaTeX (for RTL languages)
In typesetting RTL documents in XeLaTeX, I have found that characters such as colons or parentheses don’t set properly—adjacent numbers disappear, etc. The code below makes TeX place empty hbox’s around each colon in a document. No further references to macros are necessary.
\def\colon{:}
\catcode`:=\active
\def:{\hbox{}\colon\hbox{}}
tipa times mathpazo/txfonts Error
Compatibility issue with the LaTeX packages times, tipa, and mathpazo and txfonts. If mathpazo or txfontsis invoked after the other two, then the TIPA font does not switch to the Times-compatible version.
\usepackage{times}
\usepackage{tipa}
\usepackage[osf]{mathpazo}
\usepackage{txfonts}
If these two packages are invoked after these, then the TIPA font comes out correctly. You don’t get lowercase numbers without the \oldstylenums command, though, which is a hassle.
\usepackage[osf]{mathpazo}
\usepackage{txfonts}
\usepackage{times}
\usepackage{tipa}