mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
support biblatex, remove bibtex+multibib code parts, more lively .bib example
This commit is contained in:
parent
d7e0e4966e
commit
467aebd33f
9 changed files with 46 additions and 208 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -2,6 +2,8 @@
|
|||
*.aux
|
||||
*.bbl
|
||||
*.blg
|
||||
*.bcf
|
||||
*.run.xml
|
||||
*.fdb_latexmk
|
||||
*.fls
|
||||
*.log
|
||||
|
|
|
|||
18
moderncv.cls
18
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}}
|
||||
|
||||
|
||||
%-------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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'.
|
||||
|
|
|
|||
37
template.tex
37
template.tex
|
|
@ -111,16 +111,12 @@
|
|||
\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}
|
||||
% \addbibresource{publications.bib}
|
||||
|
||||
% bibliography with multiple entries
|
||||
%\usepackage{multibib}
|
||||
%\newcites{book,misc}{{Books},{Others}}
|
||||
%----------------------------------------------------------------------------------
|
||||
% content
|
||||
%----------------------------------------------------------------------------------
|
||||
|
|
@ -238,8 +234,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 +245,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 ---------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue