Running pdflatex the minimally necessary number of times for elsarticle












0















Running pdflatex ONCE on



documentclass{elsarticle}%%% version 3.1 from CTAN
begin{document}
begin{frontmatter}
author[1]{Johann Sebastian Bach}
author[2]{Ludwig van Beethovencorref{cor2}}
cortext[cor2]{Corresponding author}%
address[1]{Thomaskirche, Leipzig}
address[2]{Zentralfriedhof Wien}
end{frontmatter}
end{document}


produces the following output:



output of the first run



As you see, the labels of both authors are 1, and the superscript star after Mr. Beethoven is missing. You need the second run of pdflatex to correct this issue.



However, running pdflatex ALWAYS at least twice not is not what you want: it eats up your time, especially on large papers, whereas running pdflatex once might sometimes suffice if the right .aux files are available from a prior run. I looked into the .log file and console output for hints whether a second rerun is needed but cannot find anything. My usual approach to checking whether a rerun is needed is saying something like



MESSAGE_FOR_RERUN := '(LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.)|(LaTeX Warning: There were undefined references.)|(LaTeX Warning: Citation [^[:cntrl:]]* on page [0-9]* undefined on)|(Package natbib Warning: There were undefined citations.)|((mparhack) *Rerun to get them right.)'


in the beginning of a makefile and



for i in $(SOURCES); do 
$(PDFLATEX) $$i ;
done
if (egrep $(MESSAGE_FOR_RERUN) $(OBJECTS)); then
for i in $(SOURCES); do $(PDFLATEX) $$i ; done;
fi


(where the variables are defined appropriately) in a rule of the makefile.



Of course, you can have latexmk or usepackage[mainaux]{rerunfilecheck} do the job, but I wonder: can you continue doing it the previous way via makefiles, and if so, which string to search for in the log files?










share|improve this question

























  • I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

    – Sigur
    10 mins ago











  • @Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

    – user49915
    1 min ago













  • In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

    – user49915
    1 min ago
















0















Running pdflatex ONCE on



documentclass{elsarticle}%%% version 3.1 from CTAN
begin{document}
begin{frontmatter}
author[1]{Johann Sebastian Bach}
author[2]{Ludwig van Beethovencorref{cor2}}
cortext[cor2]{Corresponding author}%
address[1]{Thomaskirche, Leipzig}
address[2]{Zentralfriedhof Wien}
end{frontmatter}
end{document}


produces the following output:



output of the first run



As you see, the labels of both authors are 1, and the superscript star after Mr. Beethoven is missing. You need the second run of pdflatex to correct this issue.



However, running pdflatex ALWAYS at least twice not is not what you want: it eats up your time, especially on large papers, whereas running pdflatex once might sometimes suffice if the right .aux files are available from a prior run. I looked into the .log file and console output for hints whether a second rerun is needed but cannot find anything. My usual approach to checking whether a rerun is needed is saying something like



MESSAGE_FOR_RERUN := '(LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.)|(LaTeX Warning: There were undefined references.)|(LaTeX Warning: Citation [^[:cntrl:]]* on page [0-9]* undefined on)|(Package natbib Warning: There were undefined citations.)|((mparhack) *Rerun to get them right.)'


in the beginning of a makefile and



for i in $(SOURCES); do 
$(PDFLATEX) $$i ;
done
if (egrep $(MESSAGE_FOR_RERUN) $(OBJECTS)); then
for i in $(SOURCES); do $(PDFLATEX) $$i ; done;
fi


(where the variables are defined appropriately) in a rule of the makefile.



Of course, you can have latexmk or usepackage[mainaux]{rerunfilecheck} do the job, but I wonder: can you continue doing it the previous way via makefiles, and if so, which string to search for in the log files?










share|improve this question

























  • I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

    – Sigur
    10 mins ago











  • @Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

    – user49915
    1 min ago













  • In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

    – user49915
    1 min ago














0












0








0








Running pdflatex ONCE on



documentclass{elsarticle}%%% version 3.1 from CTAN
begin{document}
begin{frontmatter}
author[1]{Johann Sebastian Bach}
author[2]{Ludwig van Beethovencorref{cor2}}
cortext[cor2]{Corresponding author}%
address[1]{Thomaskirche, Leipzig}
address[2]{Zentralfriedhof Wien}
end{frontmatter}
end{document}


produces the following output:



output of the first run



As you see, the labels of both authors are 1, and the superscript star after Mr. Beethoven is missing. You need the second run of pdflatex to correct this issue.



