How to change the default PDF viewer to open an editor such as VS code












2















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.










share|improve this question









New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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


















2















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.










share|improve this question









New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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
















2












2








2








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.










share|improve this question









New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 8 mins ago









KJO

3,1231120




3,1231120






New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









OptOpt

1134




1134




New contributor




Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Opt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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





    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












1 Answer
1






active

oldest

votes


















1














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.






share|improve this answer

























    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.










    draft saved

    draft discarded


















    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









    1














    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.






    share|improve this answer






























      1














      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.






      share|improve this answer




























        1












        1








        1







        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.






        share|improve this answer















        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 13 hours ago

























        answered 23 hours ago









        KJOKJO

        3,1231120




        3,1231120






















            Opt is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            サソリ

            広島県道265号伴広島線

            Setup Asymptote in Texstudio