2

I was trying to run biber (version 2.10; using Texmaker) when this error occurred:

INFO - This is Biber 2.10 INFO - Logfile is 'provabib.blg' ERROR - provabib.bcf is malformed, last biblatex run probably failed. Deleted provabib.bbl INFO - ERRORS: 1

After a few attempts, I found out that the problem was the package constants, which I was using to automatically number the constants I define; removing it, everything works fine. I am definitely not an expert and I have no idea how to fix this, but I guess it's because the package constants is a bit outdated. Do you now any way to avoid this issue? Similar packages doing the same job are welcome too.

Here's a minimal working example:

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel} 
\usepackage[autostyle]{csquotes}
\usepackage[style=alphabetic,backend=biber]{biblatex}
%%\usepackage{constants}        %%<--- this one produces the error
   %% \newconstantfamily{K}{symbol=K}       %% An example
\begin{filecontents*}{\jobname.bib}
   @book{rudin,
   author  = "Rudin, Walter",
   title   = "Real and Complex Analysis",
   year    = "1966",
   publisher = "McGraw-Hill"
 }
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
   This is a citation: \cite{rudin}. \\
   %% This, instead, an example of use of the ``constants'' package:
   %% \[\Cl[K]{nameconstant}=e^\pi;\]
   %% now here's a new constant of the same family: $\C[K]$, while here I am referring to the first constant defined: $\Cr{nameconstant}$.
   \printbibliography
\end{document}
14
  • Welcome to TeX.SX! I can reproduce the error. Indeed, with the constants package the end of the bcf file is somehow missing. However, except for producing the error, the constants package is not actually used in your MWE. What exactly are you using it for?
    – gusbrs
    Mar 11, 2018 at 21:51
  • 2
    constants.sty inserts \@@end at the end of the document and so hinders biblatex to write its file. Mar 11, 2018 at 22:24
  • 1
    Imho one shouldn't use this constants.sty. It probably breaks also other packages. Mar 11, 2018 at 22:34
  • 1
    If I may, I suggest you take a second look at glossaries. It is quite a powerful package and does more than it looks at first glance.
    – gusbrs
    Mar 11, 2018 at 22:52
  • 2
    There are some example glossary documents at dickimaw-books.com/gallery/#glossaries if you want an idea of what you can do with the glossaries package. Mar 12, 2018 at 0:56

2 Answers 2

6

The constants package inserts throught \AtEndDocument the commands \deadcycles\z@\@@end which end the compilation and so hinders biblatex to finish the bcf-file.

I don't know why the package does this -- it looks like a bad copy of the original code in the kernel -- but it means that the package can break other packages completly and so shouldn't be used.

1
  • 1
    Thank you very much. To repeat my comment in this slightly more prominent place: \AfterEndDocument is completely broken by constants. So all packages that rely on it won't work properly (I could only find biblatex, minted andpythontex that use this). constants also prevents execution of all \AtEndDocument issued after constants is loaded. That potentially affects many more packages, but could probably be remedied by changing the loading order in most cases.
    – moewe
    Mar 12, 2018 at 15:40
2

It turns out that the simple trick described in the first answer of the question Automatically numbering constants does exactly what I want, and avoids that error caused by constants.

In my case, I needed several "epsilons", numbered increasingly, and the possibility to refer to old ones.

The following counter was added in the preamble (notice that hyperref is needed):

\usepackage{hyperref}    
\newcounter{epscnt}                     %% Defines the counter for epsilon
\newcommand{\neweps}{                   %% Used to introduce a new epsilon
    \refstepcounter{epscnt}             %%    with the right subscript
    \ensuremath{\epsilon_\theepscnt}
    }
\newcommand{\oldeps}[1]{\ensuremath{\epsilon_{\ref*{#1}}}}  %% Used to refer to old constants

And here's a (working) example of how it's used (needs probably some improvement, in case other constants are needed):

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel} 
\usepackage[autostyle]{csquotes}
\usepackage[style=alphabetic,backend=biber]{biblatex}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
     @book{rudin,
     author  = "Rudin, Walter",
     title   = "Real and Complex Analysis",
     year    = "1966",
     publisher = "McGraw-Hill"
     }
     \end{filecontents*}
 \addbibresource{\jobname.bib}

 \newcounter{epscnt}            %% epsilon
 \newcommand{\neweps}{
    \refstepcounter{epscnt}
    \ensuremath{\epsilon_\theepscnt}
    }
 \newcommand{\oldeps}[1]{\ensuremath{\epsilon_{\ref*{#1}}}}

 \newcounter{uckcnt}            %% uppercase K
 \newcommand{\newuck}{
    \refstepcounter{uckcnt}
    \ensuremath{K_\theuckcnt}
    }
 \newcommand{\olduck}[1]{\ensuremath{K_{\ref*{#1}}}}


 \begin{document}
   Here are some numbered constants: $\neweps$, $\neweps$, $\neweps\label{tre}$; now a citation: \cite[99]{rudin}. Finally, new epsilons, old ones and other constants: $\neweps$, $\oldeps{tre}$, $\newuck\label{uno}$, $\newuck$, $\olduck{uno}$.
   \printbibliography
 \end{document}

The output

This looks good to me; if you have suggestions on how to improve it, I'll be glad to hear them.

3
  • 2
    Mattia, thank you for reporting back. However link only answers are not encouraged on the site. Would you be so kind as to expand on the answer and how you used that link to solve the problem here? (preferably with a MWE).
    – gusbrs
    Mar 12, 2018 at 13:43
  • 1
    @gusbrs Sure, I added it, thanks for the feedback. Mar 12, 2018 at 21:54
  • It looks much nicer now. Thank you. (+1)
    – gusbrs
    Mar 13, 2018 at 2:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .