Most probably you have \nocite{*}
somewhere in the body of your document; this command will cause all entries of the chosen bibliographical database to be included in the list of references.
Simply delete \nocite{*}
and re-compile your document (using, for example, pdflatex+bibtex+pdflatex+pdflatex
).
The \nocite
command can also be used with a key-list as its argument; in this case, it will write the bibliographical information associated to the key-list (even if the publication(s) is(are) otherwise not cited) into the list of references.
The first optional argument of the command \bibitem
is executing by the command \@biblabel
which have one mandatory argument.
My suggestion uses commands with @
and so you must handle them as describe in the question: What do \makeatletter and \makeatother do?
For the first choice you can gobble the mandatory argument by the following assignment:
\let\@biblabel\@gobble
For the second choice you can use a small trick. The justification of the bibliography label is done by \@biblabel{#1}\hfill
. To gobble the \hfill
to get your requested alignment you can use \hfill
as part of the definition of \@biblabel
\def\@biblabel#1\hfill{[#1]}
In the mwe below I have implemented both solutions:
\listfiles
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@BOOK{book1,
author = {John Doe and John Smith},
title = {Title},
publisher = {Publisher},
edition = {edition},
year = {year},
}
@BOOK{book2,
author = {John Doe and Eva Smith},
title = {Title2},
publisher = {Publisher2},
edition = {edition},
year = {year},
}
@MISC{misc1,
author = {John Doe},
title = {Title},
year = {year},
}
@MISC{misc2,
author = {John Doe and Max Musterfrau},
title = {Title},
year = {year},
}
\end{filecontents*}
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}
\usepackage[ngerman]{babel}
\bibliographystyle{unsrtdin}
% personal data
\firstname{John}
\familyname{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{john@doe.org}
\homepage{www.johndoe.com}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-a} % change image name
\quote{Some quote}
\begin{document}
\selectlanguage{ngerman} % German cv
\makecvtitle
% Publications from a BibTeX file without multibib
\renewcommand{\refname}{Veröffentlichungen} % instead "Publications"
\nocite{*} % cite all entrys in bib file
\makeatletter
\let\@biblabel\@gobble
\makeatother
\bibliography{\jobname} % bib file \jobname.bib
\makeatletter
\def\@biblabel#1\hfill{[#1]}
\makeatother
\bibliography{\jobname} % bib file \jobname.bib
\end{document}
Best Answer
If you are prepared to accept that
\bibitem
should be ended by a blank line, then you can modify some of the code fromsource2e
andrefcheck
to make this work. You have run latex three times to get the correct numbering in the text.The first part of the code is
refcheck
s modification to the\cite
command so that use of a bibitem is recorded. The second part is a modification of the core latex\bibitem
, so that it always records the label in the.aux
file, but only prints out the body if the item has been cited.If you need to use this with
hyperref
so there are links to the bibliography, then the coding has to be adapted tohyperref
's versions on\@lbibitem
and\@bibitem
, sincehyperref
simply overwrites the current definition. This is given as follows, notice the positioning of the loading of thehyperref
package: