Skip to main content

Integrity check

Now I got this super-bibliography with thousands of entries and want to know if all entries are ok, or if one contains a weird character which is displayed incorrectly or even inhibits a successful compilation by LaTeX/BibTeX. How do I do that? Probably the easiest way is to run the following LaTeX file

\documentclass{amsart}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\nocite{*}
\bibliographystyle{amsplain}
\bibliography{bibliography}
\end{document}

through the following script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

charset=$(file -bi bibliography.bib | awk '{print $2}')

if [ $charset == charset=utf8 ]; then
  echo "Encoding ok"
else
  echo "Non UTF character detected"
fi

errors=$(rubber --pdf --quiet biblist.tex 2>&1)
if [ -z "$errors" ]; then
  echo "Compilation successful"
else
  echo "Compilation failed"
  echo $errors
fi

rubber --pdf --clean biblist.tex
Contents © 2018 Cobra · About · Privacy · Powered by Nikola · Creative Commons License BY-NC-SA