[XeTeX] escaping the pipe

Herbert Schulz herbs at wideopenwest.com
Wed Mar 3 02:00:14 CET 2010


On Mar 2, 2010, at 6:46 PM, maxwell wrote:

> This has to be simple, but nothing I've tried works, and I can't seem to
> find any ideas on-line...
> 
> I want to output something like
>   a {b|c} d
> from XeLaTeX.  I've managed to get part way there by escaping the curly
> braces in the input, but I can't figure out how to escape the pipe
> character.  That is, if I try
>   a \{a|b\} d
> (i.e. without escaping the pipe), then the pipe overwrites the 'a' to its
> left.  Or if I try
>   a \{a\|b\} d
> then XeLaTeX apparently tries to interpret the pipe character as a
> command, which of course it doesn't know how to do.  I even tried
>   a \{a\\|b\} d
> in which case the pipe looks right, but I get a newline immediately after:
>   a {b|
> c} d
> 
> I don't think it matters, but this is inside a \begin{alltt} environment.
> 
> Surely there's an easy way to do this?
> 
>   Mike Maxwell
> 

Howdy,

What monospace font are you using?

I've go no problem using the Monaco font on a Mac:

\documentclass{article}

\usepackage{xltxtra}
\setmonofont[Scale=MatchLowercase]{Monaco}

\usepackage{alltt}

\begin{document}
\begin{alltt}
a \{b|c\} d
\end{alltt}
\end{document}

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)





More information about the XeTeX mailing list