[texhax] verbatim environment problem

John C. Wheeler jcw at chemj2.ucsd.edu
Tue Feb 20 18:07:55 CET 2007


This seemed to work, although I don't understand why.
\documentclass[12pt]{article}
\usepackage{amsfonts}
\usepackage{alltt}
\begin{document}
\begin{alltt}
   ls .[\^\,.]*
\end{alltt}
\end{document}
Just putting a space after \^ gave too much space between the caret and 
the period.
John Wheeler
jcw at chemj2.ucsd.edu
+++++++++++++++++++++++++++
Barbara Beeton wrote:
> justin walker is trying to get the keyboard
> symbol ^ (circumflex) into a coding instruction
> in typewriter style:
>
> \begin{alltt}
>   ls .[^.]*
> \end{alltt}
>
> he got an error message about $ being added ...
>
> two suggestions involved math mode:
>
>   ls .[$^$.]*
>   ls .[$\uparrow$.]*
>
> to which i countered
>
>     > right diagnosis, inadequate solution.
>
>     Gee.  No one's ever called me inadequate before :-}
>
> er, that was the solution, not the instigator.
> i wouldn't dare tack that label on someone i've
> never met.  <g>
>
> more commentary:
>
>     > since the ^ indicates a superscript, the first
>     > suggestion will yield a complaint that it's
>     > incomplete.
>
>     I don't see the complaint in the log file.  I'm using TeXShop on Mac OS X,
>     and all I see is some 'underfull \hbox' babble.  No other complaints.
>
> i'm not sure why there wasn't an error, but see below
> for justin's description of the output (pdf file was
> attached to his message, but not included here).
>
> i also pointed out that
>
>     [...] the \uparrow isn't the same shape.
>
> and suggested a (plain tex) trick:
>
>   ls .[\char`\^.]*
>
> from justin:
>
>     This may be a simple matter of fonts, but I get the following (forgive the
>     PDF in-line), where the order is as above (with your version last):
>
>     [pdf omitted]
>     
>     To me, the 'uparrow' in the second line looks most correct.  The third
>     looks like a 'caret'; the first, like a lowered 'caret' on a '.'.
>
>     Am I missing something?
>
> the uparrow is in the symbol font, not typewriter.
> in the first example, the circumflex appears as an
> accent since it wasn't given an empty place-marker
> so it would appear by itself.
>
> the third example, however, appears exactly as it
> does in my mail reader, with the exact ^ character
> as it appears in the cmtt font.  admittedly, i am
> using a low-resolution monospace font for reading mail,
> since it's important for me to be able to distinguish
> input niceties like this.  i suspect justin is using
> some "fancier" font, so he's not used to seeing the
> "old-fashioned" monospace teletype style.
>
> since justin advertises himself thusly,
>
>     Justin C. Walker, Curmudgeon-At-Large
>     Institute for the Absorption of Federal Funds
>
> i can assure him that i've practiced long and hard
> to be just as curmudgeonly as he is (just ask any
> of my colleagues on the tugboat production team!
> <g>), though i don't seem to have found such a
> reliable source of funding.
> 							-- bb
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
>   



More information about the texhax mailing list