`latexmk` with cleanup and `-pvc`











up vote
0
down vote

favorite












I am unable to put the -pvc (preview continuously) and -c (clean up) options together for latexmk.



latexmk -pdf -pvc -c file.tex


My observation: After giving -c option, the file gets compiled, (regeneratable) files are deleted and I am back to the command prompt.



Is it possible to achieve this?



-- Mike










share|improve this question






















  • I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
    – Teepeemm
    Sep 29 at 18:42










  • @Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
    – Mike V.D.C.
    Sep 30 at 6:36















up vote
0
down vote

favorite












I am unable to put the -pvc (preview continuously) and -c (clean up) options together for latexmk.



latexmk -pdf -pvc -c file.tex


My observation: After giving -c option, the file gets compiled, (regeneratable) files are deleted and I am back to the command prompt.



Is it possible to achieve this?



-- Mike










share|improve this question






















  • I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
    – Teepeemm
    Sep 29 at 18:42










  • @Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
    – Mike V.D.C.
    Sep 30 at 6:36













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am unable to put the -pvc (preview continuously) and -c (clean up) options together for latexmk.



latexmk -pdf -pvc -c file.tex


My observation: After giving -c option, the file gets compiled, (regeneratable) files are deleted and I am back to the command prompt.



Is it possible to achieve this?



-- Mike










share|improve this question













I am unable to put the -pvc (preview continuously) and -c (clean up) options together for latexmk.



latexmk -pdf -pvc -c file.tex


My observation: After giving -c option, the file gets compiled, (regeneratable) files are deleted and I am back to the command prompt.



Is it possible to achieve this?



-- Mike







latexmk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 29 at 17:43









Mike V.D.C.

1335




1335












  • I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
    – Teepeemm
    Sep 29 at 18:42










  • @Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
    – Mike V.D.C.
    Sep 30 at 6:36


















  • I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
    – Teepeemm
    Sep 29 at 18:42










  • @Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
    – Mike V.D.C.
    Sep 30 at 6:36
















I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
– Teepeemm
Sep 29 at 18:42




I'm not quite understanding. -pvc implies continuous compilation, which needs the auxiliary files, which means they can't be deleted. Or are you wanting the auxiliary files to be regenerated whenever you make a change? Why not just leave them around?
– Teepeemm
Sep 29 at 18:42












@Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
– Mike V.D.C.
Sep 30 at 6:36




@Teepeemm This is precisely I want! I would like to regenerate all auxiliary files every time src file.tex is updated. and get deleted upon successful compilation. I need this as I have some restrictions on bandwidth and filesystem in terms of number of files. (Weird, huh?)
– Mike V.D.C.
Sep 30 at 6:36










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You can write a small shell script:



f=/tmp/$$.tmp
touch $f
src=foo.tex
src="$1";
echo -e "$src -- $fn";

while true
do
if [ ${src} -nt ${f} ];
then
echo "File modified";
latexmk -c ${src}
sleep 5;
fi;
touch ${f};
sleep 5; # This is essential.
done





share|improve this answer





















  • Welcome to TeX.SX!
    – Bobyandbob
    Sep 29 at 18:26










  • If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
    – Mike V.D.C.
    Sep 29 at 18:36










  • I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
    – Teepeemm
    Sep 29 at 18:40










  • @MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
    – alephzero
    Sep 29 at 21:33












  • @Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
    – Mike V.D.C.
    Sep 30 at 6:42











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%2f453108%2flatexmk-with-cleanup-and-pvc%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
0
down vote













You can write a small shell script:



f=/tmp/$$.tmp
touch $f
src=foo.tex
src="$1";
echo -e "$src -- $fn";

while true
do
if [ ${src} -nt ${f} ];
then
echo "File modified";
latexmk -c ${src}
sleep 5;
fi;
touch ${f};
sleep 5; # This is essential.
done





