I've seen Use BibTeX key as the cite key, and it's quite close to what I'm looking for, but doesn't quite make it - for a start I can't get biblatex to run over my document, and second
What I'm trying to achieve is for the reference list to display, instead of reference numbers (or author-year pairs, but I'm using the super
natbib style) the key, as in \cite(key)
.
This is partly a debugging issue, hence the tag, but partly as I'm required to port some existing work to word. I have no influence over that requirement, and I've written something to parse the .tex (excluding equations), leaving me with the cite keys inline - hence I'd like get a references section I can copy into the word document for shared editing.
Edit - more detail on biblatex The error I see is:
! LaTeX Error: Command \bibhang already defined.
Or name \end... illegal, see p.192 of the manual.
If I comment out \usepackage{natbib}
in an attempt to fix that, I break some custom cite commands I added. Replacing those with a simple \cite
allows it to compile.
The top answer linked above doesn't help much, new keys are generated, which is why I didn't put too much effort into getting it to run before.
Edit2: The following compiles, but generates new keys.
\documentclass[preview]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{preview}
\usepackage[backend=bibtex,style=alphabetic,sorting=debug]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Jones_article1,
author = {A. . Jones and C. D. Smith},
title = {article1},
}
@article{Bloggs_article2,
author = {E. F. Bloggs},
title = {article title 2}
journal = {Journal of stuff},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
foo\cite{Jones_article1} and bar\cite{Bloggs_article2}
\printbibliography
\end{document}
Edit3: This doesn't run:
\documentclass[preview]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{preview}
\usepackage[backend=bibtex,natbib=true,style=alphabetic,sorting=debug]{biblatex}
\usepackage{filecontents}
\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}\DeclareFieldFormat{extraal??pha}{}
\begin{filecontents}{\jobname.bib}
@article{Jones_article1,
author = {A. . Jones and C. D. Smith},
title = {article1},
}
@article{Bloggs_article2,
author = {E. F. Bloggs},
title = {article title 2}
journal = {Journal of stuff},
}
\end{filecontents}
\addbibresource{\jobname.bib}
%citenumns provides the reference number for a citation, not superscripted or bracketed
\makeatletter
\newcommand*{\citenumns}[2][]{%
\begingroup
\let\NAT@mbox=\mbox
\let\@cite\NAT@citenum
\let\NAT@space\NAT@spacechar
\let\NAT@super@kern\relax
\renewcommand\NAT@open{}%
\renewcommand\NAT@close{}%
\cite[#1]{#2}%
\endgroup
}
\makeatother
\begin{document}
foo\cite{Jones_article1} and bar ref. \citenumns{Bloggs_article2}
%\bibliographystyle(super)
\printbibliography
\end{document}
instead giving
! LaTeX Error: \NAT@open undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.40 ...} and bar ref. \citenumns{Bloggs_article2}
biblatex
andnatbib
:biblatex
is incompatible with virtually all other bibliograpphy-related packages (but it incorporates their functionality and then some). An minimal example (or here) would still be helpful at this point.\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}\DeclareFieldFormat{extraalpha}{}
from this answer.