1

I'm trying to implement the database of problems at http://www.math.canterbury.ac.nz/~m.hickman/LaTeX/LaTeX.shtml

On my Mac, I can get the following to compile with the default file problems.sty, question.bst, and SampleDatabase.bib by using pdflatex, bibtex, pdflatex, pdflatex.

\documentclass{article}
\usepackage{problems}
\Database{SampleDatabase}
\begin{document}
\tutorial{S3}
\end{document}

On my Windows computer, pdflatex compiles just fine, but when I run bibtex I see

Warning--entry type for "S3" isn't style-file defined
--line 149 of file SampleDatabase.bib

After running pdflatex twice more, I get a pdf that only says "Tutorial 1." and doesn't have a problem statement. Backtracking, this appears to be because the Windows bibtex says
The style file: biblatex.bst
whereas my Mac says
The style file: question.bst
And this appears to be because the Windows aux file has
\bibstyle{biblatex}
whereas my Mac has
\bibstyle{question}

I'm not entirely sure why this is happening. problems.sty has

\def\blx@auxinit@bibtex#1{%
  \blx@auxwrite\blx@auxout@bibtex
    {\def\do##1{,\blx@stripbib{##1}}}
    {\ifx\blx@auxout@bibtex\@mainaux
     \else
       \blx@msg@aux
     \fi
     \string\bibstyle{question}\blx@nl
     \string\bibdata{%
       \blx@ctrlfile@bibtex\blxauxsuffix
       \ifx#1\@empty
       \else
         \dolistloop#1%
       \fi}\blx@nl
     \string\citation{biblatex-control}}}

which seems like it should be doing the correct thing, but apparently isn't.

I've also found that \listfiles shows that my nonworking Windows' files are more up to date than my working Mac's files. But I'm not sure which file is responsible for breaking what used to work. What would have changed in the meantime to break a formerly working package?

  • 1
    well the package uses biblatex, and biblatex has changed in the last years. One would need to adapt the package. – Ulrike Fischer May 1 '18 at 21:18
2

That package is almost five years old now and hacks some of biblatex's internal commands. These internal commands have undergone quite some changes so that hacking them now does not work as intended any more. You can get around the problematic hacks by using the package with Biber instead of BibTeX.

\documentclass[11pt]{article}

\usepackage{graphicx,amsmath} 
\usepackage[biber]{problems}

\Database{SampleDatabase}

\Course{MATH361}
\Year{09}
\Occurence{S1}
\TutorialNumber{1}
\TutorialDate{March 24-26}

\begin{document}
\tutorial{1-1,1-2}

\problems[prefix=*]{1-3}
\end{document}

works for me when compiled with pdfLaTeX, pdfLaTeX, Biber, pdfLaTeX. See Biblatex with Biber: Configuring my editor to avoid undefined citations for help on setting your editor up to use Biber.


If you insist on using BibTeX, you will have to modify a renamed copy of question.bst (to question-mod.bst, say) such that the last lines from FUNCTION {output:main:begin} on read instead.

FUNCTION {output:main:begin} {
  "% $ biblatex auxiliary file $"                               write$ newline$
  "% $ biblatex bbl format version " "$Revision: 3.0 $"
  #12 entry.max$ substring$ #-3 entry.max$ substring$ * " $" *  write$ newline$
  "% Do not modify the above lines!"                            write$ newline$
  "%"                                                           write$ newline$
  "% This is an auxiliary file used by the 'biblatex' package." write$ newline$
  "% This file may safely be deleted. It will be recreated as"  write$ newline$
  "% required."                                                 write$ newline$
  "%"                                                           write$ newline$
  "\begingroup"                                                 write$ newline$
  "\makeatletter"                                               write$ newline$
  "\@ifundefined{ver@biblatex.sty}"                             write$ newline$
  "  {\@latex@error"                                            write$ newline$
  "     {Missing 'biblatex' package}"                           write$ newline$
  "     {The bibliography requires the 'biblatex' package.}"    write$ newline$
  "      \aftergroup\endinput}"                                 write$ newline$
  "  {}"                                                        write$ newline$
  "\endgroup"                                                   write$ newline$
  newline$
  "\datalist[entry]{none/global//global/global}"                write$
}

FUNCTION {output:main:preamble} {
  preamble$ empty$
    'skip$
    { newline$
      "\preamble{%" write$ newline$
      preamble$ write$ newline$
      "}" write$ newline$
    }
  if$
}

FUNCTION {output:main:end} {
  "\enddatalist" write$ newline$
  "\endinput"    write$ newline$
}

EXECUTE {output:main:begin}

EXECUTE {output:main:preamble}

ITERATE {call.type$}

EXECUTE {output:main:end}

% -------------------------------------------------------------------

Then you will need

\makeatletter
\def\blx@auxinit#1{%
  \blx@auxwrite\blx@aux
    {\def\do##1{,\blx@stripbib{##1}}}
    {\ifx\blx@aux\@mainaux
     \else
       \blx@msg@aux
     \fi
     \string\bibstyle{question-mod}\blx@nl%%%% <- insert the new name of question.bst here
     \string\bibdata{%
       \blx@ctrlfile\blxauxsuffix
       \ifx#1\@empty
       \else
         \dolistloop#1%
       \fi}\blx@nl
     \string\citation{biblatex-control}}}
\makeatother

either in your document preamble or directly in a renamed copy of problems.sty (problems-mod.sty) instead of \def\blx@auxinit@bibtex#1. Then you load the package with \usepackage{problems-mod}. Add the current date as well as your name to the comments in the beginning of each of the modified files and change their identifiers accordingly.


You should also try to contact the developer/maintainer of the package, but I'm not sure if he is still working on it.

  • That fixed things. It also turns out that I need to explicitly load keyval before problems (which graphicx does for you). – Teepeemm May 2 '18 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.