Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French and English options result in error: \bibsenglish already defined #5

Open
Kamik423 opened this issue Jan 19, 2022 · 7 comments

Comments

@Kamik423
Copy link

When compiling with

\documentclass{article}

\usepackage[english]{babel}
\usepackage{babelbib}

\begin{document}
test
\end{document}

We get a compilation error.

babelbib: Use citation-dependent languages in bibliography
babelbib: Set bibliography fall-back language to english
babelbib: english.bdf loaded because language english defined.
(/usr/local/texlive/2021/texmf-dist/tex/latex/babelbib/english.bdf

! LaTeX Error: Command \bibsenglish already defined.
               Or name \end... illegal, see p.192 of the manual.

french results in the same error. Interestingly ngerman works perfectly fine. I fixed this by replacing

\bbbbifpackageloaded{french}{}{\newcommand\bibsenglish{}}
\renewcommand\bibsenglish[1][english]{%

with

\newcommand\bibsenglish[1][english]{%

in english.bdf. This might be related to #2 or its fix.

@komascript
Copy link

Which version of babel and babelbib are you using? If do note get an error with your example code. If I add \listfiles to your example, I get the following file version list in my log file.

 *File List*
 article.cls    2021/10/04 v1.4n Standard LaTeX document class
  size10.clo    2021/10/04 v1.4n Standard LaTeX file (size option)
   babel.sty    2022/02/13 3.71 The Babel package
 english.ldf    2017/06/06 v3.3r English support from the babel system
babelbib.sty    2021/01/06 v1.34 babelbib: multilingual bibliographies
l3backend-pdftex.def    2022-02-07 L3 backend support: PDF output (pdfTeX)
 english.bdf    2021/01/06 v1.34 babelbib: multilingual bibliographies
 ***********

@norbusan
Copy link
Member

I also cannot reproduce this issue!

@Kamik423
Copy link
Author

I am now also unable to reproduce this. It also happened on a friend's machine however. I think it might have to do with some previous state from the aux files?

@komascript
Copy link

It also happened on a friend's machine however. I think it might have to do with some previous state from the aux files?

Here it does not happen independent on the number of LaTeX runs. So with the shown example it does not have to do with a previous state from the aux file.

I know only one case, to get this error: Setting option english more than once for babelbib:

\documentclass{article}

\usepackage[english]{babel}
\usepackage[english,english]{babelbib}% User mistake? IMHO: yes.
\begin{document}
test
\end{document}

Note: Setting english also as global option (\documentclass[…,english,…]{…}) doesn't matter, because babelbib uses \DeclareOption*{…} for the language options.

If the user mistake in my example should not result in an error, the code of babelbib should be changed, e.g.:

\DeclareOption*{%
  \InputIfFileExists{\CurrentOption.bdf}{%
    \@ifundefined{bbbb\CurrentOption loaded}{% ADDED
      \typeout{babelbib: \CurrentOption.bdf loaded due to explicit package
        option \CurrentOption}%
      \expandafter\def\csname bbbb\CurrentOption loaded\endcsname{\@empty}%
    }{% ADDED
      \typeout{babelbib: explicit  package option \CurrentOption\space ignored, because \CurrentOption.bdf already loaded}% ADDED
    }% ADDED
  }{%
    \PackageError{babelbib}{%
      Language definition file \CurrentOption.bdf not found}{%
      Maybe you misspelled the language option?}%
  }%
}

@norbusan
Copy link
Member

norbusan commented Feb 20, 2022

Hi @komascript
thanks a lot, I have added this change to the branch, and added you to the copyright statement. Hope that is fine with you.
db0642d

@komascript
Copy link

and added you to the copyright statement

No need for that.

BTW: Thank you for maintaining babelbib. I'm still using the package for long standing documents.

@norbusan
Copy link
Member

Ok, undone the change. Thanks to you for all the support here and patches, very much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants