1

I wrote my own beamer-class-template, which uses the boolexpr-package. But when combining it with the biblatex-package, it results in a 6 MByte-logfile, and a lot of errors. The first are

(c:/texlive/2016/texmf-dist/tex/latex/biblatex/blx-dm.def
! Undefined control sequence.
\do ...lx@dm@datatype }{#1}}\par \par \ifboolexpr 
                                                  {test {\ifcsstring {blx@dm...
l.447   volumes}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.447   volumes}

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Argument of \@secondoftwo has an extra }.
<inserted text> 
                \par 
l.447   volumes}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
! Paragraph ended before \@secondoftwo was complete.
<to be read again> 
                   \par 
l.447   volumes}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

My files are

\documentclass[screen, aspectratio=43]{beamer}
\usetheme{test}
\usepackage{biblatex}
\begin{document}
    Hello
\end{document}

as main-file and

\ProvidesClass{beamerthemetest}

\mode
<presentation>
% Set some style dependent values
\usepackage{boolexpr}
\ifcsname ifboolexpr\endcsname
\makeatletter
\let\ifboolexpr\@undefined
\makeatother
\fi


\mode
<all>

as style-file. How can I use the biblatex-package in my main file, while still retaining the boolexpr-package in my theme file?

If I remove the undef-part (i.e. \if...\fi, I get the following errors (first part):

(c:/texlive/2016/texmf-dist/tex/latex/biblatex/blx-dm.def
! Missing number, treated as zero.
<to be read again> 
                   \protect 
l.447   volumes}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing = inserted for \ifnum.
<to be read again> 
                   \begingroup 
l.447   volumes}

I was expecting to see `<', `=', or `>'. Didn't.

! Missing number, treated as zero.
<to be read again> 
                   \begingroup 
l.447   volumes}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

! Missing \endcsname inserted.
<to be read again> 
                   \begingroup 
l.447   volumes}

The control sequence marked <to be read again> should
not appear between \csname and \endcsname.


! LaTeX Error: Unknown relation found while scanning \boolexpr !.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.447   volumes}

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

My application for the package boolexpr is

\long\def\isequal#1#2{\pdf@strcmp{#1}{#2}}
\switch
\case{\isequal{\beamer@ntnu@style}{vertical}}
   \setbeamercolor{footline}{fg=white}
   \def\footlinealign{left}
   \def\titlex{50pt}
   \def\titley{70pt}
   \def\pgnumoffset{7pt}
   \setbeamersize{text margin left=2cm,text margin right=1em}
\case{\isequal{\beamer@ntnu@style}{horizontal}}
   \setbeamercolor{footline}{fg=white}
   \def\footlinealign{left}
   \def\titlex{30pt}
   \def\titley{70pt}
   \def\pgnumoffset{0pt}
   \setbeamersize{text margin left=1cm,text margin right=1em}
\otherwise
   \setbeamercolor{footline}{fg=black}
   \def\footlinealign{right}
   \def\titlex{16pt}
   \def\titley{110pt}
   \def\pgnumoffset{0pt}
   \setbeamersize{text margin left=1cm,text margin right=1em}
\endswitch
8
  • Well, if you undefine \ifboolexpr, how can you use it?
    – egreg
    May 2 '17 at 12:01
  • Unrelated to the problem, but in your theme file, you don't need \ProvidesClass{beamerthemetest} nore \makeatletter ... \makeatother May 2 '17 at 12:01
  • @egreg: I added an additional part to my question about the problems when removing that part.
    – arc_lupus
    May 2 '17 at 12:04
  • @egreg: Both boolexpr and biblatex are using that command, but with different meanings.
    – arc_lupus
    May 2 '17 at 12:06
  • 3
    @arc_lupus While etextools and its sibling boolexpr were born as extensions to etoolbox, they've actually become incompatible with biblatex, which wants to use the macros in etoolbox and is confused by the etextools extensions.
    – egreg
    May 2 '17 at 12:08
2

Based on the usual beamer way to treat theme options, the following could be a workaround without the boolexpr package:

\documentclass[screen, aspectratio=43]{beamer}

\setbeamertemplate{footline}{
    \begin{beamercolorbox}{footline}
        sdjk
    \end{beamercolorbox}
}

\usetheme[style=vertical]{ntnu}


\usepackage{biblatex}
\begin{document}
    Hello
\end{document}

\mode<presentation>

\DeclareOptionBeamer{style}{\def\beamer@ntnu@style{#1}}
\ExecuteOptionsBeamer{style=vertical}
\ProcessOptionsBeamer

\def\beamer@ntnu@verticaltext{vertical}%
\def\beamer@ntnu@horizontaltext{horizontal}%

\ifx\beamer@ntnu@style\beamer@ntnu@verticaltext%
   \setbeamercolor{footline}{fg=blue}
   \def\footlinealign{left}
   \def\titlex{50pt}
   \def\titley{70pt}
   \def\pgnumoffset{7pt}
   \setbeamersize{text margin left=2cm,text margin right=1em}
\else%
\ifx\beamer@ntnu@style\beamer@ntnu@horizontaltext%
   \setbeamercolor{footline}{fg=red}
   \def\footlinealign{left}
   \def\titlex{30pt}
   \def\titley{70pt}
   \def\pgnumoffset{0pt}
   \setbeamersize{text margin left=1cm,text margin right=1em}
\else%
   \setbeamercolor{footline}{fg=green}
   \def\footlinealign{right}
   \def\titlex{16pt}
   \def\titley{110pt}
   \def\pgnumoffset{0pt}
   \setbeamersize{text margin left=1cm,text margin right=1em}
\fi
\fi%

\mode
<all>

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.