[XeTeX] [OS X TeX] Unexpected quotation marks

Peter Dyballa Peter_Dyballa at Web.DE
Tue Jun 12 00:21:34 CEST 2007


Am 11.06.2007 um 22:53 schrieb Herbert Schulz:

> I know this won't give a problem most of the time but wouldn't it run
> into problems if a directory name contains a `!' in its name? I guess
> the probability of having "!!" is much lower although still not zero.

Herb,

you're right! The reason I inserted tr into the pipe was that Michael  
reported the sed expression would not work. I later found that in a  
(t)csh context it would need to be

	set SYS_BIBINPUTS=`kpsewhich --show-path=bib | sed -e 's/\\!\\!//g'`

but did not think of this when I thought of a solution.


Thinking now a bit more relaxed of the filter, a better version would  
be:

	export BIBINPUTS=${BIBINPUTS}:`kpsewhich --show-path=bib | sed -e  
"s,:\!\!/,:/,g"`
	set SYS_BIBINPUTS=`kpsewhich --show-path=bib | sed -e 's,:\\!\ 
\!/,:/,g'`

It is *very* likely that ``.´´ will be the first element in the path  
that kpsewhich returns. And it is as likely as this that the next  
element will be the personal area and it's not indexed, either.  
Anyway, it is quite sure that the string of paths will have ``:!!/´´  
– so let's filter exactly these!

The expression for sed can take any 7 bit US-ASCII character as  
delimiter, the forward slash is most often used because it's not that  
often used in spoken or written text. The condition is that the  
delimiter is neither part of from nor of to. The comma is a good  
choice because it has no "meta quality" as ;, #, ., or | have. + or -  
work as well.


I wanted to address another issue: the multiple occurrence of  
slashes, i.e. a series like ``//´´or ``///´´ at the end of some  
paths. I am not sure that this does *not* render these path elements  
useless. I'd recommend to clean them also:

	export BIBINPUTS=${BIBINPUTS}:`kpsewhich --show-path=bib | sed -e  
"s,:\!\!/,:/,g" -e s+///++g -e s+//++g`
	set SYS_BIBINPUTS=`kpsewhich --show-path=bib | sed -e 's-:\\!\\!/-:/- 
g' -e s-///--g -e s-//--g`


--
Greetings

   Pete

Math illiteracy affects 7 out of every 5 Americans.




More information about the XeTeX mailing list