Hi guys
I have encountered a strange problem on trying to set up a simple build script. I don’t know if it’s a bug, a fault of mine or a feature.
I wanted a simple script which just calls pdflatex on the currently editing file. So my script goes like this:
{
"cmd": "pdflatex", "$file"],
"file_regex": "^(...*?):([0-9]+): ([0-9]*)(^\\.]+)",
"selector": "source.tex"
}
It’s saved under sublime-text-2/Packages/User/LaTeX.sublime-build
It just doesn’t work when editing .tex files (Pressing f7 or selecting build from the menu).
Strangely enough, it works on non .tex-files. E.g. if i have opened a file ‘test.txt’ and I press f7, pdflatex gets called on it (and generates an error, obviously):
[code]This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(/home/wassuup/Desktop/test.txt
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, ngerman, german, german-x-2009-06-19, ngerman-x-2009-06-19, loaded.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…
l.1 T
hat’s a test.
?
! Emergency stop.
…
l.1 T
hat’s a test.
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
[Finished][/code]
The only way to get it to work is to replace ‘$file’ in the build file with the hardcoded name of the file I’m editing, E.g.
{
"cmd": "pdflatex", "serie10.tex"],
"file_regex": "^(...*?):([0-9]+): ([0-9]*)(^\\.]+)",
"selector": "source.tex"
}
Naturally, this is not usable at all because I have to change it in the build script every time I edit another file. If build autodetect is on or off (I select LaTeX from the list manually then) doesn’t matter.
Thanks in advance for your help!