Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use Latexmk #134

Closed
RobertAudi opened this issue Oct 6, 2013 · 12 comments
Closed

Can't use Latexmk #134

RobertAudi opened this issue Oct 6, 2013 · 12 comments

Comments

@RobertAudi
Copy link

When I use :Latexmk I get the following error:

Compiling to pdf ... (async off!)
Error detected while processing function LatexBox_Latexmk..LatexBox_LatexErrors:
line   16:
E40: Can't open errorfile /Users/aziz/Documents/LateX/test.log
Error detected while processing function LatexBox_Latexmk:
line  152:
E171: Missing :endif
Press ENTER or type command to continue
@RobertAudi
Copy link
Author

By adding this line to my .vimrc I solved the problem:

let g:LatexBox_latexmk_async=1

Sorry about that...

@lervag
Copy link

lervag commented Oct 7, 2013

No problem!

@y0ast
Copy link

y0ast commented Nov 6, 2013

I have this too, but don't want to use Vim Server, so Aziz' solution does not work.

Do you have any idea?

@lervag
Copy link

lervag commented Nov 6, 2013

First: What version of vim are you using?
Second: What are your LaTeX-Box settings (in vimrc)?
Third: Are you using the latest version of LaTeX-Box?

@y0ast
Copy link

y0ast commented Nov 6, 2013

  1. inbuilt VIM, OS X mavericks, but I get the same error with MacVim installed with Homebrew
  2. Commented them all out.
  3. Yes, I am at the latest commit

@lervag
Copy link

lervag commented Nov 6, 2013

Ok. Next step: Does the file compile at all? If so, what is the path of the log file? As you see from the error message, vim does not find the log file, so the bug might simply be that the path is incorrect.

@y0ast
Copy link

y0ast commented Nov 6, 2013

It does not compile at all, no log or pdf files are generated. If I run pdflatex on the file manually in the terminal it works fine and the pdf output is good.

@lervag
Copy link

lervag commented Nov 6, 2013

Ok. I am unfortunately not able to reproduce your problem, which makes it difficult to debug. I can try to assist in finding a solution, though.

I think the error may be related to line 290 in the file latexmk.vim. If you could change

echo 'Compiling to ' . g:LatexBox_output_type . ' ... (async off!)'
call system(cmd)
call LatexBox_LatexErrors(v:shell_error)

to

echo 'Compiling to ' . g:LatexBox_output_type . ' ... (async off!)'
echom cmd
call system(cmd)
echom v:shell_error
call LatexBox_LatexErrors(v:shell_error)

And report the output here. One possible solution is to change the system command:

echo 'Compiling to ' . g:LatexBox_output_type . ' ... (async off!)'
execute cmd
call LatexBox_LatexErrors(v:shell_error)

@y0ast
Copy link

y0ast commented Nov 6, 2013

I changed the file as you described, here is the output:

Compiling to pdf ... (async off!)
cd '/Users/joost' && max_print_line=2000   latexmk -pdf -quiet  -e '$pdflatex =~ s/ / -file-line-e
rror /' -e '$latex =~ s/ / -file-line-error /' hw1.tex &>/dev/null
127
Error detected while processing function LatexBox_Latexmk..LatexBox_LatexErrors:
line   16:
E40: Can't open errorfile /Users/joost/hw1.log
Error detected while processing function LatexBox_Latexmk:
line  154:
E171: Missing :endif

It seems like the command is never properly executed and then latex-box fails upon trying to open the non-existing log file.

Your possible solution does not fix it, generates exact same error as before.

Running:
pdflatex hw1.tex

Produces:
hw1.aux hw1.log hw1.pdf hw1.tex

@lervag
Copy link

lervag commented Nov 6, 2013

Strange. Could you try to comment out line 190 (remove &>/dev/null) and use the execute form. I think this should lead to more verbose output, which might help explain what is happening.

Oh, I forgot: When you change from call system(... to execute cmd, you must add ! to the beginning of the command. That is, add

let cmd = '!' . cmd

before execute cmd.

If this doesn't work, you can also try to run the command yourself directly. Copy the command to you commandline, remember to prepend with !, and run the command.

@y0ast
Copy link

y0ast commented Nov 6, 2013

Ah, that gave the output that latexmk is not found.

I downloaded the BasicTex package from MacTex to save harddrive space (128GB SSD fills up quickly) and apparently that doesn't come with latexmk. Manually installing it from here: http://users.phys.psu.edu/~collins/software/latexmk-jcc/ solved it :)

Thanks for your help! Maybe you could implement a more helpful error message in this case.

@lervag
Copy link

lervag commented Nov 6, 2013

No problem, happy to help.

Yes, you are right, we should have a better error message for this case. I would be happy to do so, but I don't have time right now. Could you open a new issue for this (I don't want to reopen this particular issue)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants