output directory Asymptote in TeXLive
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
add a comment |
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
1
First note: theasypictureBpackage does not allow you to change the working directory. Theasymptotepackage does (usingasydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
– Charles Staats
Nov 7 at 7:38
add a comment |
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
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
pdftex texstudio asymptote output folders
edited Nov 7 at 7:26
Raaja
2,1552630
2,1552630
asked Nov 7 at 3:57
Shuodao
656
656
1
First note: theasypictureBpackage does not allow you to change the working directory. Theasymptotepackage does (usingasydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd
– Charles Staats
Nov 7 at 7:38
add a comment |
1
First note: theasypictureBpackage does not allow you to change the working directory. Theasymptotepackage does (usingasydir). 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
add a comment |
1 Answer
1
active
oldest
votes
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.
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
});
}
});
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%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
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 7 at 23:30
answered Nov 7 at 17:26
Shuodao
656
656
add a comment |
add a comment |
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.
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%2f458740%2foutput-directory-asymptote-in-texlive%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
First note: the
asypictureBpackage does not allow you to change the working directory. Theasymptotepackage does (usingasydir). Second note: You might find this helpful: sourceforge.net/p/asymptote/discussion/409349/thread/e35300dd– Charles Staats
Nov 7 at 7:38