SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 365 forks source link

Build fails #81

Closed juanfal closed 12 years ago

juanfal commented 12 years ago

When building a file.tex inside a path with spaces and utf8 chars, LTT fails opening the file with Skim. If you move to a safer path the same file, it opens the pdf file with Skim without any problems.

juanfal commented 12 years ago

It seems that the problem with utf-8 in the path to the tex file occurs just from the very beginning in the latex-compilation process:

The file is: [Compiling /Users/me/Desktop/años/pepe.tex]

although it appears in the message window as:

[Compiling /Users/me/Desktop/an~os/pepe.tex]

In parsing the log file there seems also to be problems:

Parsing log file Unable to auto detect encoding, using fallback encoding Western (Windows 1252)

The problem appears to be in the line jumpToPDF.py:19 where

    print "!TEX root = ", root

crashes the run process. (don't ask me why)

msiniscalchi commented 12 years ago

Great catch! Thanks. On Sep 30, 2012 9:24 AM, "juanfal" notifications@github.com wrote:

It seems that the problem with utf-8 in the path to the tex file occurs just from the very beginning in the latex-compilation process:

The file is: [Compiling /Users/me/Desktop/años/pepe.tex]

although it appears in the message window as:

[Compiling /Users/me/Desktop/an~os/pepe.tex]

In parsing the log file there seems also to be problems:

Parsing log file Unable to auto detect encoding, using fallback encoding Western (Windows 1252)

The problem appears to be in the line jumpToPDF.py:19 where

print "!TEX root = ", root

crashes the run process. (don't ask me why)

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9014050.

msiniscalchi commented 12 years ago

I just pushed a commit that should fix the issue. Closing for now.

juanfal commented 12 years ago

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

msiniscalchi commented 12 years ago

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

juanfal commented 12 years ago
Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

msiniscalchi commented 12 years ago

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

juanfal commented 12 years ago
The failure appears just in that line makePDF.py:320 when calling 

    data = open(self.caller.tex_base + ".log", 'r') \
            .read().decode(self.caller.encoding, 'ignore') \
            .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines()

I don't know what to do here

El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com escribió:

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

msiniscalchi commented 12 years ago

I'm really sorry about this, but I'm not sure what to do. That piece of code is supposed to handle the encoding; the only assumption it makes is that the tex log file uses the system's default encoding, which is UTF-8 on OS X. I guess this may be failing for you. It's weird, because it's working for me, but then again, you probably have a Spanish (just guessing) locale, whereas I have a US locale. Maybe that makes a difference.

I also found this thread, having to do with TeXlive more than any editor in particular. The bottom line is that non-ASCII path and file names are not really supported (the original poster complains that including a file with a German umlaut in the name fails).

http://macosx-tex.576846.n2.nabble.com/path-names-with-umlauts-td7388698.html

THere may not be much I can do about this. Is there any way you can check the encoding of the tex log file? I don't think ST2 gives you that information, but you can use "file -i " or "file -I " in the Terminal. See here:

http://stackoverflow.com/questions/539294/how-do-i-determine-file-encoding-in-osx

M

On Sun, Oct 7, 2012 at 6:51 AM, juanfal notifications@github.com wrote:

The failure appears just in that line makePDF.py:320 when calling

data = open(self.caller.tex_base + ".log", 'r') \ .read().decode(self.caller.encoding, 'ignore') \ .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines()

I don't know what to do here

El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com escribió:

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub<

https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9207292.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

juanfal commented 12 years ago
You are absolutely right…

$ file -I texput.log texput.log: text/plain; charset=us-ascii $ cat texput.log This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatexs12 2012.9.6) 7 OCT 2012 13:45 restricted \write18 enabled. %&-line parsing enabled. **/Users/juanfc/Desktop/an^^cc^^83o/hola.tex

! Emergency stop.

\begingroup <_> /Users/juanfc/Desktop/an^^cc^^83 o/hola.tex *_\* (job aborted, file error in nonstop mode) Here is how much of TeX's memory you used: 5 strings out of 482776 126 string characters out of 2994972 232736 words of memory out of 3000000 13902 multiletter control sequences out of 15000+200000 3938 words of font info for 15 fonts, out of 3000000 for 9000 957 hyphenation exceptions out of 8191 2i,0n,1p,47b,6s stack positions out of 5000i,500n,10000p,200000b,50000s ! ==> Fatal error occurred, no output PDF file produced! There are encoding problems there, for sure. Although those problems do not appear when you pass pdflatex directly on the file: $ pdflatex hola.tex This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) restricted \write18 enabled. (./hola.tex LaTeX2e <2011/06/27> Babel and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded. Style `Vmargin', V2.13, 26 Jun 1996 (./hola.aux) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/ucsencs.def) (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.tex (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )) (/usr/local/texlive/2012/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (/usr/local/texlive/2012/texmf-dist/tex/latex/base/ulasy.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/data/uni-0.def) [1{/usr/local /texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}](./hola.aux) Package rerunfilecheck Warning: File `hola.out' has changed. (rerunfilecheck) Rerun to get outlines right (rerunfilecheck) or use package`bookmark'. ) Output written on hola.pdf (1 page, 21959 bytes). Transcript written on hola.log. It must be because unnecessary use of the full path latexmk does… But when you call it from inside the folder it works like a charm: $ latexmk Latexmk: This is Latexmk, John Collins, 19 Aug. 2012, version: 4.33c. ***\* Report bugs etc to John Collins . **** Latexmk: applying rule 'latex'... Rule 'latex': Rules & subrules not known to be previously run: latex Rule 'latex': The following rules & subrules became out-of-date: ## 'latex' ## Run number 1 of rule 'latex' --- ## Running 'latex -recorder "hola.tex"' This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) restricted \write18 enabled. (./hola.tex LaTeX2e <2011/06/27> Babel and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded. Style `Vmargin', V2.13, 26 Jun 1996 (./hola.aux) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/ucsencs.def) (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.tex (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )) (/usr/local/texlive/2012/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (/usr/local/texlive/2012/texmf-dist/tex/latex/base/ulasy.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/data/uni-0.def) [1{/usr/local /texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}](./hola.aux) Package rerunfilecheck Warning: File `hola.out' has changed. (rerunfilecheck) Rerun to get outlines right (rerunfilecheck) or use package`bookmark'. ) Output written on hola.pdf (1 page, 21959 bytes). Transcript written on hola.log. Latexmk: References changed. Latexmk: Log file says output to 'hola.pdf' Latexmk: ===For rule 'latex', actual output 'hola.pdf' ======appears not to match expected output 'hola.dvi' Latexmk: applying rule 'latex'... Rule 'latex': File changes, etc: Changed files, or newly in use since previous run(s): 'hola.aux' ## 'hola.out' ## Run number 2 of rule 'latex' --- ## Running 'latex -recorder "hola.tex"' This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) restricted \write18 enabled. (./hola.tex LaTeX2e <2011/06/27> Babel and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded. Style `Vmargin', V2.13, 26 Jun 1996 (./hola.aux) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/ucsencs.def) (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.tex (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] )) (/usr/local/texlive/2012/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./hola.out) (./hola.out) (/usr/local/texlive/2012/texmf-dist/tex/latex/base/ulasy.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/ucs/data/uni-0.def) [1{/usr/local /texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}](./hola.aux) ) Output written on hola.pdf (1 page, 21959 bytes). Transcript written on hola.log. Latexmk: Log file says output to 'hola.pdf' Latexmk: ===For rule 'latex', actual output 'hola.pdf' ======appears not to match expected output 'hola.dvi' Failure to make 'hola.dvi' Latexmk: Errors, so I did not complete making targets Collected error summary (may duplicate other messages): latex: failed to create output file Latexmk: Use the -f option to force complete processing, unless error was exceeding maximum runs of latex/pdflatex. $ l total 96 -rw-r--r-- 1 juanfc staff 850B 8 oct 00:32:43 2012 hola.aux -rw-r--r-- 1 juanfc staff 3,7K 8 oct 00:32:43 2012 hola.fdb_latexmk -rw-r--r-- 1 juanfc staff 3,1K 8 oct 00:32:43 2012 hola.fls -rw-r--r-- 1 juanfc staff 5,6K 8 oct 00:32:43 2012 hola.log -rw-r--r-- 1 juanfc staff 0B 8 oct 00:32:43 2012 hola.out -rw-r--r-- 1 juanfc staff 21K 8 oct 00:32:43 2012 hola.pdf -rw-r--r-- 1 juanfc staff 197B 7 oct 13:42:26 2012 hola.tex Perhaps, it could be possible to change to the working directory before calling latexmk. When you call it from that working directory, it doesn't fill the log file with strange bad encoded chars! Thanks in advance Juan Falgueras El 07/10/2012, a las 16:12, msiniscalchi notifications@github.com escribió: > I'm really sorry about this, but I'm not sure what to do. That piece of > code is supposed to handle the encoding; the only assumption it makes is > that the tex log file uses the system's default encoding, which is UTF-8 on > OS X. I guess this may be failing for you. It's weird, because it's working > for me, but then again, you probably have a Spanish (just guessing) locale, > whereas I have a US locale. Maybe that makes a difference. > > I also found this thread, having to do with TeXlive more than any editor in > particular. The bottom line is that non-ASCII path and file names are not > really supported (the original poster complains that including a file with > a German umlaut in the name fails). > > http://macosx-tex.576846.n2.nabble.com/path-names-with-umlauts-td7388698.html > > THere may not be much I can do about this. Is there any way you can check > the encoding of the tex log file? I don't think ST2 gives you that > information, but you can use "file -i " or "file -I " in the > Terminal. See here: > > http://stackoverflow.com/questions/539294/how-do-i-determine-file-encoding-in-osx > > M > > On Sun, Oct 7, 2012 at 6:51 AM, juanfal notifications@github.com wrote: > > > The failure appears just in that line makePDF.py:320 when calling > > > > data = open(self.caller.tex_base + ".log", 'r') \ > > .read().decode(self.caller.encoding, 'ignore') \ > > .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines() > > > > I don't know what to do here > > > > El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com > > escribió: > > > > > Of course I believe you... it's just that I can't reproduce the issue on > > > my > > > machine. Which version of OS X and Texlive are you running? Just trying > > > to > > > figure out what might be causing the issue for you. > > > > > > On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com > > > wrote: > > > > > > > Humm! > > > > > > > > please watch the problem here… > > > > > > > > If you save a simple tex file inside a folder año it fails > > > > > > > > https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov > > > > > > > > the same file without utfs does fine. > > > > > > > > The problem appears just in makePDF.py:320. I have found it putting a > > > > sublime.error_message("Hi") around and it displays only if I put it > > > > just in > > > > the line before that. > > > > - > > > > > > > > El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com > > > > escribió: > > > > > > > > > Hmmm... I checked again, and it doesn't seem to happen on my machine > > > > > (running OS X Lion). To test, I created a directory called "años" > > > > > (yeah, > > > > > copied from your message!) and a simple tex file inside it. I was > > > > > able > > > > > to > > > > > compile the file, and Skim was invoked. No error message appears in > > > > > the > > > > > Console. > > > > > > > > > > Is this a multifile document? Just wondering what might be going > > > > > wrong. > > > > > > > > > > On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com > > > > > wrote: > > > > > > > > > > > humm! Now it fails in makePDF.py:320… it seems that > > > > > > > > > > > > self.caller.tex_base > > > > > > > > > > > > with utf chars breaks that call > > > > > > > > > > > > It didn't occur before. > > > > > > > > > > > > — > > > > > > Reply to this email directly or view it on GitHub< > > > > > > > > https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>. > > > > > > > > > ## > > > > > > > > > > Marciano Siniscalchi > > > > > Economics Department, Northwestern University > > > > > http://faculty.wcas.northwestern.edu/~msi661 > > > > > — > > > > > Reply to this email directly or view it on GitHub. > > > > > > > > — > > > > Reply to this email directly or view it on GitHub< > > > > https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733>. > > > > > > ## > > > > > > Marciano Siniscalchi > > > Economics Department, Northwestern University > > > http://faculty.wcas.northwestern.edu/~msi661 > > > — > > > Reply to this email directly or view it on GitHub. > > > > — > > Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9207292. > > ## > > Marciano Siniscalchi > Economics Department, Northwestern University > http://faculty.wcas.northwestern.edu/~msi661 > — > Reply to this email directly or view it on GitHub.
juanfal commented 12 years ago
FIXED!!!

