Boolexpr e biblatex na apresentação do beamer

Boolexpr e biblatex na apresentação do beamer

Eu escrevi meu próprio modelo de classe beamer, que usa o boolexprpacote -package. Mas ao combiná-lo com o biblatex-package, resulta em um arquivo de log de 6 MByte e muitos erros. Os primeiros são

(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.

Meus arquivos são

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

como arquivo principal e

\ProvidesClass{beamerthemetest}

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


\mode
<all>

como arquivo de estilo. Como posso usar o biblatex-package no meu arquivo principal, mantendo o boolexpr-package no meu arquivo de tema?

Se eu remover a parte undef (ou seja \if...\fi, recebo os seguintes erros (primeira parte):

(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.

Minha aplicação para o pacote boolexpré

\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

Responder1

Com base na maneira usual do beamer de tratar as opções de tema, o seguinte pode ser uma solução alternativa sem o boolexprpacote:

\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>

informação relacionada