How to delete a file in latex code?












1














How to delete a file in latex code with normal complie tex. I create temporary files and when i finish using them I want to delete them. It not delete by bash or editor.
Thankyou!










share|improve this question




















  • 5




    TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
    – Schweinebacke
    May 2 '17 at 15:47






  • 2




    Related/duplicate: Deleting external/auxiliary files?
    – Werner
    May 2 '17 at 16:53






  • 1




    I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
    – Herb Schulz
    May 2 '17 at 17:28






  • 1




    The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
    – ShreevatsaR
    May 2 '17 at 17:41










  • @ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
    – Schweinebacke
    May 2 '17 at 18:04
















1














How to delete a file in latex code with normal complie tex. I create temporary files and when i finish using them I want to delete them. It not delete by bash or editor.
Thankyou!










share|improve this question




















  • 5




    TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
    – Schweinebacke
    May 2 '17 at 15:47






  • 2




    Related/duplicate: Deleting external/auxiliary files?
    – Werner
    May 2 '17 at 16:53






  • 1




    I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
    – Herb Schulz
    May 2 '17 at 17:28






  • 1




    The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
    – ShreevatsaR
    May 2 '17 at 17:41










  • @ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
    – Schweinebacke
    May 2 '17 at 18:04














1












1








1







How to delete a file in latex code with normal complie tex. I create temporary files and when i finish using them I want to delete them. It not delete by bash or editor.
Thankyou!










share|improve this question















How to delete a file in latex code with normal complie tex. I create temporary files and when i finish using them I want to delete them. It not delete by bash or editor.
Thankyou!







tex-core filesystem-access






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 2 '17 at 16:54









Torbjørn T.

154k13245434




154k13245434










asked May 2 '17 at 15:43









Afrendly Lee

10812




10812








  • 5




    TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
    – Schweinebacke
    May 2 '17 at 15:47






  • 2




    Related/duplicate: Deleting external/auxiliary files?
    – Werner
    May 2 '17 at 16:53






  • 1




    I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
    – Herb Schulz
    May 2 '17 at 17:28






  • 1




    The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
    – ShreevatsaR
    May 2 '17 at 17:41










  • @ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
    – Schweinebacke
    May 2 '17 at 18:04














  • 5




    TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
    – Schweinebacke
    May 2 '17 at 15:47






  • 2




    Related/duplicate: Deleting external/auxiliary files?
    – Werner
    May 2 '17 at 16:53






  • 1




    I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
    – Herb Schulz
    May 2 '17 at 17:28






  • 1




    The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
    – ShreevatsaR
    May 2 '17 at 17:41










  • @ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
    – Schweinebacke
    May 2 '17 at 18:04








5




5




TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
– Schweinebacke
May 2 '17 at 15:47




TeX cannot delete files. You have to use a extension like write18 to call an external program/shell to delete a file.
– Schweinebacke
May 2 '17 at 15:47




2




2




Related/duplicate: Deleting external/auxiliary files?
– Werner
May 2 '17 at 16:53




Related/duplicate: Deleting external/auxiliary files?
– Werner
May 2 '17 at 16:53




1




1




I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
– Herb Schulz
May 2 '17 at 17:28




I'd be wary of deleting files via shell-escape. Until you're ready to clean up you want them around; e.g., if you are doing cross-referencing or a bibliography deleting the .aux file between runs will not get you what you want. I believe most editors that act as front ends for running TeX also have a clean command (e.g., maybe called Trash AUX Files).
– Herb Schulz
May 2 '17 at 17:28




1




1




The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
– ShreevatsaR
May 2 '17 at 17:41




The question sounds like a duplicate of the question Deleting external/auxiliary files that Werner posted, but none of the answers there actually address it. @Schweinebacke can you just post your comment as an answer? This seems like a useful question and answer to have around, for future reference.
– ShreevatsaR
May 2 '17 at 17:41












@ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
– Schweinebacke
May 2 '17 at 18:04




@ShreevatsaR For an answer I'd need to know the system, the format and eventually the used engine. So: No, I cannot give a real answer. But feel free to do it.
– Schweinebacke
May 2 '17 at 18:04










1 Answer
1






active

oldest

votes


















2














You could use the cool latex automation tool arara to automatically delete the text file after the compilation is finished:



% !TeX program = txs:///arara
% arara: pdflatex
% arara: clean: { files: [ foo.txt ] }

documentclass{article}

begin{document}
content...
end{document}





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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f367808%2fhow-to-delete-a-file-in-latex-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









    2














    You could use the cool latex automation tool arara to automatically delete the text file after the compilation is finished:



    % !TeX program = txs:///arara
    % arara: pdflatex
    % arara: clean: { files: [ foo.txt ] }

    documentclass{article}

    begin{document}
    content...
    end{document}





    share|improve this answer


























      2














      You could use the cool latex automation tool arara to automatically delete the text file after the compilation is finished:



      % !TeX program = txs:///arara
      % arara: pdflatex
      % arara: clean: { files: [ foo.txt ] }

      documentclass{article}

      begin{document}
      content...
      end{document}





      share|improve this answer
























        2












        2








        2






        You could use the cool latex automation tool arara to automatically delete the text file after the compilation is finished:



        % !TeX program = txs:///arara
        % arara: pdflatex
        % arara: clean: { files: [ foo.txt ] }

        documentclass{article}

        begin{document}
        content...
        end{document}





        share|improve this answer












        You could use the cool latex automation tool arara to automatically delete the text file after the compilation is finished:



        % !TeX program = txs:///arara
        % arara: pdflatex
        % arara: clean: { files: [ foo.txt ] }

        documentclass{article}

        begin{document}
        content...
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 13 mins ago









        samcarter

        85k794271




        85k794271






























            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%2f367808%2fhow-to-delete-a-file-in-latex-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

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)