As I found last tries, latexmk works as a charm when inside the problematic directory (that with utf8 chars), and then, only prepending "cd", "$project_path", seems to fix the problem!!!

    "cmd": ["cd",  "$project_path","latexmk", 
            "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
            //"-silent",
            "-f", "-pdf"],

:) Juan Falgueras

El 07/10/2012, a las 16:12, msiniscalchi notifications@github.com escribió:

I'm really sorry about this, but I'm not sure what to do. That piece of code is supposed to handle the encoding; the only assumption it makes is that the tex log file uses the system's default encoding, which is UTF-8 on OS X. I guess this may be failing for you. It's weird, because it's working for me, but then again, you probably have a Spanish (just guessing) locale, whereas I have a US locale. Maybe that makes a difference.

I also found this thread, having to do with TeXlive more than any editor in particular. The bottom line is that non-ASCII path and file names are not really supported (the original poster complains that including a file with a German umlaut in the name fails).

http://macosx-tex.576846.n2.nabble.com/path-names-with-umlauts-td7388698.html

THere may not be much I can do about this. Is there any way you can check the encoding of the tex log file? I don't think ST2 gives you that information, but you can use "file -i " or "file -I " in the Terminal. See here:

http://stackoverflow.com/questions/539294/how-do-i-determine-file-encoding-in-osx

M

On Sun, Oct 7, 2012 at 6:51 AM, juanfal notifications@github.com wrote:

The failure appears just in that line makePDF.py:320 when calling

data = open(self.caller.tex_base + ".log", 'r') \ .read().decode(self.caller.encoding, 'ignore') \ .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines()

I don't know what to do here

El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com escribió:

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub<

https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9207292.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

juanfal commented 12 years ago

Sorry, forget about my last fix… not well tested, although the idea was correct, the way latexmk is a bit cumbersome, the final fix is:

    "cmd": ["latexmk", "-cd",
            "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 `basename %S`'",
            "-silent",
            "-f", "-pdf"],

It only includes a -cd option to latexmk

Hope this helps

Thanks for your great, useful and really well supported tools

Sincerely Juan F.

FIXED!!!

As I found last tries, latexmk works as a charm when inside the problematic directory (that with utf8 chars), and then, only prepending "cd", "$project_path", seems to fix the problem!!!

    "cmd": ["cd",  "$project_path","latexmk", 
            "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
            //"-silent",
            "-f", "-pdf"],

:) Juan Falgueras

El 07/10/2012, a las 16:12, msiniscalchi notifications@github.com escribió:

I'm really sorry about this, but I'm not sure what to do. That piece of code is supposed to handle the encoding; the only assumption it makes is that the tex log file uses the system's default encoding, which is UTF-8 on OS X. I guess this may be failing for you. It's weird, because it's working for me, but then again, you probably have a Spanish (just guessing) locale, whereas I have a US locale. Maybe that makes a difference.

I also found this thread, having to do with TeXlive more than any editor in particular. The bottom line is that non-ASCII path and file names are not really supported (the original poster complains that including a file with a German umlaut in the name fails).

http://macosx-tex.576846.n2.nabble.com/path-names-with-umlauts-td7388698.html

THere may not be much I can do about this. Is there any way you can check the encoding of the tex log file? I don't think ST2 gives you that information, but you can use "file -i " or "file -I " in the Terminal. See here:

http://stackoverflow.com/questions/539294/how-do-i-determine-file-encoding-in-osx

M

On Sun, Oct 7, 2012 at 6:51 AM, juanfal notifications@github.com wrote:

The failure appears just in that line makePDF.py:320 when calling

data = open(self.caller.tex_base + ".log", 'r') \ .read().decode(self.caller.encoding, 'ignore') \ .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines()

I don't know what to do here

El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com escribió:

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal notifications@github.com wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub<

https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9207292.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

msiniscalchi commented 12 years ago

OK, this seems innocuous enough to add :-)

I have one other user who has the same problem on Windows, where I don't use latexmk. I could simply change to the directory where the master file lives. That might be more robust / cross-platform. It won't solve the problem completely for multi-file projects though---what if you have some included files in a directory with non-ASCII chars? I think that will pose a problem...

Unfortunately tex, deep down, is not Unicode-friendly. We just have to deal with that :-(

OK, sorry for the morning rant, and thanks for the suggestion. I'll do something about it as soon as I have some time (should be soon).

On Mon, Oct 8, 2012 at 3:11 AM, juanfal notifications@github.com wrote:

Sorry, forget about my last fix… not well tested, although the idea was correct, the way latexmk is a bit cumbersome, the final fix is:

"cmd": ["latexmk", "-cd", "-e", "\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 basename %S'", "-silent", "-f", "-pdf"],

It only includes a -cd option to latexmk

Hope this helps

Thanks for your great, useful and really well supported tools

Sincerely Juan F.

FIXED!!!

As I found last tries, latexmk works as a charm when inside the problematic directory (that with utf8 chars), and then, only prepending "cd", "$project_path", seems to fix the problem!!!

"cmd": ["cd", "$project_path","latexmk", "-e", "\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'", //"-silent", "-f", "-pdf"],

:) Juan Falgueras

El 07/10/2012, a las 16:12, msiniscalchi notifications@github.com escribió:

I'm really sorry about this, but I'm not sure what to do. That piece of code is supposed to handle the encoding; the only assumption it makes is that the tex log file uses the system's default encoding, which is UTF-8 on OS X. I guess this may be failing for you. It's weird, because it's working for me, but then again, you probably have a Spanish (just guessing) locale, whereas I have a US locale. Maybe that makes a difference.

I also found this thread, having to do with TeXlive more than any editor in particular. The bottom line is that non-ASCII path and file names are not really supported (the original poster complains that including a file with a German umlaut in the name fails).

http://macosx-tex.576846.n2.nabble.com/path-names-with-umlauts-td7388698.html

THere may not be much I can do about this. Is there any way you can check the encoding of the tex log file? I don't think ST2 gives you that information, but you can use "file -i " or "file -I " in the Terminal. See here:

http://stackoverflow.com/questions/539294/how-do-i-determine-file-encoding-in-osx

M

On Sun, Oct 7, 2012 at 6:51 AM, juanfal notifications@github.com wrote:

The failure appears just in that line makePDF.py:320 when calling

data = open(self.caller.tex_base + ".log", 'r') \ .read().decode(self.caller.encoding, 'ignore') \ .encode(sublime_plugin.sys.getdefaultencoding(), 'ignore').splitlines()

I don't know what to do here

El 03/10/2012, a las 17:21, msiniscalchi notifications@github.com escribió:

Of course I believe you... it's just that I can't reproduce the issue on my machine. Which version of OS X and Texlive are you running? Just trying to figure out what might be causing the issue for you.

On Tue, Oct 2, 2012 at 5:31 AM, juanfal notifications@github.com wrote:

Humm!

please watch the problem here…

If you save a simple tex file inside a folder año it fails

https://www.dropbox.com/s/8mv8ha70ddcpnvc/texBuildutfproblem.mov

the same file without utfs does fine.

The problem appears just in makePDF.py:320. I have found it putting a sublime.error_message("Hi") around and it displays only if I put it just in the line before that.

El 02/10/2012, a las 03:27, msiniscalchi notifications@github.com

escribió:

Hmmm... I checked again, and it doesn't seem to happen on my machine (running OS X Lion). To test, I created a directory called "años" (yeah, copied from your message!) and a simple tex file inside it. I was able to compile the file, and Skim was invoked. No error message appears in the Console.

Is this a multifile document? Just wondering what might be going wrong.

On Mon, Oct 1, 2012 at 2:43 AM, juanfal < notifications@github.com> wrote:

humm! Now it fails in makePDF.py:320… it seems that

self.caller.tex_base

with utf chars breaks that call

It didn't occur before.

— Reply to this email directly or view it on GitHub<

https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9023839>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub<

https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9066733>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub< https://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9207292>.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661 — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-9218876.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

juanfal commented 12 years ago

El 08/10/2012, a las 15:15, msiniscalchi notifications@github.com escribió:

OK, this seems innocuous enough to add :-)

