James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.55k stars 522 forks source link

Multpile LaTeX targets in a single window #4328

Closed michael-markl closed 1 month ago

michael-markl commented 1 month ago

Pre-checks*

The feature request has been suggested in this repository: #12 !

I want to add (another?) use case to the discussion in the mentioned issue. (Feel free to close this issue if you do not plan to support this use case).

The Missed*

Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.

  • I often have LaTeX projects with multiple/two targets: A preprint version and a conference/journal version of a paper that are only differently typeset, but have (mostly) the same content.
  • I want to typeset them in parallel to immediately see the changes in both versions and possibly correct visual glitches immediately.

(My) Status Quo

$pdflatex = 'pdflatex -synctex=1 -interaction=nonstopmode -shell-escape -file-line-error --max-print-line=10000 %O %S';
$out_dir = 'out';
$aux_dir = 'out';
$pdf_mode = 1;
@default_files = ('main_preprint.tex', 'main_conference.tex');

The Solution*

Please provide a solution you would like to have.

  • A minimal solution would be to have an easier way to refresh the PDF viewer manually (ie. reload the PDF from file system) e.g. by focusing the PDF viewer tab and pressing Ctrl+R. Edit: There is already a setting for a keybinding to refresh all LaTeX viewers, so this minimal solution is already implemented 😍 It is even unnecessary to focus the tab with this solution; Nice!
  • A "complete" solution would be if the changes in SyncTex are recognized in both tabs at the same time, and the changed sections are highlighted in red in both PDF Viewer instances.
James-Yu commented 1 month ago

Sorry I don't understand what you requested. The extension updates PDF of current root file on successful compilation, and other PDFs on file change.

James-Yu commented 1 month ago

By the way, you can always use the "refresh all viewer" command to manually refresh.

michael-markl commented 1 month ago

For me, it doesn't refresh the PDF viewer on file change, but the workaround with the manual command is sufficient for me.

jlelong commented 1 month ago

For me, it doesn't refresh the PDF viewer on file change.

This is mostly related to the behaviour of pdflatex. Even if the PDF file seems to be updated, from a technical point of view it is most likely a new file, with a new inode. This breaks the file watcher and any update mechanism it should trigger.