{"action":"created","issue":{"url":"https://api.github.com/repos/lervag/vimtex/issues/1176","repository_url":"https://api.github.com/repos/lervag/vimtex","labels_url":"https://api.github.com/repos/lervag/vimtex/issues/1176/labels{/name}","comments_url":"https://api.github.com/repos/lervag/vimtex/issues/1176/comments","events_url":"https://api.github.com/repos/lervag/vimtex/issues/1176/events","html_url":"https://github.com/lervag/vimtex/pull/1176","id":345462952,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0NjAxNDEx","number":1176,"title":"Parse $pdf_mode variable in latexmkrc","user":{"login":"jipolanco","id":3952024,"node_id":"MDQ6VXNlcjM5NTIwMjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3952024?v=4","gravatar_id":"","url":"https://api.github.com/users/jipolanco","html_url":"https://github.com/jipolanco","followers_url":"https://api.github.com/users/jipolanco/followers","following_url":"https://api.github.com/users/jipolanco/following{/other_user}","gists_url":"https://api.github.com/users/jipolanco/gists{/gist_id}","starred_url":"https://api.github.com/users/jipolanco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jipolanco/subscriptions","organizations_url":"https://api.github.com/users/jipolanco/orgs","repos_url":"https://api.github.com/users/jipolanco/repos","events_url":"https://api.github.com/users/jipolanco/events{/privacy}","received_events_url":"https://api.github.com/users/jipolanco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-07-28T16:54:32Z","updated_at":"2018-07-29T14:35:49Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/lervag/vimtex/pulls/1176","html_url":"https://github.com/lervag/vimtex/pull/1176","diff_url":"https://github.com/lervag/vimtex/pull/1176.diff","patch_url":"https://github.com/lervag/vimtex/pull/1176.patch"},"body":"This PR adds support for parsing the `$pdf_mode` variable in a latexmkrc file, in a similar way as it was already done with the `$out_dir` variable.\r\n\r\nPreviously, the value of `$pdf_mode` was ignored by vimtex. In particular, when `$pdf_mode` was set and a TeX directive was *not* given, vimtex would use the default latexmk engine (the value of `g:vimtex_compiler_latexmk_engines['_']`, by default `-pdf`, i.e. pdflatex) instead of `$pdf_mode`. This is probably not the outcome expected by the user, especially if they had not set the default latexmk engine explicitly.\r\n\r\nThe value of `$pdf_mode` now has priority over TeX directives found in the source files, and a warning is shown if both values are given and are inconsistent (in the same way as it was already done with `build_dir / $out_dir`).\r\n\r\nI tried to follow the existent code convention and the `CONTRIBUTING.md` file, but there may be better ways to implement this PR, in particular because I'm not very fluent in vimscript.\r\n\r\nI also added a small test associated to the PR. I'm not sure if the location of the test files is the best, so feel free to (re)move them as needed."},"comment":{"url":"https://api.github.com/repos/lervag/vimtex/issues/comments/408681965","html_url":"https://github.com/lervag/vimtex/pull/1176#issuecomment-408681965","issue_url":"https://api.github.com/repos/lervag/vimtex/issues/1176","id":408681965,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODY4MTk2NQ==","user":{"login":"clason","id":2361214,"node_id":"MDQ6VXNlcjIzNjEyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2361214?v=4","gravatar_id":"","url":"https://api.github.com/users/clason","html_url":"https://github.com/clason","followers_url":"https://api.github.com/users/clason/followers","following_url":"https://api.github.com/users/clason/following{/other_user}","gists_url":"https://api.github.com/users/clason/gists{/gist_id}","starred_url":"https://api.github.com/users/clason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clason/subscriptions","organizations_url":"https://api.github.com/users/clason/orgs","repos_url":"https://api.github.com/users/clason/repos","events_url":"https://api.github.com/users/clason/events{/privacy}","received_events_url":"https://api.github.com/users/clason/received_events","type":"User","site_admin":false},"created_at":"2018-07-29T14:35:49Z","updated_at":"2018-07-29T14:35:49Z","author_association":"CONTRIBUTOR","body":"@lervag I understand that motivation. Personally (for what it's worth), I'd punt all compiler configuration to the respective configuration files (as I believe you do for `arara`) -- people who use vim as their editor (and vimtex as their plugin) should be trusted to know how to configure latexmk. (At most, you'd get one issue where this can be explained, and Google will do the rest.)\r\n\r\nAs a compromise, one could set the latexmk defaults *only* if no global or local latexmkrc is found. This would set up people who want things to \"just work\" and allow others who know what they're doing to set things up without interference. (For example, I always force `-shell-escape`, and I only use `lualatex` for a few specific documents using corporate fonts.)"}}
{"actor":{"display_login":"clason"}}