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.
latexmk
add a comment |
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.
latexmk
add a comment |
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.
latexmk
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
latexmk
asked Sep 30 at 12:11
rsgny
613
613
add a comment |
add a comment |
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)
add a comment |
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)
add a comment |
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)
add a comment |
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)
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)
answered Oct 4 at 13:18
rsgny
613
613
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%2f453181%2ferrors-with-latexmk-c-cleanup-option%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