output directory Asymptote in TeXLive












3














How does the asymptote and asypictureB packages determine the output file and working directories? I tried to use asypictureB and TeXLive to produce my files and put all the output files to a different directory. For pdflatex, this can be done by the -output-directory=dir option, and the *.asy files are in the dir folder. but then asy.exe cannot find this file. I tried to let TeX know the working directory by following this post: Asymptote Files
and tried all the options



begin{document}
renewcommandasydir{asytmp}
asysetup{dir= xxx}
begin{asypicture}{}
end{asypicture}
end{document}


none of them seemed to affect the working directory. I also tried to use TexStudio to change the asymptote command to be asy.exe dir/filename.asy, or include the -cd dir after asy.exe, but none of these work. asy.exe keeps searching for the files under the current directory.



Under mac, I found a workaround by revising the pdflatex command in TexStudio to include a series of bash commands:



sh -c "cp %.tex ~/asytmp/%.tex
& cd ~/asytmp/ && pdflatex -shell-escape -synctex=1 -interaction=nonstopmode
%.tex
&& cd - && cp ~/asytmp/%.pdf %.pdf
&& cd ~/asytmp && find . ! -name '1' -delete"


but when I followed the same way and tried under Windows by using
cmd /C "... | ... | ..." it does not work because the cd dir command doesn't work under windows and everything seems to be still executed under the current directory.



any thoughts on how to get this to work? Is it possible to revise the ~/.asy/config.asy file? I don't even know if the asymptote and asypictureB packages use this config file.










share|improve this question




















  • 1




    First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
    – Charles Staats
    Nov 7 at 7:38
















3














How does the asymptote and asypictureB packages determine the output file and working directories? I tried to use asypictureB and TeXLive to produce my files and put all the output files to a different directory. For pdflatex, this can be done by the -output-directory=dir option, and the *.asy files are in the dir folder. but then asy.exe cannot find this file. I tried to let TeX know the working directory by following this post: Asymptote Files
and tried all the options



begin{document}
renewcommandasydir{asytmp}
asysetup{dir= xxx}
begin{asypicture}{}
end{asypicture}
end{document}


none of them seemed to affect the working directory. I also tried to use TexStudio to change the asymptote command to be asy.exe dir/filename.asy, or include the -cd dir after asy.exe, but none of these work. asy.exe keeps searching for the files under the current directory.



Under mac, I found a workaround by revising the pdflatex command in TexStudio to include a series of bash commands:



sh -c "cp %.tex ~/asytmp/%.tex
& cd ~/asytmp/ && pdflatex -shell-escape -synctex=1 -interaction=nonstopmode
%.tex
&& cd - && cp ~/asytmp/%.pdf %.pdf
&& cd ~/asytmp && find . ! -name '1' -delete"


but when I followed the same way and tried under Windows by using
cmd /C "... | ... | ..." it does not work because the cd dir command doesn't work under windows and everything seems to be still executed under the current directory.



any thoughts on how to get this to work? Is it possible to revise the ~/.asy/config.asy file? I don't even know if the asymptote and asypictureB packages use this config file.










share|improve this question




















  • 1




    First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
    – Charles Staats
    Nov 7 at 7:38














3












3








3







How does the asymptote and asypictureB packages determine the output file and working directories? I tried to use asypictureB and TeXLive to produce my files and put all the output files to a different directory. For pdflatex, this can be done by the -output-directory=dir option, and the *.asy files are in the dir folder. but then asy.exe cannot find this file. I tried to let TeX know the working directory by following this post: Asymptote Files
and tried all the options



begin{document}
renewcommandasydir{asytmp}
asysetup{dir= xxx}
begin{asypicture}{}
end{asypicture}
end{document}


none of them seemed to affect the working directory. I also tried to use TexStudio to change the asymptote command to be asy.exe dir/filename.asy, or include the -cd dir after asy.exe, but none of these work. asy.exe keeps searching for the files under the current directory.



Under mac, I found a workaround by revising the pdflatex command in TexStudio to include a series of bash commands:



sh -c "cp %.tex ~/asytmp/%.tex
& cd ~/asytmp/ && pdflatex -shell-escape -synctex=1 -interaction=nonstopmode
%.tex
&& cd - && cp ~/asytmp/%.pdf %.pdf
&& cd ~/asytmp && find . ! -name '1' -delete"


but when I followed the same way and tried under Windows by using
cmd /C "... | ... | ..." it does not work because the cd dir command doesn't work under windows and everything seems to be still executed under the current directory.



any thoughts on how to get this to work? Is it possible to revise the ~/.asy/config.asy file? I don't even know if the asymptote and asypictureB packages use this config file.










share|improve this question















How does the asymptote and asypictureB packages determine the output file and working directories? I tried to use asypictureB and TeXLive to produce my files and put all the output files to a different directory. For pdflatex, this can be done by the -output-directory=dir option, and the *.asy files are in the dir folder. but then asy.exe cannot find this file. I tried to let TeX know the working directory by following this post: Asymptote Files
and tried all the options



begin{document}
renewcommandasydir{asytmp}
asysetup{dir= xxx}
begin{asypicture}{}
end{asypicture}
end{document}


