diff --git a/.gitignore b/.gitignore index 2e83ea9..a0b16a4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ *.aux *.bbl *.blg +*.bcf +*.run.xml *.fdb_latexmk *.fls *.log diff --git a/CHANGELOG b/CHANGELOG index b834048..95d0f36 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ version next - Include social icons in cover letter for styles classic, fancy and banking (#170) - Update Oldstyle to use symbols instead of marvosym (#209) - Fix spacing between first and last name again (#220) +- Support BibLaTeX and drop BibTeX (#227) version 2.4.1 (18 Jul 2024) - Fix commons/colors.tex not found in package (#194) diff --git a/KNOWN_BUGS b/KNOWN_BUGS index 25ef872..97c693b 100644 --- a/KNOWN_BUGS +++ b/KNOWN_BUGS @@ -1,11 +1,8 @@ -- moderncv is incompatible with biber. -- moderncv is incompatible with BibLaTeX. - moderncv is incompatible with babel in Spanish. - Skill matrices don't break automatically in fancy style. - Long names break the oldstyle style and possibly other styles (needs testing). - Long URLs in classic style can make the name break line. Fixed width for the address part must be implemented. -- When using the fancy style, undesired space is added between the bibliography head and the first entry, as well as after the last entry. - Footnotes generate errors, but the output seems correct when running with "-interaction=nonstopmode" - When using CJK, the last \clearpage required for the fancyhdr package to work properly kills the "lastpage" counter, and therefore also the page numbering. - moderncv produces an error "lonely \item--perhaps a missing list environment" when used with the bibentry package, though the output is actually correct. Among other things, this causes compilation by LyX to stop. diff --git a/manual/moderncv_userguide.pdf b/manual/moderncv_userguide.pdf index 0468a22..f1f1986 100644 Binary files a/manual/moderncv_userguide.pdf and b/manual/moderncv_userguide.pdf differ diff --git a/manual/moderncv_userguide.tex b/manual/moderncv_userguide.tex index feb6f31..0986d44 100644 --- a/manual/moderncv_userguide.tex +++ b/manual/moderncv_userguide.tex @@ -98,11 +98,11 @@ cvitem, cventry, cvdoubleentry, cvdoubleitem, cvtripleitem, cvlistitem, cvlistdoubleitem, cvcolumns, moderncvstyle, moderncvcolor, cvskill, cvskilllegend, cvskillplainlegend, cvskillhead, cvskillentry, nopagenumbers, name, born, address, email, link, social, phone, homepage, extrainfo, photo, quote, section, subsection, setlength, NewDocumentCommand, definecolor, colorlet, cvitemwithcomment, - recipient, subject, opening, closing, signature, enclosure + recipient, subject, opening, closing, signature, enclosure, biblatex, printbibliography, addbibresource }, emphstyle={\color{cvblue}}, emph={[2] - familydefault, sfdefault, rmdefault, inputenc, moderncv, document, bibliographyitemlabel, + familydefault, sfdefault, rmdefault, inputenc, moderncv, document, addresssymbol, mobilephonesymbol, fixedphonesymbol, faxphonesymbol, emailsymbol, homepagesymbol, linkedinsocialsymbol, xingsocialsymbol, twittersocialsymbol, githubsocialsymbol, gitlabsocialsymbol, stackoverflowsocialsymbol, bitbucketsocialsymbol, skypesocialsymbol, orcidsocialsymbol, researchgatesocialsymbol, arxivsocialsymbol, inspiresocialsymbol, @@ -397,23 +397,34 @@ For instance, pictures can be included with \code{\\includegraphics}: Adding \code{\\hspace} in units of basic \code{moderncv} lengths will fit them more naturally into the CV or resume. \paragraph{Bibliography.} -In case BibTeX is used, the bibliography settings are adjusted in the lines +In favor of BibLaTeX support for BibTeX is dropped.\newline +Including a bibliography database \texttt{publications.bib} is achieved with the following lines in the preamble: \begin{lstlisting} - % to show numerical labels in the bibliography (default is to show no labels) - % \renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]} - % \renewcommand{\refname}{Articles} - - % bibliography with mutiple entries - % \usepackage{multibib} - % \newcites{book, misc}{{Books}, {Others}} + \usepackage[backend=biber]{biblatex} + % bibliography adjustments (only useful if you make citations in your resume, or print a list of publications using BibLaTeX) + \usepackage[backend=biber]{biblatex} + % in order to sort after citation occurrence use the following instead: + \usepackage[backend=biber, sorting=none]{biblatex} + % or use non-numeric citation as alternative: + \usepackage[backend=biber, bibstyle=alphabetic, citestyle=alphabetic]{biblatex} + % add the .bib file as ressource + \addbibresource{publications.bib} \end{lstlisting} -By default, no labels are shown for bibliography entries. -Uncommenting the line \code{\%\\renewcommand*\{\\bibliographyitemlabel\}\{[\\arabic\{enumiv\}]\}} -allows one to fine-tune the labels. -Uncommenting the line \code{\%\\renewcommand\{\\refname\}\{Articles\}} allows one to redefine the bibliography heading string ``Publications'' that is shown by default. -Finally, adjustments using the \code{multibib} package can be done in the last two lines shown here. +Uncommenting the line \code{\\usepackage[backend=biber, sorting=none]\{biblatex\}} +allows sorting the citations after their occurrence. +Throughout the CV now the \code{\\cite} command can be used to cite references from the \texttt{publications.bib}. -\note \Biblatex is currently not supported. +A list of the cited references can be created with: +\begin{lstlisting} + % Publications from a BibLaTeX file + \printbibliography[title=Publications] + % in case all references should be printed without a \cite uncomment the following line: + \nocite{*} +\end{lstlisting} +In case the whole reference list should be printed regardless of a citation the option \code{\\nocite\{*\}} can be used.\newline +For a different bibliography heading string, change the \texttt{title} option. ``Publications'' is used as the default bibliography title. + +For further reference please see the \texttt{biblatex} documentation on CTAN: \url{https://ctan.org/pkg/biblatex} \subsection{Modifying CV content} \subsubsection{Structuring the CV} @@ -1047,8 +1058,6 @@ Most of these packages should be included in your \Latex distribution of choice. \subsection{Known conflicts with other packages} \begin{enumerate} - \item \Moderncv is incompatible with \code{biber}. - \item \Moderncv is incompatible with \biblatex. \item \Moderncv is incompatible with \code{babel} in Spanish \end{enumerate} @@ -1058,7 +1067,6 @@ Most of these packages should be included in your \Latex distribution of choice. \item Long names break the \texttt{oldstyle} style and possibly other styles (needs testing). \item Long URLs in \texttt{classic} style can make the name break line. Fixed width for the address part must be implemented. - \item When using the \texttt{fancy} style, undesired space is added between the bibliography head and the first entry, as well as after the last entry. \item Footnotes generate errors, but the output seems correct when running with \code{-interaction=nonstopmode}. \item When using CJK, the last \code{\\clearpage} required for the \code{fancyhdr} package to work properly kills the ``lastpage'' counter, and therefore also the page numbering. \item \Moderncv produces the error ``\code{lonely \\item--perhaps a missing list environment}'' when used with the \code{bibentry} package, though the output is actually correct. diff --git a/moderncv.cls b/moderncv.cls index 20cedc8..633b899 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -737,24 +737,6 @@ % enclose the contents of the cell inside a vertical box, to allow paragraph commands \protect\vtop{#1}}} -% thebibliography environment, for use with BibTeX and possibly multibib -\newlength{\bibindent} -\setlength{\bibindent}{1.5em} -% bibliography item label -\newcommand*{\bibliographyitemlabel}{}% use \@biblabel{\arabic{enumiv}} for BibTeX labels -%\newif\if@multibibfirstbib\@multibibfirstbibfalse -% bibliography head (section, etc}, depending on whether multibib is used -\newcommand*{\bibliographyhead}[1]{\section{#1}} -\AtEndPreamble{\@ifpackageloaded{multibib}{\renewcommand*{\bibliographyhead}[1]{\subsection{#1}}}{}} -% thebibliography environment definition -\newenvironment{thebibliography}[1]{}{} -\newcommand*{\newblock}{\hskip .11em\@plus.33em\@minus.07em} -\let\@openbib@code\@empty -%% fix a bug (hardcoded bib label) in \@bibitem -%\renewcommand\@bibitem[1]{% -% \item\if@filesw \immediate\write\@auxout -% {\string\bibcite{#1}{\theenumiv}}\fi\ignorespaces}% replaced "\the\value{\@listctr}" with "\theenumiv" - % itemize, enumerate and description environment \setlength{\leftmargini} {1em} \leftmargin\leftmargini diff --git a/moderncvbodyi.sty b/moderncvbodyi.sty index d3db954..8ac9967 100644 --- a/moderncvbodyi.sty +++ b/moderncvbodyi.sty @@ -147,30 +147,6 @@ \hfill% fill of \separatorcolumnwidth \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}}} -\renewenvironment{thebibliography}[1]% - {% - \bibliographyhead{\refname}% -% \small% - \begin{list}{\bibliographyitemlabel}% - {% - \setlength{\topsep}{0pt}% - \setlength{\labelwidth}{\hintscolumnwidth}% - \setlength{\labelsep}{\separatorcolumnwidth}% - \leftmargin\labelwidth% - \advance\leftmargin\labelsep% - \@openbib@code% - \usecounter{enumiv}% - \let\p@enumiv\@empty% - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy% - \clubpenalty4000%\@clubpenalty \clubpenalty% - \widowpenalty4000% - \sfcode`\.\@m% - \sfcode `\=1000\relax}% - {% - \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}% - \end{list}} - %------------------------------------------------------------------------------- % letter style definition diff --git a/moderncvbodyiii.sty b/moderncvbodyiii.sty index 37d8d13..0d5515e 100644 --- a/moderncvbodyiii.sty +++ b/moderncvbodyiii.sty @@ -209,32 +209,6 @@ \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}% \par\addvspace{#1}} -\renewenvironment{thebibliography}[1]% - {% - \bibliographyhead{\refname}% -% \small% - \begin{list}{\bibliographyitemlabel}% - {% - \setlength{\topsep}{0pt}% - \setlength{\labelwidth}{0pt}% - \ifthenelse{\equal{\bibliographyitemlabel}{}}% - {\setlength{\labelsep}{0pt}}% - {\setlength{\labelsep}{\separatorcolumnwidth}}% - \leftmargin\labelwidth% - \advance\leftmargin\labelsep% - \@openbib@code% - \usecounter{enumiv}% - \let\p@enumiv\@empty% - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy% - \clubpenalty4000%\@clubpenalty \clubpenalty% - \widowpenalty4000% - \sfcode`\.\@m% - \sfcode `\=1000\relax}% - {% - \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}% - \end{list}} - %------------------------------------------------------------------------------- % letter style definition diff --git a/moderncvbodyiv.sty b/moderncvbodyiv.sty index 0d9fe6f..30ad62f 100644 --- a/moderncvbodyiv.sty +++ b/moderncvbodyiv.sty @@ -151,30 +151,6 @@ \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}% \par\addvspace{#1}} -\renewenvironment{thebibliography}[1]% - {% - \bibliographyhead{\refname}% -% \small% - \begin{list}{\bibliographyitemlabel}% - {% - \setlength{\topsep}{0pt}% - \setlength{\labelwidth}{\hintscolumnwidth}% - \setlength{\labelsep}{\separatorcolumnwidth}% - \leftmargin\labelwidth% - \advance\leftmargin\labelsep% - \@openbib@code% - \usecounter{enumiv}% - \let\p@enumiv\@empty% - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy% - \clubpenalty4000%\@clubpenalty \clubpenalty% - \widowpenalty4000% - \sfcode`\.\@m% - \sfcode `\=1000\relax}% - {% - \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}% - \end{list}} - %------------------------------------------------------------------------------- % letter style definition diff --git a/moderncvbodyv.sty b/moderncvbodyv.sty index f29e577..cdbe951 100644 --- a/moderncvbodyv.sty +++ b/moderncvbodyv.sty @@ -176,42 +176,6 @@ \hfill% fill of \separatorcolumnwidth \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}}} -\renewenvironment{thebibliography}[1]% BUG/TODO: remove extra space between heading and first bibliography entry, as well as after last one - {% - \bibliographyhead{\refname}% -% \small% - \arrayrulecolor{bodyrulecolor}% - \setlength\arrayrulewidth{\separatorrulewidth}% - \noindent% - \begin{tabular}[t]{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}|@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}% - \@moderncvstrut{4pt}{16pt} &% - \begin{list}{\bibliographyitemlabel}{% - \setlength{\topsep}{0pt}% - \setlength{\partopsep}{0pt}% - \setlength{\labelwidth}{0pt}% - \setlength{\itemsep}{0pt}% - \setlength{\parskip}{0pt}% - \ifthenelse{\equal{\bibliographyitemlabel}{}}% - {\setlength{\labelsep}{0pt}}% - {\setlength{\labelsep}{\separatorcolumnwidth}}% - \leftmargin\labelwidth% - \advance\leftmargin\labelsep% - \@openbib@code% - \usecounter{enumiv}% - \let\p@enumiv\@empty% - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy% - \clubpenalty4000%\@clubpenalty \clubpenalty% - \widowpenalty4000% - \sfcode`\.\@m% - \sfcode `\=1000\relax}% - {% - \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}% - \end{list}% - \\[.5ex]% - \end{tabular}% - \par\@aftersectionfalse\ignorespaces} - %------------------------------------------------------------------------------- % letter style definition diff --git a/moderncvbodyvi.sty b/moderncvbodyvi.sty index 76e1a15..10131bd 100644 --- a/moderncvbodyvi.sty +++ b/moderncvbodyvi.sty @@ -153,29 +153,6 @@ \hfill% fill of \separatorcolumnwidth \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}}} -\renewenvironment{thebibliography}[1]% - {% - \bibliographyhead{\refname}% -% \small% - \begin{list}{\bibliographyitemlabel}% - {% - \setlength{\topsep}{0pt}% - \setlength{\labelwidth}{\hintscolumnwidth}% - \setlength{\labelsep}{\separatorcolumnwidth}% - \leftmargin\labelwidth% - \advance\leftmargin\labelsep% - \@openbib@code% - \usecounter{enumiv}% - \let\p@enumiv\@empty% - \renewcommand\theenumiv{\@arabic\c@enumiv}}% - \sloppy% - \clubpenalty4000%\@clubpenalty \clubpenalty% - \widowpenalty4000% - \sfcode`\.\@m% - \sfcode `\=1000\relax}% - {% - \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}% - \end{list}} %------------------------------------------------------------------------------- diff --git a/publications.bib b/publications.bib index 2b97096..3bb51c9 100644 --- a/publications.bib +++ b/publications.bib @@ -1,44 +1,46 @@ %% start of file `publications.bib'. -%% Copyright 2006-2012 Xavier Danaux (xdanaux at gmail.com). +%% Copyright 2006-2012 Xavier Danaux (xdanaux at gmail.com), 2020-2025 moderncv maintainers (github.com/moderncv). % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License version 1.3c, % available at http://www.latex-project.org/lppl/. - - -@BOOK{book1, - author = {John Doe and Author 1}, - title = {Title}, - publisher = {Publisher}, - edition = {edition}, - year = {year}, +@article{einstein, + author = "Albert Einstein", + title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) + [{On} the electrodynamics of moving bodies]", + journal = "Annalen der Physik", + volume = "322", + number = "10", + pages = "891--921", + year = "1905", + DOI = "http://dx.doi.org/10.1002/andp.19053221004", + keywords = "physics" } -@BOOK{book2, - author = {John Doe and Author 2}, - title = {Title}, - publisher = {Publisher}, - edition = {edition}, - year = {year}, +@book{dirac, + title={The Principles of Quantum Mechanics}, + author={Paul Adrien Maurice Dirac}, + isbn={9780198520115}, + series={International series of monographs on physics}, + year={1981}, + publisher={Clarendon Press}, + keywords = {physics} } -@MISC{misc1, - author = {John Doe}, - title = {Title}, - year = {year}, +@online{knuthwebsite, + author = "Donald Knuth", + title = "Knuth: Computers and Typesetting", + url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html", + keywords = "latex,knuth" } -@MISC{misc2, - author = {John Doe and Author 3}, - title = {Title}, - year = {year}, +@inbook{knuth-fa, + author = "Donald E. Knuth", + title = "Fundamental Algorithms", + publisher = "Addison-Wesley", + year = "1973", + chapter = "1.2", + keywords = "knuth,programming" } -@MISC{misc3, - author = {John Doe}, - title = {Title}, - year = {year}, -} - - %% end of file `publications.bib'. diff --git a/template.tex b/template.tex index 5971baa..b7c82b7 100644 --- a/template.tex +++ b/template.tex @@ -111,16 +111,15 @@ \photo[64pt][2pt]{picture} % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 2pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file \quote{Some quote} % optional, remove / comment the line if not wanted -% bibliography adjustments (only useful if you make citations in your resume, or print a list of publications using BibTeX) -% to show numerical labels in the bibliography (default is to show no labels) -%\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother -\renewcommand*{\bibliographyitemlabel}{[\arabic{enumiv}]} -% to redefine the bibliography heading string ("Publications") -%\renewcommand{\refname}{Articles} +% bibliography adjustments (only useful if you make citations in your resume, or print a list of publications using BibLaTeX) +% \usepackage[backend=biber]{biblatex} +% in order to sort after citation occurrence use the following instead: +% \usepackage[backend=biber, sorting=none]{biblatex} +% short example with non-numeric citations +% \usepackage[backend=biber, bibstyle=alphabetic, citestyle=alphabetic]{biblatex} +% add the .bib file as ressource +% \addbibresource{publications.bib} -% bibliography with multiple entries -%\usepackage{multibib} -%\newcites{book,misc}{{Books},{Others}} %---------------------------------------------------------------------------------- % content %---------------------------------------------------------------------------------- @@ -238,8 +237,8 @@ Detailed achievements: \cvlistitem{Item 3. This item is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?} \section{Extra 2} -\cvlistdoubleitem{Item 1}{Item 4} -\cvlistdoubleitem{Item 2}{Item 5\cite{book2}} +\cvlistdoubleitem{Item 1}{Item 4\cite{einstein}} +\cvlistdoubleitem{Item 2}{Item 5\cite{dirac}} \cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.} \section{References} @@ -249,21 +248,10 @@ Detailed achievements: \cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).} \end{cvcolumns} -% Publications from a BibTeX file without multibib -% for numerical labels: \renewcommand{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% CONSIDER MERGING WITH PREAMBLE PART -% to redefine the heading string ("Publications"): \renewcommand{\refname}{Articles} -\nocite{*} -\bibliographystyle{plain} -\bibliography{publications} % 'publications' is the name of a BibTeX file - -% Publications from a BibTeX file using the multibib package -%\section{Publications} -%\nocitebook{book1,book2} -%\bibliographystylebook{plain} -%\bibliographybook{publications} % 'publications' is the name of a BibTeX file -%\nocitemisc{misc1,misc2,misc3} -%\bibliographystylemisc{plain} -%\bibliographymisc{publications} % 'publications' is the name of a BibTeX file +% Publications from a BibLaTeX file +% \printbibliography[title=Publications] +% in case all references should be printed without a \cite uncomment the following line: +% nocite{*} \clearpage %----- letter ---------------------------------------------------------