Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of Publications using BibTeX source #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
*.out
*.toc

## BibLaTeX auxiliary files:
*.bbl
*.bcf
*.blg

## Intermediate documents:
*.dvi
*-converted-to.*
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ $ docker run --rm --user $(id -u):$(id -g) -i -w "/doc" -v "$PWD":/doc thomaswei

In either case, this should result in the creation of ``{your-cv}.pdf``

##### List of Publications

You can generate list of publication from [**BibTeX**](http://www.bibtex.org/) source files.
[**BibLaTeX**](https://www.ctan.org/pkg/biblatex) and [**biber**](https://www.ctan.org/pkg/biber) should be available.

To include your publications, add the entries to [`examples/cv/references.bib`](examples/cv/references.bib),
and cite them in [`examples/cv/publications.tex`](examples/cv/publications.tex).
Update the sections in [`examples/cv.tex`](examples/cv.tex) to include the publications.

To generate document with the list of publications, at a command prompt, run

```bash
$ xelatex {your-cv}.tex
$ biber {your-cv}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a small question about biber: what is the motivation to use biber instead of bibtex?
When I test this commit today (20230729), I found that the (latest after executing tlmgr update --self --all) texlive 2023 installed biber package but there is no biber binary, for which I had some troubles with this awesome feature.
Is it possible to use bibtex instead of biber cause the former is a common choice to handle bibliography?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjiang95 I think you can fairly easily replace the commands with bibtex locally if you are comfortable working with LaTeX. See package settings here.

backend=bibtex

biber generally has better features, you can try reading more here and here in case you are curious.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your kind explanation. You've done an awesome job.

$ xelatex {your-cv}.tex
aminmkhan marked this conversation as resolved.
Show resolved Hide resolved
```


## Credit

Expand Down
149 changes: 149 additions & 0 deletions awesome-cv.cls
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,152 @@
\letterenclosurestyle{\@letterenclname: \@letterenclosure} \\
}
}

%-------------------------------------------------------------------------------
% Bibliography
%-------------------------------------------------------------------------------
%\RequirePackage[style=verbose, maxnames=99, sorting=ydnt]{biblatex}
\RequirePackage[ % BibLaTeX
sorting=ydnt, % Sorts entries by year (descending order), name, title
style=verbose,
doi=false,
isbn=true,
url=false,
eprint=false,
backref = false, % include back references in bibliography
maxcitenames=3, % affects only the citations in the document body
maxbibnames=99, % affects only the bibliography, pass 99 to print all
hyperref=true,
block=none,
backend=biber % {Options: bibtex, biber}
]{biblatex}

% Avoid splitting entries across page break (only for 3 or fewer lines)
% Tip: http://tex.stackexchange.com/a/51261
\AtBeginEnvironment{thebibliography}{%
\clubpenalty10000
\@clubpenalty \clubpenalty
\widowpenalty10000
\interlinepenalty5000}

