[TxMt] Patch for LaTex Bundle

Xavier CAMBAR xcambar at gmail.com
Fri Apr 20 16:27:24 UTC 2007

I needed to insert tex files which filenames contained spaces into my  
document. LaTex can handle this efficiently if quotes are provided in  
the \include (like in \include{"bla bla/bla bla"}).

For easy moving along my document,  I intended to use the "Open  
Included File" command. But that command doesn't handle the quoted  
filenames, as the quotes are taken into account as normal characters.
So here I am with a line to be added to that command in order to  
correct that misbehaviour:

10:  ...
11:  if options.empty?
12: 	 print "Did not find any appropriate item to open in #{ENV 
['TM_SELECTED_TEXT'] ? "selection" : "current line" }"
13:  else
14:   options[0].each{|el| el.gsub!(/(^\")?(\"$)?/, '')}       #<--  
Here it is!
15:   filepath = `kpsewhich #{e_sh options[0]}`.chomp
16:   if filepath.empty?
17:   ...

I don't know how to commit changes in a bundle (according I am  
allowed to!). So now it's up to you, folks, to add it to the repository.
Note that I quickly and unformally tested it, and everything seems ok.

  Xavier Cambar

More information about the textmate mailing list