Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass an option containing a space to a package in LaTeX/XeLaTeX

Tags:

latex

tex

xelatex

When I declare an option containing a space, LaTeX/XeLaTeX eats it.

In the main .tex, I have :

\usepackage[test font]{test}

In my .sty file I have :

\DeclareOption*{\newfontfamily\testfont[Scale=1]{\CurrentOption}}
\ProcessOptions

But the Tex engine passes to the package testfont option and not test font.

So the question is how to pass the option containing the space to the package.

like image 613
anno Avatar asked Apr 20 '10 13:04

anno


2 Answers

Protect it with braces

\usepackage[{test font}]{test}
like image 180
Joseph Wright Avatar answered Nov 15 '22 11:11

Joseph Wright


Try


\catcode`\ =11
\usepackage[test font]{test}
\catcode`\ =10

This is quite likely to fail, but the failure might be progress on what we have so far.

like image 44
Charles Stewart Avatar answered Nov 15 '22 10:11

Charles Stewart