-
Notifications
You must be signed in to change notification settings - Fork 386
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
SumatraPDF doesn't auto-reload / refresh compiled PDF when using xelatex engine #2830
Comments
Or would it be caused by using the |
OK, I find the problem. Somehow I used a template from others, and there is a line
at the top of my document. This line, cause Once I removed that line, everything is fine now. Any explanation here? |
Not fully; I suspect that you are getting a few errors when you compile with But I may be wrong, and if so, then I don't really have any clear idea. If you feel like it, you could share your files (e.g. by email) and I could look into it specifically. If so, also share your VimTeX configuration. |
Hi there, thank you for the input and the offer of checking the files. Below is my vimtex settings. I'm using -- Disable imaps (using Ultisnips)
vim.g.vimtex_imaps_enabled = 0
-- Do not open pdfviwer on compile
vim.g.vimtex_view_automatic = 0
-- Disable conceal
vim.g.vimtex_syntax_conceal = {
accents = 0,
cites = 0,
fancy = 0,
greek = 0,
math_bounds = 0,
math_delimiters = 0,
math_fracs = 0,
math_super_sub = 0,
math_symbols = 0,
sections = 0,
styles = 0,
}
-- Disable quickfix auto open
vim.g.vimtex_quickfix_ignore_mode = 0
-- PDF viewer settings
-- vim.g.vimtex_view_general_viewer = "SumatraPDF" -- (default on Windows)
vim.g.vimtex_view_general_options = "-reuse-instance -forward-search @tex @line @pdf"
-- Latexmk env_options
vim.g.vimtex_compiler_latexmk = {
out_dir = 'build',
-- options = {
-- '-pdf',
-- '-pdflatex="xelatex --shell-escape %O %S"',
-- '-verbose',
-- '-file-line-error',
-- '-synctex=1',
-- '-interaction=nonstopmode',
-- },
}
-- vim.g.vimtex_view_use_temp_files = 1
-- Do not auto open quickfix on compile erros
vim.g.vimtex_quickfix_mode = 0
-- Latex warnings to ignore
vim.g.vimtex_quickfix_ignore_filters = {
"Command terminated with space",
"LaTeX Font Warning: Font shape",
"Overfull",
"Underfull",
"Package caption Warning: The option",
[[Underfull \\hbox (badness [0-9]*) in]],
"Package enumitem Warning: Negative labelwidth",
[[Overfull \\hbox ([0-9]*.[0-9]*pt too wide) in]],
[[Package caption Warning: Unused \\captionsetup]],
"Package typearea Warning: Bad type area settings!",
[[Package fancyhdr Warning: \\headheight is too small]],
[[Underfull \\hbox (badness [0-9]*) in paragraph at lines]],
"Package hyperref Warning: Token not allowed in a PDF string",
[[Overfull \\hbox ([0-9]*.[0-9]*pt too wide) in paragraph at lines]],
}
vim.g.vimtex_fold_enabled = 1
vim.g.vimtex_fold_manual = 1
vim.g.vimtex_fold_types = {
cmd_addplot = {
cmds = { "addplot[+3]?" },
},
cmd_multi = {
cmds = {
"%(re)?new%(command|environment)",
"providecommand",
"presetkeys",
"Declare%(Multi|Auto)?CiteCommand",
"Declare%(Index)?%(Field|List|Name)%(Format|Alias)",
},
},
cmd_single = {
cmds = { "hypersetup", "tikzset", "pgfplotstableread", "lstset" },
},
cmd_single_opt = {
cmds = { "usepackage", "includepdf" },
},
comments = {
enabled = 0,
},
env_options = vim.empty_dict(),
envs = {
blacklist = {},
whitelist = { "figure", "frame", "table", "example", "answer" },
},
items = {
enabled = 0,
},
markers = vim.empty_dict(),
preamble = {
enabled = 0,
},
sections = {
parse_levels = 0,
parts = { "appendix", "frontmatter", "mainmatter", "backmatter" },
sections = {
"%(add)?part",
"%(chapter|addchap)",
"%(section|section\\*)",
"%(subsection|subsection\\*)",
"%(subsubsection|subsubsection\\*)",
"paragraph",
},
},
} |
I took the liberty of cleaning that up. The following should be equivalent to the config you posted (IMHO, comments are not so important, because you can simply do vim.g.vimtex_imaps_enabled = 0
vim.g.vimtex_view_automatic = 0
vim.g.vimtex_syntax_conceal_disable = 1
vim.g.vimtex_quickfix_ignore_mode = 0
vim.g.vimtex_compiler_latexmk = { out_dir = 'build' }
vim.g.vimtex_quickfix_mode = 0
vim.g.vimtex_quickfix_ignore_filters = {
"Command terminated with space",
"LaTeX Font Warning: Font shape",
"Overfull",
"Underfull",
"Package caption Warning: The option",
[[Underfull \\hbox (badness [0-9]*) in]],
"Package enumitem Warning: Negative labelwidth",
[[Overfull \\hbox ([0-9]*.[0-9]*pt too wide) in]],
[[Package caption Warning: Unused \\captionsetup]],
"Package typearea Warning: Bad type area settings!",
[[Package fancyhdr Warning: \\headheight is too small]],
[[Underfull \\hbox (badness [0-9]*) in paragraph at lines]],
"Package hyperref Warning: Token not allowed in a PDF string",
[[Overfull \\hbox ([0-9]*.[0-9]*pt too wide) in paragraph at lines]],
}
vim.g.vimtex_fold_enabled = 1
vim.g.vimtex_fold_manual = 1
vim.g.vimtex_fold_types = {
cmd_addplot = {
cmds = { "addplot[+3]?" },
},
cmd_multi = {
cmds = {
"%(re)?new%(command|environment)",
"providecommand",
"presetkeys",
"Declare%(Multi|Auto)?CiteCommand",
"Declare%(Index)?%(Field|List|Name)%(Format|Alias)",
},
},
cmd_single = {
cmds = { "hypersetup", "tikzset", "pgfplotstableread", "lstset" },
},
cmd_single_opt = {
cmds = { "usepackage", "includepdf" },
},
comments = {
enabled = 0,
},
env_options = vim.empty_dict(),
envs = {
blacklist = {},
whitelist = { "figure", "frame", "table", "example", "answer" },
},
items = {
enabled = 0,
},
markers = vim.empty_dict(),
preamble = {
enabled = 0,
},
sections = {
parse_levels = 0,
parts = { "appendix", "frontmatter", "mainmatter", "backmatter" },
sections = {
"%(add)?part",
"%(chapter|addchap)",
"%(section|section\\*)",
"%(subsection|subsection\\*)",
"%(subsubsection|subsubsection\\*)",
"paragraph",
},
},
}
Thanks. For reference, I've copied the %!TEX TS-program = xelatex
\documentclass[11pt,letterpaper,colorlinks,linkcolor=true,final]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\usepackage{footmisc}
\usepackage[a4paper,left=2.2cm,right=2.2cm,top=2.1cm,bottom=2.6cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}
\usepackage{csquotes}
\firstname{Contact References}
\familyname{}
\title{Demo xelatex Latex Project using moderncv}
\email{xxx@burger.com}
\extrainfo{MacDonalds Joe}
\quote{"A witty and playful quotation" - John Smith}
\begin{document}
\makecvtitle
\setlength{\parskip}{0.5em}
\hypersetup{linkcolor=cyan, urlcolor=cyan}
\section{Reference 1}
\subsection{Prof. Joe MacDonalds}
\cventry{}{Professor of Burger Science, Director of the Cheese Burger Department}{}{}{}{Department of Burgers}
\cvline{email}{\href{jj@burger.com}{jj@burger.com}}
\cvline{description}{Current academic associate of the applicant.}
\end{document} I've tried to reproduce your issue on my end, but so far everything seems to work as expected. I'll try to change my settings to yours (except I don't have SumatraPDF since I'm not on Windows). |
Ok, I've tested with your configuration on my end, and I can reproduce if I use the Edit: No, sorry, I can't reproduce this. My above comment was wrong, I just didn't notice properly first time. However, even if I did reproduce I wouldn't really know where to start looking for a solution, sorry! |
Really appreciate the effort! But anyway, this is not a very unbearable issue. |
I would actually much prefer we close the issue. But ok, let's keep it open in case someone else figures it out and joins the discussion. I'll close it some time in the future if there is no activity.
Glad to help (and sorry I couldn't be of more help). |
Maybe this is a SumatraPDF issue. I encoutered a similar problem with yours, but not identically. I use vscode-neovim with vimtex enabled. If I use latexmk to compile my tex files, then SumatraPDF doesn't refresh automatically, However, if I press |
Description
When compiling large document, SumatraPDF won't auto-reload/update the PDF when I make changes to my
.tex
file.But pressing
r
inside SumatraPDF can manually reload the PDF.I tested the minimal example, and actually this should not be a default VimTex error. But there're some strange things I observed, let me explain.
For the
minimal.tex
example, if I observe (eye-ball) thebuild
folder, I don't see the PDF gotdeleted
and "re-generated".However, when compiling my own tex project, I observe (eye-ball) that inside the
build
folder, the corresponding PDF file got deleted and re-generated... I don't know if this is related to my issue...Perhaps by pressing
r
inside SumatraPDF, the program reload by file locations, but for the auto-update with-reuse-instance
, SumatraPDF somehow tries to find the original PDF (which won't exist)?Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Do you use a latexmkrc file?
YES
latexmkrc
file:VimtexInfo
The text was updated successfully, but these errors were encountered: