ashthespy / Atom-LaTeX

The only LaTeX package you need for typesetting with Atom.
https://atom.io/packages/atom-latex
MIT License
22 stars 9 forks source link

Filenames with dots #213

Closed ashthespy closed 4 years ago

ashthespy commented 4 years ago

Follow up from #211 @maxb2 could you give this a shot? It should be more robust, while maintaining some flexibility still.

The logic is to strip known extensions, (.tex and .tikz by default along with ones defined in the latex_ext key)

This should allow for such cases:

Filename %DOC %EXT latex_ext
foobar.tex foobar tex
foo.bar.tex foo.bar tex
foo.bar.tikz foo.bar tikz
foobar.tex.tikz foobar tex.tikz ['tex.tikz']
foo.bar.tex.tikz foo.bar tex.tikz ['tex.tikz']

Should be noted that when using latex_ext it should be expected to go in and change the build toolchain arguments to include %EXT

maxb2 commented 4 years ago

This does work for files named foo.bar.tex with the default toolchain. However, files like file.tex.tikz don't work because it tries to compile file.tex. I'd recommend changing the default toolchain to %TEX %ARG %DOC.%EXT && %BIB %DOC && %TEX %ARG %DOC.%EXT && %TEX %ARG %DOC.%EXT

pdftex can take the whole filename as an argument. It's probably a better idea to always pass it %DOC.%EXT so you don't have to build special rules for each extension.

ashthespy commented 4 years ago

Done, thanks for the help! :-)

maxb2 commented 4 years ago

Awesome! Thanks for working on this!