[TxMt] LaTeX - Insert Label Based On Current Word

Daniel Sönnerstedt daniel.sonnerstedt at gmail.com
Sun May 27 13:55:30 UTC 2007


Haris Skiadas wrote:
>
> On May 27, 2007, at 6:40 AM, Daniel Sönnerstedt wrote:
> > LaTeX - Insert Label Based On Current Word
> >
> > I didn't get this feature to work on my project. I experimented a bit
> > and it seemed like the script was having troubles dealing with
> >
> >   \include{"filename.tex"}
> >
> I actually have tried using filenames this way, and I find that LaTeX
> doesn't process the corresponding file, unless you remove the .tex
> part in the above line. Is there some package you need to use to make
> this work with the .tex part?

You're right. I wasn't thinking when I wrote the example code. Of
course it actually should say
	\include{"filename"}


> I'll commit your patch.
>

Great. I bought TextMate yesterday after trying it out for a few
weeks, and I'm already contributing. This is fun.

> > but not with
> >
> >   \include{filename.tex}
> >
> > I use this since I have filenames with spaces. So I skimmed through
> > the code and added a small fix in LaTeXUtils.rb:
> >
> >    def find_file(filename, extension, relative)
> >      filename.gsub!(/\.#{extension}$/,"")
> >      [...]
> >    end
> >
> > became
> >
> >    def find_file(filename, extension, relative)
> >      filename.gsub!(/\"/,"")                          # Added this
> > to strip ":s
> >      filename.gsub!(/\.#{extension}$/,"")
> >      [...]
> >    end
> >
> > And now it works!
> >
> > Now, I'm not a ruby programmer so there's is probably some better way
> > to solve this. But I think that this fix should benifit others;
> > perhaps implemented in a more proper way though.
> >
> > Thanks for another great LaTeX-bundle-feature.
> >
> > Regards,
> > Daniel Sönnerstedt
>
> Haris Skiadas
> Department of Mathematics and Computer Science

Daniel Sönnerstedt



More information about the textmate mailing list