none of them seemed to affect the working directory. I also tried to use TexStudio to change the asymptote command to be asy.exe dir/filename.asy, or include the -cd dir after asy.exe, but none of these work. asy.exe keeps searching for the files under the current directory.



Under mac, I found a workaround by revising the pdflatex command in TexStudio to include a series of bash commands:



sh -c "cp %.tex ~/asytmp/%.tex
& cd ~/asytmp/ && pdflatex -shell-escape -synctex=1 -interaction=nonstopmode
%.tex
&& cd - && cp ~/asytmp/%.pdf %.pdf
&& cd ~/asytmp && find . ! -name '1' -delete"


but when I followed the same way and tried under Windows by using
cmd /C "... | ... | ..." it does not work because the cd dir command doesn't work under windows and everything seems to be still executed under the current directory.



any thoughts on how to get this to work? Is it possible to revise the ~/.asy/config.asy file? I don't even know if the asymptote and asypictureB packages use this config file.







pdftex texstudio asymptote output folders






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 7:26









Raaja

2,1552630




2,1552630










asked Nov 7 at 3:57









Shuodao

656




656








  • 1




    First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
    – Charles Staats
    Nov 7 at 7:38














  • 1




    First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
    – Charles Staats
    Nov 7 at 7:38








1




1




First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
– Charles Staats
Nov 7 at 7:38




First note: the asypictureB package does not allow you to change the working directory. The asymptote package does (using asydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
– Charles Staats
Nov 7 at 7:38










1 Answer
1






active

oldest

votes


















0














I tried again and the /asydir command seems to interfere with how pdflatex proccesses the *.asy file and I got the error "cannot write on the file dir/*-noname-1.asy".



It turns out that the workaround in MacOS described above works in windows. just need to keep using "&" instead of "|" between the different codes.



cmd /C "@echo off && pushd .
&& copy %.tex C:localtexmftmp%.tex & cd C:localtexmftmp
&& pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
&& asy.exe *.asy
&& pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
&& popd
&& copy C:localtexmftmp%.pdf %.pdf"
| txs:///view


NOTE: I formatted these codes to be multi-lines for readability, but it should be made sure that all the things are written in one line in TeXStudio.






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%2f458740%2foutput-directory-asymptote-in-texlive%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









    0














    I tried again and the /asydir command seems to interfere with how pdflatex proccesses the *.asy file and I got the error "cannot write on the file dir/*-noname-1.asy".



    It turns out that the workaround in MacOS described above works in windows. just need to keep using "&" instead of "|" between the different codes.



    cmd /C "@echo off && pushd .
    && copy %.tex C:localtexmftmp%.tex & cd C:localtexmftmp
    && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
    && asy.exe *.asy
    && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
    && popd
    && copy C:localtexmftmp%.pdf %.pdf"
    | txs:///view


    NOTE: I formatted these codes to be multi-lines for readability, but it should be made sure that all the things are written in one line in TeXStudio.






    share|improve this answer




























      0














      I tried again and the /asydir command seems to interfere with how pdflatex proccesses the *.asy file and I got the error "cannot write on the file dir/*-noname-1.asy".



      It turns out that the workaround in MacOS described above works in windows. just need to keep using "&" instead of "|" between the different codes.



      cmd /C "@echo off && pushd .
      && copy %.tex C:localtexmftmp%.tex & cd C:localtexmftmp
      && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
      && asy.exe *.asy
      && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
      && popd
      && copy C:localtexmftmp%.pdf %.pdf"
      | txs:///view


      NOTE: I formatted these codes to be multi-lines for readability, but it should be made sure that all the things are written in one line in TeXStudio.






      share|improve this answer


























        0












        0








        0






        I tried again and the /asydir command seems to interfere with how pdflatex proccesses the *.asy file and I got the error "cannot write on the file dir/*-noname-1.asy".



        It turns out that the workaround in MacOS described above works in windows. just need to keep using "&" instead of "|" between the different codes.



        cmd /C "@echo off && pushd .
        && copy %.tex C:localtexmftmp%.tex & cd C:localtexmftmp
        && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
        && asy.exe *.asy
        && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
        && popd
        && copy C:localtexmftmp%.pdf %.pdf"
        | txs:///view


        NOTE: I formatted these codes to be multi-lines for readability, but it should be made sure that all the things are written in one line in TeXStudio.






        share|improve this answer














        I tried again and the /asydir command seems to interfere with how pdflatex proccesses the *.asy file and I got the error "cannot write on the file dir/*-noname-1.asy".



        It turns out that the workaround in MacOS described above works in windows. just need to keep using "&" instead of "|" between the different codes.



        cmd /C "@echo off && pushd .
        && copy %.tex C:localtexmftmp%.tex & cd C:localtexmftmp
        && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
        && asy.exe *.asy
        && pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex
        && popd
        && copy C:localtexmftmp%.pdf %.pdf"
        | txs:///view


        NOTE: I formatted these codes to be multi-lines for readability, but it should be made sure that all the things are written in one line in TeXStudio.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 7 at 23:30

























        answered Nov 7 at 17:26









        Shuodao

        656




        656






























            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%2f458740%2foutput-directory-asymptote-in-texlive%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?