[OS X TeX] Re: The listings package; pdf or text from pdf searches
John Maindonald
john.maindonald at anu.edu.au
Tue Aug 14 07:52:57 EDT 2007
I find that if for example I have 'dir()' in code that is used in the
listings environment given below, then using Preview on the
pdf file that results, I have to search for 'd i r ( )', i.e. spaces
must be placed between characters.
I tried pdftotext (a binary xpdf-tools-3.dmg that will install this
under
MacOS X is available from http://users.phg-online.de/tk/MOSXS/ )
The text appears as 'dir ()', i.e., it removes most of the spaces,
but leaves the space that precedes the '('.
'file.show("travelbooks.txt")' appears, in the file from pdfotext, as
'file . show ( " travelbooks . txt " )'
I've tried several pdf to text conversion utilities; all seem to give
much the same result.
Does anyone know of a good way to use the listings package,
and/or some alternative choice of pdf to text conversion software,
that creates a file where the text is searchable pretty much as
one would expect? Is there a choice of listings options
(a different basicstyle?) that avoids the unwanted spaces?
\definecolor{light}{gray}{.9}
\lstnewenvironment{verbcode}
{\lstset{language=R, xleftmargin=2pt, frame=single, framerule=0pt,
basicstyle=\ttfamily,
showstringspaces=false, backgroundcolor=\color{light}}}
{}
John Maindonald.
John Maindonald email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473 fax : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the MacOSX-TeX
mailing list