Skip to content

Commit

Permalink
We should ignore bibtex errors if it's simply an empty .bib file
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Jun 16, 2024
1 parent 8ea0cae commit 1b0dcb3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
12 changes: 7 additions & 5 deletions assets/article.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
<xsl:apply-templates select="/f:tree/f:backmatter/f:references" />
<xsl:text>\maketitle</xsl:text>
<xsl:apply-templates select="/f:tree/f:mainmatter" />
<!-- https://www.bibtex.com/s/bibliography-style-acmart-acm-reference-format/ -->
<xsl:text>\bibliographystyle{ACM-Reference-Format}</xsl:text>
<!-- https://www.bibtex.com/s/bibliography-style-misc-amsalpha/ -->
<!-- <xsl:text>\bibliographystyle{amsalpha}</xsl:text> -->
<xsl:text>\bibliography{\jobname.bib}</xsl:text>
<xsl:if test="count(/f:tree/f:backmatter/f:references/f:tree)>0">
<!-- https://www.bibtex.com/s/bibliography-style-acmart-acm-reference-format/ -->
<xsl:text>\bibliographystyle{ACM-Reference-Format}</xsl:text>
<!-- https://www.bibtex.com/s/bibliography-style-misc-amsalpha/ -->
<!-- <xsl:text>\bibliographystyle{amsalpha}</xsl:text> -->
<xsl:text>\bibliography{\jobname.bib}</xsl:text>
</xsl:if>
<xsl:text>\end{document}</xsl:text>
</xsl:template>

Expand Down
9 changes: 7 additions & 2 deletions lize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ cd build
# if [ -n "$CI" ]; then
# echo "lize.sh| CI is set, using xelatex"
xelatex -halt-on-error -interaction=nonstopmode --shell-escape $TEX_FILE
bibtex $AUX_FILE
# https://tex.stackexchange.com/a/295524/75671
# biber $TEX_FILE
# We should ignore bibtex errors if it's simply an empty .bib file
bibtex $AUX_FILE || echo "lize.sh| Ignoring bibtex error"
xelatex -halt-on-error -interaction=nonstopmode --shell-escape $TEX_FILE
xelatex -halt-on-error -interaction=nonstopmode --shell-escape $TEX_FILE
# else
Expand All @@ -38,4 +41,6 @@ cp build/$PDF_FILE output/$PDF_FILE

echo "lize.sh| Open build/$1.log to see the log."
echo "lize.sh| Open build/$TEX_FILE to see the LaTeX source."
echo "lize.sh| Open output/$PDF_FILE to see the result."
echo "lize.sh| Open output/$PDF_FILE to see the result."

# use ./lize.sh math-0001 2>&1|grep lize to see a short output
3 changes: 3 additions & 0 deletions tex/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
\newcommand{\texstrip}{}
\usepackage{mathtools, stmaryrd}

% https://tex.stackexchange.com/questions/383054/biblatex-error-incompatible-backref-package
% \usepackage[backend=biber]{biblatex}

% avoid package load order conflicts etc.
% otherwise with only
% \usepackage[subpreambles=true]{standalone}
Expand Down
4 changes: 3 additions & 1 deletion trees/math-0001.tree
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@
% }
}
}
}
}

% \p{We need to actually cite something \citek{chen2016infinitely} to make bibtex happy.}

0 comments on commit 1b0dcb3

Please sign in to comment.