[Tex/LaTex] undefined control sequence. \bstctlcite

bibliographiesieeetranundefined

I just want to change how the URL is displayed in IEEEtran style. Therefore I added the following to my bibliography file Literaturverzeichnis.bib:

@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
    CTLuse_forced_etal       = "yes",
    CTLmax_names_forced_etal = "3",
    CTLnames_show_etal       = "2",
    CTLname_url_prefix = "\par [Online]. Available:"

and in the document I use:

\bstctlcite{IEEEexample:BSTcontrol}
\bibliography{IEEEabrv,Literaturverzeichnis}
\bibliographystyle{IEEEtran}

I always get the error Undefined control sequence. \bstctlcite.


Here is a small example just with the packages, some text, a citation and the bibliography:

\documentclass[12pt, a4paper, english, ngerman, numbers=noenddot, openany, titlepage, intoc, BCOR=10mm, headsepline]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{blindtext}
\usepackage{url}
\usepackage{hyperref}

\begin{document}    
    \blindtext
    \cite{Braggins:Fingerprint_sensing_and_analysis}
    \bstctlcite{IEEEexample:BSTcontrol}
    \bibliography{IEEEabrv,Literaturverzeichnis}\thispagestyle{empty}
    \bibliographystyle{IEEEtran}
\end{document}

And here is the .bib-file:

@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
    CTLuse_forced_etal       = "yes",
    CTLmax_names_forced_etal = "3",
    CTLnames_show_etal       = "2",
    CTLname_url_prefix = "\par[Online]. Available:"
}

@article{Braggins:Fingerprint_sensing_and_analysis,
    author = {Braggins, Don},
    journal = {Sensor Review},
    month = {December},
    number = {4},
    pages = {272--277},
    title = {{Fingerprint sensing and analysis}},
    url = {http://www.emeraldinsight.com/doi/10.1108/02602280110406909 https://www.emeraldinsight.com/doi/10.1108/02602280110406909},
    volume = {21},
    year = {2001}
}

Here is the message I get:

Error Message

Best Answer

The command \bstctlcite is provided by the ieeetran document class (ieeetran.cls) or by the support package ieeetrantools. You load neither of those, so the command is not available to you.

You can load ieeetrantools with \usepackage{ieeetrantools}, or you take the definition of \bstctlcite from ieeetran.bst directly

\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
  \@for\@citeb:=#2\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
  \@esphack}
\makeatother 

Additionally, \bstctlcite{IEEEexample:BSTcontrol} must be the first citation in your document, so I suggest you call it directly after the \begin{document}.

Your document would then look like (the whole filecontents block is just to make the example self-contained, it is not needed in your actual document)

\documentclass[12pt, a4paper,numbers=noenddot, openany, titlepage, BCOR=10mm, headsepline]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{hyperref}

\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
  \@for\@citeb:=#2\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
  \@esphack}
\makeatother

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
    CTLuse_forced_etal       = "yes",
    CTLmax_names_forced_etal = "3",
    CTLnames_show_etal       = "2",
    CTLname_url_prefix = "\par[Online]. Available:"
}

@article{Braggins:Fingerprint_sensing_and_analysis,
    author = {Braggins, Don},
    journal = {Sensor Review},
    month = {December},
    number = {4},
    pages = {272--277},
    title = {Fingerprint sensing and analysis},
    url = {http://www.emeraldinsight.com/doi/10.1108/02602280110406909},
    volume = {21},
    year = {2001}
}
\end{filecontents}

\begin{document}
    \bstctlcite{IEEEexample:BSTcontrol}
    \blindtext
    \cite{Braggins:Fingerprint_sensing_and_analysis}
    \bibliography{IEEEabrv,\jobname}
    \bibliographystyle{IEEEtran}
\end{document}

gives

enter image description here

Note that the ULRs were messed up because you can only have one URL in the url field. Two URLs are too much.

Related Question