How to change the default PDF viewer to open an editor such as VS code
In Windows OS, it is possible to open a LaTeX-generated PDF file with TeXworks and when you press ctrl+click
on the PDF file TeXworks editor is opened. I was wondering how we can make Visual Studio Code the default editor such that ctrl+click
on the PDF file will open vscode instead. I think this question which tries to set WinEdt as the default editor is relevant, but I don't know how to set vscode as the opening editor.
editors viewers forward-inverse-search
New contributor
add a comment |
In Windows OS, it is possible to open a LaTeX-generated PDF file with TeXworks and when you press ctrl+click
on the PDF file TeXworks editor is opened. I was wondering how we can make Visual Studio Code the default editor such that ctrl+click
on the PDF file will open vscode instead. I think this question which tries to set WinEdt as the default editor is relevant, but I don't know how to set vscode as the opening editor.
editors viewers forward-inverse-search
New contributor
1
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
1
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday
add a comment |
In Windows OS, it is possible to open a LaTeX-generated PDF file with TeXworks and when you press ctrl+click
on the PDF file TeXworks editor is opened. I was wondering how we can make Visual Studio Code the default editor such that ctrl+click
on the PDF file will open vscode instead. I think this question which tries to set WinEdt as the default editor is relevant, but I don't know how to set vscode as the opening editor.
editors viewers forward-inverse-search
New contributor
In Windows OS, it is possible to open a LaTeX-generated PDF file with TeXworks and when you press ctrl+click
on the PDF file TeXworks editor is opened. I was wondering how we can make Visual Studio Code the default editor such that ctrl+click
on the PDF file will open vscode instead. I think this question which tries to set WinEdt as the default editor is relevant, but I don't know how to set vscode as the opening editor.
editors viewers forward-inverse-search
editors viewers forward-inverse-search
New contributor
New contributor
edited 1 hour ago
KJO
3,1381120
3,1381120
New contributor
asked yesterday
OptOpt
1134
1134
New contributor
New contributor
1
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
1
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday
add a comment |
1
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
1
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday
1
1
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
1
1
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday
add a comment |
1 Answer
1
active
oldest
votes
Most PDF viewers that are aware of SyncTeX can be easily configured to reverse (inverse) sync.
Such viewers are Evince, Okular, SumatraPDF etc.
Some editors (not all) can be started from the PDF if the SyncTeX file is present alongside the PDF (one reason not to delete them) when the inverse command is triggered (double click for SumatraPDF or shift left click for Okular, and Control click for some others, it depends on the viewer).
For collaborative working it is possible to embed the SyncTeX file inside the portfolio PDF and SumatraPDF can readily extract it to the pdf folder in order to trigger any users editor not just the one used to compile. (NOTE compile would require 1 pass to build synctex then a second method to embed it, but that's a separate workflow question beyond this guide)
You asked elsewhere how you could to do that using SumatraPDF and for your VScode desire you will find in this guide the following command entry but you need to use the location of your VS code editor in place of
editorcode NOTE the last character is lower case L
Okular tends to share the same combination of tokens as SumatraPDF but Evince and others may be different.
Microsoft VS Code = "editorCode.exe" -g %f:%l
you may need to try "%f:%l" or "%f":%l or even other escape chars depending on system
Why some other editors won't start that way easily is that they may require a "server" daemon to be active and running first in order to catch the tex file open command. Such examples that need some prior trigger are LyX (uses a pipe) TeXlipse (requires java service) several others that use DDE (TeXnicCenter) or d-bus etc.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Opt is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480035%2fhow-to-change-the-default-pdf-viewer-to-open-an-editor-such-as-vs-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Most PDF viewers that are aware of SyncTeX can be easily configured to reverse (inverse) sync.
Such viewers are Evince, Okular, SumatraPDF etc.
Some editors (not all) can be started from the PDF if the SyncTeX file is present alongside the PDF (one reason not to delete them) when the inverse command is triggered (double click for SumatraPDF or shift left click for Okular, and Control click for some others, it depends on the viewer).
For collaborative working it is possible to embed the SyncTeX file inside the portfolio PDF and SumatraPDF can readily extract it to the pdf folder in order to trigger any users editor not just the one used to compile. (NOTE compile would require 1 pass to build synctex then a second method to embed it, but that's a separate workflow question beyond this guide)
You asked elsewhere how you could to do that using SumatraPDF and for your VScode desire you will find in this guide the following command entry but you need to use the location of your VS code editor in place of
editorcode NOTE the last character is lower case L
Okular tends to share the same combination of tokens as SumatraPDF but Evince and others may be different.
Microsoft VS Code = "editorCode.exe" -g %f:%l
you may need to try "%f:%l" or "%f":%l or even other escape chars depending on system
Why some other editors won't start that way easily is that they may require a "server" daemon to be active and running first in order to catch the tex file open command. Such examples that need some prior trigger are LyX (uses a pipe) TeXlipse (requires java service) several others that use DDE (TeXnicCenter) or d-bus etc.
add a comment |
Most PDF viewers that are aware of SyncTeX can be easily configured to reverse (inverse) sync.
Such viewers are Evince, Okular, SumatraPDF etc.
Some editors (not all) can be started from the PDF if the SyncTeX file is present alongside the PDF (one reason not to delete them) when the inverse command is triggered (double click for SumatraPDF or shift left click for Okular, and Control click for some others, it depends on the viewer).
For collaborative working it is possible to embed the SyncTeX file inside the portfolio PDF and SumatraPDF can readily extract it to the pdf folder in order to trigger any users editor not just the one used to compile. (NOTE compile would require 1 pass to build synctex then a second method to embed it, but that's a separate workflow question beyond this guide)
You asked elsewhere how you could to do that using SumatraPDF and for your VScode desire you will find in this guide the following command entry but you need to use the location of your VS code editor in place of
editorcode NOTE the last character is lower case L
Okular tends to share the same combination of tokens as SumatraPDF but Evince and others may be different.
Microsoft VS Code = "editorCode.exe" -g %f:%l
you may need to try "%f:%l" or "%f":%l or even other escape chars depending on system
Why some other editors won't start that way easily is that they may require a "server" daemon to be active and running first in order to catch the tex file open command. Such examples that need some prior trigger are LyX (uses a pipe) TeXlipse (requires java service) several others that use DDE (TeXnicCenter) or d-bus etc.
add a comment |
Most PDF viewers that are aware of SyncTeX can be easily configured to reverse (inverse) sync.
Such viewers are Evince, Okular, SumatraPDF etc.
Some editors (not all) can be started from the PDF if the SyncTeX file is present alongside the PDF (one reason not to delete them) when the inverse command is triggered (double click for SumatraPDF or shift left click for Okular, and Control click for some others, it depends on the viewer).
For collaborative working it is possible to embed the SyncTeX file inside the portfolio PDF and SumatraPDF can readily extract it to the pdf folder in order to trigger any users editor not just the one used to compile. (NOTE compile would require 1 pass to build synctex then a second method to embed it, but that's a separate workflow question beyond this guide)
You asked elsewhere how you could to do that using SumatraPDF and for your VScode desire you will find in this guide the following command entry but you need to use the location of your VS code editor in place of
editorcode NOTE the last character is lower case L
Okular tends to share the same combination of tokens as SumatraPDF but Evince and others may be different.
Microsoft VS Code = "editorCode.exe" -g %f:%l
you may need to try "%f:%l" or "%f":%l or even other escape chars depending on system
Why some other editors won't start that way easily is that they may require a "server" daemon to be active and running first in order to catch the tex file open command. Such examples that need some prior trigger are LyX (uses a pipe) TeXlipse (requires java service) several others that use DDE (TeXnicCenter) or d-bus etc.
Most PDF viewers that are aware of SyncTeX can be easily configured to reverse (inverse) sync.
Such viewers are Evince, Okular, SumatraPDF etc.
Some editors (not all) can be started from the PDF if the SyncTeX file is present alongside the PDF (one reason not to delete them) when the inverse command is triggered (double click for SumatraPDF or shift left click for Okular, and Control click for some others, it depends on the viewer).
For collaborative working it is possible to embed the SyncTeX file inside the portfolio PDF and SumatraPDF can readily extract it to the pdf folder in order to trigger any users editor not just the one used to compile. (NOTE compile would require 1 pass to build synctex then a second method to embed it, but that's a separate workflow question beyond this guide)
You asked elsewhere how you could to do that using SumatraPDF and for your VScode desire you will find in this guide the following command entry but you need to use the location of your VS code editor in place of
editorcode NOTE the last character is lower case L
Okular tends to share the same combination of tokens as SumatraPDF but Evince and others may be different.
Microsoft VS Code = "editorCode.exe" -g %f:%l
you may need to try "%f:%l" or "%f":%l or even other escape chars depending on system
Why some other editors won't start that way easily is that they may require a "server" daemon to be active and running first in order to catch the tex file open command. Such examples that need some prior trigger are LyX (uses a pipe) TeXlipse (requires java service) several others that use DDE (TeXnicCenter) or d-bus etc.
edited 14 hours ago
answered yesterday
KJOKJO
3,1381120
3,1381120
add a comment |
add a comment |
Opt is a new contributor. Be nice, and check out our Code of Conduct.
Opt is a new contributor. Be nice, and check out our Code of Conduct.
Opt is a new contributor. Be nice, and check out our Code of Conduct.
Opt is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480035%2fhow-to-change-the-default-pdf-viewer-to-open-an-editor-such-as-vs-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Use another PDF viewer like sumatra and specify vscode for backward synchronization (synctex).
– TeXnician
yesterday
1
@TeXnician I have also asked a question here to see how vscode can be set to work with sumatra PDF.
– Opt
yesterday