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

VimTeX: Compiler did not start successfully on Windows Powershel #2220

Closed
JeffersonDing opened this issue Oct 25, 2021 · 8 comments
Closed
Labels

Comments

@JeffersonDing
Copy link

Description

I installed MiKTeX for windows and confirmed that latexmk works without a problem. However when I run \ll in nvim, this is the error output I get. I assume it has something to do with Powershell. Any help is appreciated!

latexmkrc has one line setting the engine to pdflatex.

At line:1 char:185
+ ... f_previewer = 'start'" -e "$compiling_cmd = ($compiling_cmd ? $compil ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:184
+ ... pdf_previewer = 'start'" -e "$compiling_cmd = ($compiling_cmd ? $comp ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:215
+ ... mpiling_cmd = ($compiling_cmd ? $compiling_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
At line:1 char:295
+ ... piler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $succes ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:294
+ ... ompiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $succ ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:323
+ ... e "$success_cmd = ($success_cmd ? $success_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
At line:1 char:401
+ ... ompiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failur ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:400
+ ... _compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $fail ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:429
+ ... e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
 
At line:1 char:185
+ ... f_previewer = 'start'" -e "$compiling_cmd = ($compiling_cmd ? $compil ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:184
+ ... pdf_previewer = 'start'" -e "$compiling_cmd = ($compiling_cmd ? $comp ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:215
+ ... mpiling_cmd = ($compiling_cmd ? $compiling_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
At line:1 char:295
+ ... piler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $succes ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:294
+ ... ompiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $succ ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:323
+ ... e "$success_cmd = ($success_cmd ? $success_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
At line:1 char:401
+ ... ompiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failur ...
+                                                                 ~
Unexpected token '?' in expression or statement.
At line:1 char:400
+ ... _compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $fail ...
+                                                                  ~
Missing closing ')' in expression.
At line:1 char:429
+ ... e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' ^& ' : '') . 'echo ...
+                                                                 ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken
 

Steps to reproduce

No response

Expected behavior

No response

Actual behavior

No response

Do you use a latexmkrc file?

yes

VimtexInfo

System info
  OS: JEFFERON-DING
 (Microsoft Windows 11 Pro
)
  Vim version: NVIM v0.5.1
  Has clientserver: true
  Servername: \\.\pipe\nvim-9716-0

VimTeX project: main
  base: main.tex
  root: C:\Users\tydin\Downloads\Rocket Lab Report
  tex: C:\Users\tydin\Downloads\Rocket Lab Report\main.tex
  main parser: current file verified
  document class: article
  packages: amsbsy amsgen amsmath amsopn amstext array babel caption caption3 epstopdf-base float gensymb geometry graphics graphicx iftex ifvtex keyval multicol multirow pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfplots pgfplotstable pgfrcs pgfsys subcaption tikz trig xcolor
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: 4
      output: C:\Users\tydin\AppData\Local\Temp\nvimieK7vf\1
      cmd: set max_print_line=2000 & latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode -pdf -pvc -e "$pdf_previewer = 'start'" -e "$compiling_cmd = ($compiling_cmd ? $compiling_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_compiling'" -e "$success_cmd = ($success_cmd ? $success_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_success'" -e "$failure_cmd = ($failure_cmd ? $failure_cmd . ' ^& ' : '') . 'echo vimtex_compiler_callback_failure'" "main.tex"
      pid: 0
  viewer: General
  qf method: LaTeX logfile
@lervag
Copy link
Owner

lervag commented Oct 25, 2021

I believe this is due to your shell setting. Did you change it? Can you check what it is after opening neovim with e.g. :set shell?

Another possibility is that your perl installation is not working as expected?

Can you explain how you have set things up, that is, neovim, latexmk/MikTeX, and so on?

@JeffersonDing
Copy link
Author

right, so my shell is set up like such in init.vim

if has('win32')
	set shell=powershell
	set shellcmdflag=-command
	set shellquote=\"
	set shellxquote=
endif

neovim is installed through chocolate and MiKTeX through downloaded binary and it came with latekmk. The only change I made to latexmk is added a latexmkrc to set the engine to pdflatex.
perl is install through Strawberry Perl for windows which shouldn't be an issue because latexmk works standalone out of the vim context.
Thanks for the quick response!

@lervag
Copy link
Owner

lervag commented Oct 25, 2021

Can you try to not set the shell options? (Things should work regardless, but I think this is the problem and need you to confirm it.)

@JeffersonDing
Copy link
Author

Oh, it worked! Strangely, I'll slowly add the shell settings back and see which one is the issue.
Thanks!

@lervag
Copy link
Owner

lervag commented Oct 25, 2021

I'm glad that the info helped resolve this for you, but I would want VimTeX to work even if you set your shell settings.

lervag added a commit that referenced this issue Oct 25, 2021
lervag added a commit that referenced this issue Oct 25, 2021
@lervag
Copy link
Owner

lervag commented Oct 25, 2021

Can you test with the latest version with your original shell settings? I think my latest commit should resolve the issue.

Also, could you check the output of :VimtexInfo if the OS string looks better now?

@JeffersonDing
Copy link
Author

It works perfectly now! Thank you so much for the quick fix.👍

@lervag
Copy link
Owner

lervag commented Oct 25, 2021

Great, thanks for the useful input! :)

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

No branches or pull requests

2 participants