I have one other user who has the same problem on Windows, where I don't use latexmk. I could simply change to the directory where the master file lives. That might be more robust / cross-platform. It won't solve the problem completely for multi-file projects though---what if you have some included files in a directory with non-ASCII chars? I think that will pose a problem...

Unfortunately tex, deep down, is not Unicode-friendly. We just have to deal with that :-(

OK, sorry for the morning rant, and thanks for the suggestion. I'll do something about it as soon as I have some time (should be soon).

I have tried a multifile contrived document


%!TEX root = Prueba.tex

esto está en otro aunque no lo parezca, del todo


%&pdflatexs12

\begin{document} A ver

\input{otro.tex}

\end{document}

All inside a folder with utf8 chars…

Everything has worked perfectly.

msiniscalchi commented 12 years ago

OK, I looked into this. It turns out that my code already changes into the working directory (otherwise latexmk would, by default, place all output in the root directory!). Now, you pass a "-cd" option to latexmk, but I am not sure it does much for you. What does help instead is the fact that you pass basename $S to pdflatex---the file name without the path name.

Can you try to see what happens if you remove the -cd, but leave the basename bit? If so, I can simply pass the file name of the (master) tex file to latexmk, since we should already be in the right directory. Thanks!

juanfal commented 12 years ago

El 09/10/2012, a las 06:15, msiniscalchi notifications@github.com escribió:

OK, I looked into this. It turns out that my code already changes into the working directory (otherwise latexmk would, by default, place all output in the root directory!). Now, you pass a "-cd" option to latexmk, but I am not sure it does much for you. What does help instead is the fact that you pass basename $S to pdflatex---the file name without the path name.

You only need to add the "-cd" option to latexmk parameters in order to avoid it reading those badly encoded auxiliary files and then it works!!!

I am sending attached a screencast:

A folder ññññ with utfs in its name Inside the folder two files of a multifile latex project. otro.tex depends on Prueba.tex (%!TEX root = Prueba.tex) I try ⌘-B without "-cd" in Build… it fails I add "-cd" to the latexmk build command: it works.

Can you try to see what happens if you remove the -cd, but leave the basename bit? If so, I can simply pass the file name of the (master) tex file to latexmk, since we should already be in the right directory. Thanks!

msiniscalchi commented 12 years ago

So, -cd without the basename %S trick? Sorry but I don't have a Mac handy right now

juanfal commented 12 years ago

El 09/10/2012, a las 16:05, msiniscalchi notifications@github.com escribió:

So, -cd without the basename %S trick? Sorry but I don't have a Mac handy right now

Exactly, you only need to add the argument "-cd" to latexmk in your build conf file. It does all the needed magic. I think what happens here is once the reference path is internally changed in the perl script latexmk, it doesn't need to analyze or read any bad formed utf path… and works using ./ as path… Thats an opinion only, but what it's true is that it works!

msiniscalchi commented 12 years ago

OK, done! I just committed the change. One further advantage is that the file name in the output panel is obviously much shorter, which allows you to actually see the error/warning messages without scrolling sidewise.

Hope this doesn't break anything else :-)

Thanks!

felipelageduarte commented 11 years ago

I'm using windows 8 and I can't compile projects that are in folder with portugues chars like ç, á, ã... In my particular case, I have a tex file placed in

"E:\Dropbox\USP\Mestrado\2º Semestre\Visualização Computacional\Trabalho"

I read this thread and started working on a solution... I know it's already closed but can be a problem related to this thread.. (sorry if I'm wrong)

I did the same approach as Juan (juanfal) suggested... Tried to go into the folder and compile the latex file from there. For that i changed the Latex.sublime-build for this

"cmd": ["cd /D", "$file_path &", "texify", "-b", "-p", "--tex-option=\"-synctex=1\"", "$file_name" ],

I did this to get something like this:

cd /D E:\Dropbox\USP\Mestrado\2º Semestre\Visualização Computacional\Trabalho & texify -b -p --tex-option="-synctex=1" app.tex

First of all, I tested this command in my cmd and it works. The thing is that ST2 still concatenating the hole file path and name in the end of the command. To avoid it I changed makePDF.py on line 43 for this:

cmd = self.caller.make_cmd

I know it is not the correct way to do this thing, but i was trying to make a kind of "work around" to check if it's gonna work. Thing is that i didn't get success on it. =(

I don't have much knowing on the LatexTool code and, to complicate things, I don't know how to program python.

msiniscalchi commented 11 years ago

Thanks, I'll take a look. I think the long-term solution will be to switch from texify to latexmk, so MikTeX can be handled just like TeXLive & friends. Please reopen this issue (if you haven't done so already).

On Fri, Nov 30, 2012 at 3:40 PM, Felipe Simões Lage Gomes Duarte < notifications@github.com> wrote:

I'm using windows 8 and I can't compile projects that are in folder with portugues chars like ç, á, ã... In my particular case, I have a tex file placed in

"E:\Dropbox\USP\Mestrado\2º Semestre\Visualização Computacional\Trabalho"

I read this thread and started working on a solution... I know it's already closed but can be a problem related to this thread.. (sorry if I'm wrong)

I did the same approach as Juan (juanfal) suggested... Tried to go into the folder and compile the latex file from there. For that i changed the

Latex.sublime-build for this

"cmd": ["cd /D", "$file_path &", "texify", "-b", "-p", "--tex-option=\"-synctex=1\"", "$file_name" ],

I did this to get something like this:

cd /D E:\Dropbox\USP\Mestrado\2º Semestre\Visualização Computacional\Trabalho & texify -b -p --tex-option="-synctex=1" app.tex

First of all, I tested this command in my cmd and it works. The thing is that ST2 still concatenating the hole file path and name in the end of the

command. To avoid it I changed makePDF.py on line 43 for this:

cmd = self.caller.make_cmd

I know it is not the correct way to do this thing, but i was trying to make a kind of "work around" to check if it's gonna work. Thing is that i didn't get success on it. =(

I don't have much knowing on the LatexTool code and, to complicate things, I don't know how to program python.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-10905049.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

felipelageduarte commented 11 years ago

I don't think i have permission to reopen this. I searched somewhere to reopen and I didn't found anything. Any ways, i will also try the approach that you have suggested.

msiniscalchi commented 11 years ago

OK, I'll take care of it.

On Fri, Nov 30, 2012 at 5:01 PM, Felipe Simões Lage Gomes Duarte < notifications@github.com> wrote:

I don't think i have permission to reopen this. I searched somewhere to reopen and I didn't found anything. Any ways, i will also try the approach that you have suggested.

— Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/81#issuecomment-10907594.

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661