However, running pdflatex ALWAYS at least twice not is not what you want: it eats up your time, especially on large papers, whereas running pdflatex once might sometimes suffice if the right .aux files are available from a prior run. I looked into the .log file and console output for hints whether a second rerun is needed but cannot find anything. My usual approach to checking whether a rerun is needed is saying something like



MESSAGE_FOR_RERUN := '(LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.)|(LaTeX Warning: There were undefined references.)|(LaTeX Warning: Citation [^[:cntrl:]]* on page [0-9]* undefined on)|(Package natbib Warning: There were undefined citations.)|((mparhack) *Rerun to get them right.)'


in the beginning of a makefile and



for i in $(SOURCES); do 
$(PDFLATEX) $$i ;
done
if (egrep $(MESSAGE_FOR_RERUN) $(OBJECTS)); then
for i in $(SOURCES); do $(PDFLATEX) $$i ; done;
fi


(where the variables are defined appropriately) in a rule of the makefile.



Of course, you can have latexmk or usepackage[mainaux]{rerunfilecheck} do the job, but I wonder: can you continue doing it the previous way via makefiles, and if so, which string to search for in the log files?










share|improve this question
















Running pdflatex ONCE on



documentclass{elsarticle}%%% version 3.1 from CTAN
begin{document}
begin{frontmatter}
author[1]{Johann Sebastian Bach}
author[2]{Ludwig van Beethovencorref{cor2}}
cortext[cor2]{Corresponding author}%
address[1]{Thomaskirche, Leipzig}
address[2]{Zentralfriedhof Wien}
end{frontmatter}
end{document}


produces the following output:



output of the first run



As you see, the labels of both authors are 1, and the superscript star after Mr. Beethoven is missing. You need the second run of pdflatex to correct this issue.



However, running pdflatex ALWAYS at least twice not is not what you want: it eats up your time, especially on large papers, whereas running pdflatex once might sometimes suffice if the right .aux files are available from a prior run. I looked into the .log file and console output for hints whether a second rerun is needed but cannot find anything. My usual approach to checking whether a rerun is needed is saying something like



MESSAGE_FOR_RERUN := '(LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.)|(LaTeX Warning: There were undefined references.)|(LaTeX Warning: Citation [^[:cntrl:]]* on page [0-9]* undefined on)|(Package natbib Warning: There were undefined citations.)|((mparhack) *Rerun to get them right.)'


in the beginning of a makefile and



for i in $(SOURCES); do 
$(PDFLATEX) $$i ;
done
if (egrep $(MESSAGE_FOR_RERUN) $(OBJECTS)); then
for i in $(SOURCES); do $(PDFLATEX) $$i ; done;
fi


(where the variables are defined appropriately) in a rule of the makefile.



Of course, you can have latexmk or usepackage[mainaux]{rerunfilecheck} do the job, but I wonder: can you continue doing it the previous way via makefiles, and if so, which string to search for in the log files?







elsarticle logging






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 mins ago







user49915

















asked 14 mins ago









user49915user49915

594121




594121













  • I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

    – Sigur
    10 mins ago











  • @Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

    – user49915
    1 min ago













  • In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

    – user49915
    1 min ago



















  • I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

    – Sigur
    10 mins ago











  • @Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

    – user49915
    1 min ago













  • In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

    – user49915
    1 min ago

















I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

– Sigur
10 mins ago





I'm not sure if I understood your question, since after you compile the 2nd time, that problem disappears. If you need to compile it again it is because you changed or added some material, not because the title part. So, simply type, compile and be happy. Just make sure to run it 2 or 3 times before submit the paper.

– Sigur
10 mins ago













@Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

– user49915
1 min ago







@Sigur Ideally, we'd do it as you say. However, sometimes it doesn't occur to you that recompiling once more is needed. E.g., you need to cleanup your aux files, e.g., because you messed up with the sources which put something wrong into the .aux files. Sometimes you forget looking at this particular detail before submission (since you have dozens of other details to think about). Sometimes you wish to produce a clean copy before the submission (e.g., to get it proofread). Sometimes you follow the protocol among the coauthors that you have to check in "clean" PDF files into the repository.

– user49915
1 min ago















In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

– user49915
1 min ago





In summary, you wish that simply typing make determines itself whether compiling once, twice or more is needed.

– user49915
1 min ago










0






active

oldest

votes











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%2f479394%2frunning-pdflatex-the-minimally-necessary-number-of-times-for-elsarticle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479394%2frunning-pdflatex-the-minimally-necessary-number-of-times-for-elsarticle%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

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

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