My very first question on StackExchange.
I'm using GVim on windows, trying to compile a minimal tex file with accented characters, e.g. "é 3.tex". Inside gvim, with pdflatex, no problem, but there is with latexmk. This problem doesn't appear with another program (at least not with texworks). The problem also exists with Vim Tex tools like SingleCompile or VimTex.
I have these lines in my vimrc:
augroup TEX_FILE_COMPILATION
autocmd!
autocmd filetype tex compiler tex
autocmd filetype tex noremap <F4> :update <CR> :let &makeprg='pdflatex -interaction=nonstopmode "%"' <CR> :execute "make \| cw 5 \| silent !texworks ".'"'.expand('%:r').'.pdf'.'"'<CR>
autocmd filetype tex noremap <F5> :update <CR> :let &makeprg='latexmk -f -pdf -interaction=nonstopmode "%"' <CR> :execute "make \| cw 5 \| silent !texworks ".'"'.expand('%:r').'.pdf'.'"'<CR>
augroup END
latexmk complains about not finding the correct file.
logfile:
# Fdb version 3 ["pdflatex"] 1531410414 ""é 3.tex"" ""é 3.pdf" ""é 3" 1531410414
(generated)
""é 3.log"
""
""é 3.pdf"
There's an extra double quote, in front of the é, which causes the problem.
I think there's an encoding problem. I also tried directly:
:!chcp 1252 & latexmk -f -pdf -interaction=nonstopmode "%"
which returns
C:\windows\system32\cmd.exe /c (chcp 1252 ^& latexmk -f -pdf -interaction=nonstopmode ^"é 3.tex^")
Page de codes active : 1252
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = "FR"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Latexmk: This is Latexmk, John Collins, 25 May 2018, version: 4.56.
Latexmk: Could not find file ["é 3.tex"]
Latexmk: In file-database '"é 3.fdb_latexmk' line 3 is of wrong format:
'""é 3.aux" 1531408183 8 a94a2480d3289e625eea47cd1b285758 ""'
Latexmk: In file-database '"é 3.fdb_latexmk' line 4 is of wrong format:
'""é 3.tex"" 0 -1 0 ""'
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -interaction=nonstopmode -recorder ""é 3.tex""'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6700)
entering extended mode
! I can't find file `é'.
<*> é
3.tex
Please type another input file name
! Emergency stop.
<*> é
3.tex
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
Latexmk: fls file doesn't appear to have been made.
Failure to make '"é 3.pdf'
etc.
Is latexmk able to open files with UTF8 names? https://www.i-programmer.info/programming/other-languages/1973-unicode-issues-in-perl.html
Any idea would be very kind.
Edit:
If i test GVim+latexmk+"e 3.tex", it works, so I didn't thought that blank spaces are guilty.
Using directly the cmd, it works. There are weird characters for the filename, and latexmk notices but I get a good "é 3.pdf":
C:\HyperX\vim_tests>latexmk -pdf -interaction=nonstopmode "C:\HyperX\vim_tests\é 3.tex"
Latexmk: This is Latexmk, John Collins, 25 May 2018, version: 4.56.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -interaction=nonstopmode -recorder "C:\HyperX\vim_tests\Ú 3.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6700)
entering extended mode
("C:/HyperX/vim_tests/├® 3.tex"
LaTeX2e <2018-04-01> patch level 5
Babel <3.20> and hyphenation patterns for 75 language(s) loaded.
(C:\HyperX\prg\MikTeX\texmfs\install\tex\latex\base\article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(C:\HyperX\prg\MikTeX\texmfs\install\tex\latex\base\size10.clo)) ("├® 3.aux")
[1{C:/HyperX/prg/MikTeX/texmfs/data/pdftex/config/pdftex.map}] ("├® 3.aux") )<C
:/HyperX/prg/MikTeX/texmfs/install/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on "├® 3.pdf" (1 page, 12289 bytes).
Transcript written on "├® 3.log".
=== TeX engine is 'pdfTeX'
Latexmk: Log file says output to '├® 3.pdf'
Latexmk: ===For rule 'pdflatex', actual output '├® 3.pdf'
======appears not to match expected output 'Ú 3.pdf'.
Further diagnostics follow:
--The base names of the files are different. That is strange!!
Latexmk: All targets (Ú 3.pdf) are up-to-date
As John Collins answered, latexmk can treat file names with accents, so the problem seems to be Vim specific.
A..Z
,0..9
,_
and nothing else.latexmk -f -pdf -interaction=nonstopmode "é 3.tex"
return on the command line? If it is the same, then this is not vim related and your should probably rephrase and re-tag the question.