# [TxMt] LaTeX - Insert Label Based On Current Word

Sun May 27 11:19:33 UTC 2007

```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?

> 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)
> 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