XeLaTeX (and ancient pdfLaTeX) compatibility

189 views
Skip to first unread message

Kevin Godby

unread,
Jun 16, 2008, 5:26:01 PM6/16/08
to tufte...@googlegroups.com
Hello, all.

I've started to add some more checks to tufte-handout.cls for XeLaTeX
and older versions of pdfLaTeX, but I'll need some help testing it
out.

So far, most of the problems are a result of the letterspacing code
(which tries to use either the microtype/letterspace package or the
soul package). The logic I'm currently using goes like this:

if using pdftex and version >= 1.40, then use letterspace package (if
installed, else try soul package).
if using pdftex and version < 1.40, use soul package (if installed).
if using xetex, use xetex fontspec letterspacing. (not yet
implemented; see plea for help below)

Can someone who's more familiar with XeLaTeX provide me with decent
default commands to set up typefaces and letterspacing similar to
what's being used in the pdfLaTeX version?

I've attached a copy of the tufte-handout.cls file that I'm working
on. If you're running XeLaTeX or an ancient version (<1.40) of
pdfLaTeX, could you test this and tell me what blows up?

Thanks for your help!

--Kevin

tufte-handout.cls

Bil Kleb

unread,
Jun 16, 2008, 5:35:53 PM6/16/08
to tufte...@googlegroups.com
Kevin Godby wrote:
> Hello, all.

Hi.

> I've attached a copy of the tufte-handout.cls file that I'm working
> on. If you're running XeLaTeX or an ancient version (<1.40) of
> pdfLaTeX, could you test this and tell me what blows up?

! Illegal parameter number in definition of \reserved@a.
<to be read again>
1
l.253 \@tufteh@loadsoul

with

$ pdflatex -v
pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
kpathsea version 3.5.4

on

\documentclass{tufte-handout}
\begin{document}
Hello.
\end{document}

Regards,
--
Bil Kleb

Kevin Godby

unread,
Jun 16, 2008, 5:40:45 PM6/16/08
to tufte...@googlegroups.com
Bil--

Can you send me your .log file as well? Thanks.

--Kevin

Bil Kleb

unread,
Jun 16, 2008, 5:54:21 PM6/16/08
to tufte...@googlegroups.com
Kevin Godby wrote:
> Bil--

Hi

> Can you send me your .log file as well? Thanks.

Yessir; attached.

Regards,
--
Bil Kleb
http://fun3d.larc.nasa.gov

hello.log

Kirk Lowery

unread,
Jun 16, 2008, 5:58:16 PM6/16/08
to tufte...@googlegroups.com
On Mon, Jun 16, 2008 at 5:26 PM, Kevin Godby <god...@gmail.com> wrote:

> I've started to add some more checks to tufte-handout.cls for XeLaTeX
> and older versions of pdfLaTeX, but I'll need some help testing it
> out.

I am an (enthusiastic) beginner with XeTeX/XeLaTeX, but I've been
using LaTeX and friends off and on for 15 years. I'm happy to be the
guinea pig for anything you're developing.

> So far, most of the problems are a result of the letterspacing code
> (which tries to use either the microtype/letterspace package or the
> soul package). The logic I'm currently using goes like this:
>
> if using pdftex and version >= 1.40, then use letterspace package (if
> installed, else try soul package).
> if using pdftex and version < 1.40, use soul package (if installed).
> if using xetex, use xetex fontspec letterspacing. (not yet
> implemented; see plea for help below)
>
> Can someone who's more familiar with XeLaTeX provide me with decent
> default commands to set up typefaces and letterspacing similar to
> what's being used in the pdfLaTeX version?

Here is what I use as a minimum for any standard document class and
tufte-latex, memoir and others. Right after \documentclass{TheClass} I
add the following:

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{TeX Gyre Schola}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{TeX Gyre Heros}
\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}

Change the font declarations to roman, sansserif and monospaced fonts
of your choice. Save your file as UTF-8 encoded. That's what XeTeX
expects.

I don't know about the letterspace issue. My first reaction would be
"don't need it; open type handles all the kerning, ligatures, spacing
issues," but hey! what do I know? There's a XeTeX discussion list
(http://tug.org/mailman/listinfo/xetex) where all the developers hang
out. You for sure will get the answers you need there.

Kirk

Kirk Lowery

unread,
Jun 16, 2008, 6:11:58 PM6/16/08
to tufte...@googlegroups.com
On Mon, Jun 16, 2008 at 5:26 PM, Kevin Godby <god...@gmail.com> wrote:

> I've attached a copy of the tufte-handout.cls file that I'm working
> on. If you're running XeLaTeX or an ancient version (<1.40) of
> pdfLaTeX, could you test this and tell me what blows up?

I ran this on a test file and it compiled just fine. Files attached
for your amusement. :-)

Kirk

P.S. I added an "alpha" to the version in the cls file so that I could
be sure I was invoking the test version of the class and not the
regular version I had installed earlier.

tufteTest.log
tufteTest.pdf
tufteTest.tex

Kevin Godby

unread,
Jun 16, 2008, 6:33:42 PM6/16/08
to tufte...@googlegroups.com
Bil--

I've attached a new version that should fix this. Let me know if it
still complains.

Danke.

--Kevin

tufte-handout.cls

Bil Kleb

unread,
Jun 16, 2008, 6:53:40 PM6/16/08
to tufte...@googlegroups.com
Kevin Godby wrote:
> I've attached a new version that should fix this. Let me know if it
> still complains.

Works for me; although I needed to add a title or,

! latex error: no \gdef \GenericError { }{LaTeX Error: No \title given}{See the LaTeX manual or LaTeX Companion for explanation.}{Try typing <r
eturn> to proceed.
If that doesn't work, type X <return> to quit.}{g}iven.

see the latex manual or latex companion for explanation.
Type H <return> for immediate help.
...

l.4 \end{document}

?

--
Bil Kleb

Kevin Godby

unread,
Jun 16, 2008, 7:21:04 PM6/16/08
to tufte...@googlegroups.com
On Mon, Jun 16, 2008 at 5:53 PM, Bil Kleb <Bil....@nasa.gov> wrote:
>
> Kevin Godby wrote:
>> I've attached a new version that should fix this. Let me know if it
>> still complains.
>
> Works for me; although I needed to add a title or,
>
> ! latex error: no \gdef \GenericError { }{LaTeX Error: No \title given}{See the LaTeX manual or LaTeX Companion for explanation.}{Try typing <r
> eturn> to proceed.
> If that doesn't work, type X <return> to quit.}{g}iven.
>

Great!

Yeah, that's on my list of things to fix. If you leave out the title
or author, the \maketitle command has issues. I'll add some checks to
handle that.

Reply all
Reply to author
Forward
0 new messages