share|improve this answer





















  • Welcome to TeX.SX!
    – Bobyandbob
    Sep 29 at 18:26










  • If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
    – Mike V.D.C.
    Sep 29 at 18:36










  • I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
    – Teepeemm
    Sep 29 at 18:40










  • @MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
    – alephzero
    Sep 29 at 21:33












  • @Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
    – Mike V.D.C.
    Sep 30 at 6:42















up vote
0
down vote













You can write a small shell script:



f=/tmp/$$.tmp
touch $f
src=foo.tex
src="$1";
echo -e "$src -- $fn";

while true
do
if [ ${src} -nt ${f} ];
then
echo "File modified";
latexmk -c ${src}
sleep 5;
fi;
touch ${f};
sleep 5; # This is essential.
done





share|improve this answer





















  • Welcome to TeX.SX!
    – Bobyandbob
    Sep 29 at 18:26










  • If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
    – Mike V.D.C.
    Sep 29 at 18:36










  • I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
    – Teepeemm
    Sep 29 at 18:40










  • @MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
    – alephzero
    Sep 29 at 21:33












  • @Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
    – Mike V.D.C.
    Sep 30 at 6:42













up vote
0
down vote










up vote
0
down vote









You can write a small shell script:



f=/tmp/$$.tmp
touch $f
src=foo.tex
src="$1";
echo -e "$src -- $fn";

while true
do
if [ ${src} -nt ${f} ];
then
echo "File modified";
latexmk -c ${src}
sleep 5;
fi;
touch ${f};
sleep 5; # This is essential.
done





share|improve this answer












You can write a small shell script:



f=/tmp/$$.tmp
touch $f
src=foo.tex
src="$1";
echo -e "$src -- $fn";

while true
do
if [ ${src} -nt ${f} ];
then
echo "File modified";
latexmk -c ${src}
sleep 5;
fi;
touch ${f};
sleep 5; # This is essential.
done






share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 29 at 18:09









user5325

1




1












  • Welcome to TeX.SX!
    – Bobyandbob
    Sep 29 at 18:26










  • If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
    – Mike V.D.C.
    Sep 29 at 18:36










  • I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
    – Teepeemm
    Sep 29 at 18:40










  • @MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
    – alephzero
    Sep 29 at 21:33












  • @Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
    – Mike V.D.C.
    Sep 30 at 6:42


















  • Welcome to TeX.SX!
    – Bobyandbob
    Sep 29 at 18:26










  • If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
    – Mike V.D.C.
    Sep 29 at 18:36










  • I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
    – Teepeemm
    Sep 29 at 18:40










  • @MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
    – alephzero
    Sep 29 at 21:33












  • @Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
    – Mike V.D.C.
    Sep 30 at 6:42
















Welcome to TeX.SX!
– Bobyandbob
Sep 29 at 18:26




Welcome to TeX.SX!
– Bobyandbob
Sep 29 at 18:26












If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
– Mike V.D.C.
Sep 29 at 18:36




If one has to use bash script, why use latexmk in that case? Just put pdflatex, followed by rm -f commands... I believe this can be achieved with the power of latexmk.
– Mike V.D.C.
Sep 29 at 18:36












I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
– Teepeemm
Sep 29 at 18:40




I may be overlooking things, but I'm not seeing how you accomplish the -pvc portion.
– Teepeemm
Sep 29 at 18:40












@MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
– alephzero
Sep 29 at 21:33






@MikeV.D.C. latexmk can do much more than just a single rub of pdflatex - e.g. it will repeatedly compile the document until all the cross references, tables of contents, indexes, etc, are self-consistent, but only do the minimum number of recompiles to reach that state. (That's why it seems pointless to me to delete all the auxiliary files every time you run latexmk - it is just making latexmk work harder for no obvious reason).
– alephzero
Sep 29 at 21:33














@Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
– Mike V.D.C.
Sep 30 at 6:42




@Teepeemm, I suspect that @user5325 is using some *nix system (e.g. ubuntu). So the default previewer (e.g. evince on ubuntu), once opened, automatically update the document on every change. Thus achieving -pvc.
– Mike V.D.C.
Sep 30 at 6:42


















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%2f453108%2flatexmk-with-cleanup-and-pvc%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 change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?