Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: First build requires -f option #40

Open
thehale opened this issue Feb 21, 2023 · 0 comments
Open

fix: First build requires -f option #40

thehale opened this issue Feb 21, 2023 · 0 comments

Comments

@thehale
Copy link

thehale commented Feb 21, 2023

The README.md states the following:

(Don't use the -f option all the time; it seems to be necessary to get the first run to complete successfully at the moment.)

The issue appears to be the use of \tottab and \totfig which are only defined on the second and subsequent runs of latexmk. This undesirable behavior is discussed on a TeX StackExchange question where the accepted answer uses a substantially similar block of code for counting tables/figures.

A later answer recommends the use of the newer totalcount package which counts the tables/figures as expected on the first pass of latexmk.

Here are the key commands from the totalcount documentation:

\usepackage[figure,table,xspace]{totalcount}

% The following commands are added to the project
\totalfigures  % The number of figures in the document
\totaltables % The number of tables in the document

\iftotalfigures
  % Macros placed here only execute if there is at least one
  % figure in the document
\fi

\iftotaltables
  % Macros placed here only execute if there is at least one
  % table in the document
\fi

Replacing \totfig and \tottab with their totalcount counterparts in my local copy of the dissertation template has enabled latexmk to compile the document in a clean workspace without the need for the -f option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant