Errors with latexmk -c (cleanup) option











up vote
0
down vote

favorite












I am using latexmk and calling it from within python, with the following command:



latex_params = ' -pdf -interaction=nonstopmode -gg -silent'
latexmk_string = str("latexmk -cd " + '"' + str(path/filename) + '"' + latex_params)
subprocess.call(latexmk_string, shell=True)


Note that the '"' double-quotation marks in the latexmk_string are used in cases where the path name has special characters (such as parenthesis).



The code above works just fine. The problem I am having is with the -c option to clean up the aux files. I couldn't find any way to include it in the latex_params string and get it to work.



I was able to get it to work if I used the following code after the code above, essentially calling the cleanup function on its own:



subprocess.call('latexmk -c', shell=True)


Except, that this ONLY works if the file path is the current directory. In my case, the .tex file is NOT in the current directory and the -cd option above handles that for the creation of the pdf file. But then I am not able to get the -c cleanup command to work.



I tried:



subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


But this doesn't work.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I am using latexmk and calling it from within python, with the following command:



    latex_params = ' -pdf -interaction=nonstopmode -gg -silent'
    latexmk_string = str("latexmk -cd " + '"' + str(path/filename) + '"' + latex_params)
    subprocess.call(latexmk_string, shell=True)


    Note that the '"' double-quotation marks in the latexmk_string are used in cases where the path name has special characters (such as parenthesis).



    The code above works just fine. The problem I am having is with the -c option to clean up the aux files. I couldn't find any way to include it in the latex_params string and get it to work.



    I was able to get it to work if I used the following code after the code above, essentially calling the cleanup function on its own:



    subprocess.call('latexmk -c', shell=True)


    Except, that this ONLY works if the file path is the current directory. In my case, the .tex file is NOT in the current directory and the -cd option above handles that for the creation of the pdf file. But then I am not able to get the -c cleanup command to work.



    I tried:



    subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


    But this doesn't work.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am using latexmk and calling it from within python, with the following command:



      latex_params = ' -pdf -interaction=nonstopmode -gg -silent'
      latexmk_string = str("latexmk -cd " + '"' + str(path/filename) + '"' + latex_params)
      subprocess.call(latexmk_string, shell=True)


      Note that the '"' double-quotation marks in the latexmk_string are used in cases where the path name has special characters (such as parenthesis).



      The code above works just fine. The problem I am having is with the -c option to clean up the aux files. I couldn't find any way to include it in the latex_params string and get it to work.



      I was able to get it to work if I used the following code after the code above, essentially calling the cleanup function on its own:



      subprocess.call('latexmk -c', shell=True)


      Except, that this ONLY works if the file path is the current directory. In my case, the .tex file is NOT in the current directory and the -cd option above handles that for the creation of the pdf file. But then I am not able to get the -c cleanup command to work.



      I tried:



      subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


      But this doesn't work.










      share|improve this question













      I am using latexmk and calling it from within python, with the following command:



      latex_params = ' -pdf -interaction=nonstopmode -gg -silent'
      latexmk_string = str("latexmk -cd " + '"' + str(path/filename) + '"' + latex_params)
      subprocess.call(latexmk_string, shell=True)


      Note that the '"' double-quotation marks in the latexmk_string are used in cases where the path name has special characters (such as parenthesis).



      The code above works just fine. The problem I am having is with the -c option to clean up the aux files. I couldn't find any way to include it in the latex_params string and get it to work.



      I was able to get it to work if I used the following code after the code above, essentially calling the cleanup function on its own:



      subprocess.call('latexmk -c', shell=True)


      Except, that this ONLY works if the file path is the current directory. In my case, the .tex file is NOT in the current directory and the -cd option above handles that for the creation of the pdf file. But then I am not able to get the -c cleanup command to work.



      I tried:



      subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


      But this doesn't work.







      latexmk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 30 at 12:11









      rsgny

      613




      613






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          John Collins provided the answer. The error was that the command to clean up needs to include the .tex filename and not just the path.



          Instead of:



          subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


          In needs to be:



          subprocess.call('latexmk -cd "' + str(path/filename) + '" -c', shell=True)





          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',
            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453181%2ferrors-with-latexmk-c-cleanup-option%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








            up vote
            2
            down vote













            John Collins provided the answer. The error was that the command to clean up needs to include the .tex filename and not just the path.



            Instead of:



            subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


            In needs to be:



            subprocess.call('latexmk -cd "' + str(path/filename) + '" -c', shell=True)





            share|improve this answer

























              up vote
              2
              down vote













              John Collins provided the answer. The error was that the command to clean up needs to include the .tex filename and not just the path.



              Instead of:



              subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


              In needs to be:



              subprocess.call('latexmk -cd "' + str(path/filename) + '" -c', shell=True)





              share|improve this answer























                up vote
                2
                down vote










                up vote
                2
                down vote









                John Collins provided the answer. The error was that the command to clean up needs to include the .tex filename and not just the path.



                Instead of:



                subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


                In needs to be:



                subprocess.call('latexmk -cd "' + str(path/filename) + '" -c', shell=True)





                share|improve this answer












                John Collins provided the answer. The error was that the command to clean up needs to include the .tex filename and not just the path.



                Instead of:



                subprocess.call('latexmk -cd "' + str(path) + '" -c', shell=True)


                In needs to be:



                subprocess.call('latexmk -cd "' + str(path/filename) + '" -c', shell=True)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 4 at 13:18









                rsgny

                613




                613






























                    draft saved

                    draft discarded




















































                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f453181%2ferrors-with-latexmk-c-cleanup-option%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

                    How to send String Array data to Server using php in android

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Is anime1.com a legal site for watching anime?