% Customized format, based on the Fancy CV template created by Adrien Friggeri
% See https://github.com/ashee/cv (MIT license)
\DeclareFieldFormat[article]{title}{#1\par}
\DeclareFieldFormat[inproceedings]{title}{#1\par}
\DeclareFieldFormat[misc]{title}{#1\par}
\DeclareFieldFormat[report]{title}{#1\par}
\DeclareFieldFormat[incollection]{title}{#1\par}

aminmkhan marked this conversation as resolved.
Show resolved Hide resolved
\DeclareBibliographyDriver{article}{%
\fontsize{9pt}{1em}\bodyfont%
\printfield{title}%
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\fontsize{8pt}{1em}\bodyfontlight\color{graytext}%
\usebibmacro{journal+issuetitle}%
\setunit{\space}%
\printfield{pages}%
\newunit%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printfield{year}%
\newunit%
}
\par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{inproceedings}{%
aminmkhan marked this conversation as resolved.
Show resolved Hide resolved
\fontsize{9pt}{1em}\bodyfont%
\printfield{title}%
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\fontsize{8pt}{1em}\bodyfontlight\color{graytext}%
\printfield{booktitle}%
\setunit{\addcomma\space}%
\printfield{year}%
\setunit{\addcomma\space}%
\printlist{location}%
\newunit%
}
\par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{incollection}{%
\fontsize{9pt}{1em}\bodyfont%
\printfield{title}%
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\fontsize{8pt}{1em}\bodyfontlight\color{graytext}%
\printfield{booktitle}%
\setunit{\addcomma\space}%
\printfield{year}%
\setunit{\addcomma\space}%
\printlist{location}%
\newunit%
aminmkhan marked this conversation as resolved.
Show resolved Hide resolved
}
\par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{misc}{%
\fontsize{9pt}{1em}\bodyfont%
\printfield{title}%
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\fontsize{8pt}{1em}\bodyfontlight\color{graytext}%
\printfield{booktitle}%
\setunit*{\addcomma\space}%
\printfield{note}%
\setunit*{\addcomma\space}%
\printfield{year}%
\setunit{\addcomma\space}%
\printlist{location}%
\newunit%
}
\par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{report}{%
\fontsize{9pt}{1em}\bodyfont%
\printfield{title}%
\newblock%
\printnames{author}%
\par%
\newblock%
{%
\fontsize{8pt}{1em}\bodyfontlight\color{graytext}%
\printfield{type}%
\setunit{\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{year}%
\newunit%
}
\par\vspace{0.3\baselineskip}
}

% New syntax for flexible backend (BibLaTeX > v3.3)
\DeclareNameFormat{author}{%
\fontsize{9pt}{1em}\bodyfont%
\renewcommand*{\multinamedelim}{\addcomma\addspace}%
\nameparts{#1}%
\ifthenelse{\value{listcount}=1}
{\ifblank{\namepartgiven}{}{\namepartgiven\space}%
\namepartfamily}%
{\ifblank{\namepartgiven}{}{\namepartgiven\space}%
\namepartfamily}%
\ifthenelse{\value{listcount}<\value{liststop}}
{\addcomma\space}
{}
}
7 changes: 7 additions & 0 deletions examples/cv.tex
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@

\quote{``Be the change that you want to see in the world."}

%-------------------------------------------------------------------------------
% BIBLIOGRAPHY
%-------------------------------------------------------------------------------
\addbibresource{biblatex-examples.bib}
\addbibresource{cv/references.bib}

%-------------------------------------------------------------------------------
\begin{document}
Expand Down Expand Up @@ -105,6 +110,8 @@
\input{cv/honors.tex}
\input{cv/presentation.tex}
\input{cv/writing.tex}
% For publications from bibtex, add to cv/references.bib and uncomment below
% \input{cv/publications.tex}
Comment on lines +113 to +114
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be good to have the example complete - so there's an example of rendered result, and an example of what references.bib should actually look like.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes @OJFord I wanted to update the example, but couldn't decide since it doesn't make much sense to update the main example included in preview

Also putting in fictitious bibliography entries to the awesome original creator's CV included in preview wouldn't look nice.

As an alternative, should we upload another example? e.g.

https://github.com/posquit0/Awesome-CV/blob/master/examples/resume-with-publications.pdf

\input{cv/committees.tex}


Expand Down
35 changes: 35 additions & 0 deletions examples/cv/publications.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
%-------------------------------------------------------------------------------
% SECTION TITLE
%-------------------------------------------------------------------------------
\cvsection{Publications}

%-------------------------------------------------------------------------------
% SUBSECTION TITLE
%-------------------------------------------------------------------------------
\cvsubsection{Journal Articles}

\begin{refsection}
\nocite{gillies}
\nocite{glashow}
\nocite{herrmann}

\printbibliography[
heading=none,
sorting=ydnt
]
\end{refsection}

%-------------------------------------------------------------------------------
% SUBSECTION TITLE
%-------------------------------------------------------------------------------
\cvsubsection{Conference Proceedings}

\begin{refsection}
\nocite{salam}
\nocite{moraux}

\printbibliography[
heading=none,
sorting=ydnt
]
\end{refsection}
3 changes: 3 additions & 0 deletions examples/cv/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
%-------------------------------------------------------------------------------
% REPLACE WITH YOUR PUBLICATIONS
%-------------------------------------------------------------------------------