Skip to content

Commit

Permalink
Add publication page generation (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfherbst authored Jun 19, 2024
1 parent b05f1b1 commit 0724665
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 4 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Bibliography = "f1be7e48-bf82-45af-a471-ae754a193061"
Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e"
NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Expand Down
68 changes: 68 additions & 0 deletions _data/publications.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
% Some mandatory keys (apart from the obvious):
% - `url`: Use to provide a link to accessing the paper in open-access form
% (e.g. arxiv, link to pdf on preprint server etc.).
% - `year` `month` and `day` are used for ordering the entries
% - `note`: Needs to be non-empty for unpublished items for reasons
% of technical limitations
% Optional keys:
% - `code`: Use to provide link to github repo or similar containing reproducer
% - `data`: Use to provide link where data required for the study is available
%
% Preprints
%
@unpublished{Nottoli2024ddx,
title = {DDX: Polarizable continuum solvation from small molecules to
proteins},
author = {Nottoli, Michele and Herbst, Michael F and Mikhalev, Aleksandr
and Jha, Abhinav and Lipparini, Filippo and Stamm, Benjamin},
url = {https://doi.org/10.26434/chemrxiv-2024-787rx-v2},
year = {2024},
month = {2},
day = {1},
note = {Unpublished},
}

%
% Peer-reviewed publications
%
@article{Fisher2024multitask,
title = {Multitask methods for predicting molecular properties from heterogeneous data},
author = {Fisher, Katharine Fisher and Herbst, Michael F and Marzouk, Youssef},
url = {http://arxiv.org/abs/2401.17898},
year = {2024},
journal = {Journal of Chemical Physics},
month = {7},
day = {1},
}
@article{Brehmer2023reduced,
title = {Reduced basis surrogates for quantum spin systems based on tensor networks},
author = {Brehmer, Paul and Herbst, Michael F. and Wessel, Stefan and Rizzi, Matteo and Stamm, Benjamin},
journal = {Physical Review E},
volume = {108},
pages = {025306},
year = {2023},
month = {7},
day = {30},
doi = {10.1103/PhysRevE.108.025306},
url = {http://arxiv.org/abs/2304.13587},
}
@article{Cances2023response,
author = {Cancès, Eric and Herbst, Michael F. and Kemlin, Gaspard and Levitt, Antoine and Stamm, Benjamin},
journal = {Letters in Mathematical Physics},
pages = {21},
title = {Numerical stability and efficiency of response property calculations in density functional theory},
code = {https://github.com/gkemlin/response-calculations-metals},
volume = {113},
year = {2023},
month = {01},
day = {12},
doi = {10.1007/s11005-023-01645-3},
url = {https://arxiv.org/abs/2210.04512},
}


%
% Other articles
%
5 changes: 1 addition & 4 deletions publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

# Publications

- Michele Nottoli, **Michael F. Herbst**, Aleksandr Mikhalev, Abhinav Jha, Filippo Lipparini and Benjamin Stamm. [*ddX: Polarizable Continuum Solvation from Small Molecules to Proteins*](https://doi.org/10.26434/chemrxiv-2024-787rx). [DOI 10.26434/chemrxiv-2024-787r](https://doi.org/10.26434/chemrxiv-2024-787rx)
- Katharine Fisher, **Michael F. Herbst**, Youssef Marzouk. [*Multitask methods for predicting molecular properties from heterogeneous data*](https://arxiv.org/pdf/2401.17898). Journal of Chemical Physics (2024). [arXiv:2401.17898](https://arxiv.org/abs/2401.17898)
- Paul Brehmer, **Michael F. Herbst**, Stefan Wessel, Matteo Rizzi and Benjamin Stamm. [*Reduced basis surrogates for quantum spin systems based on tensor networks.*](https://michael-herbst.com/publications/2023.05.12_rbm_dmrg.pdf) Physical Review E **108**, 025306 (2023). [arXiv:2304.13587](https://arxiv.org/abs/2304.13587)

{{allpublications}}

\newline
For older publications of Michael Herbst
Expand Down
72 changes: 72 additions & 0 deletions utils.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
using TOML
using Bibliography
using Bibliography: BibInternal
using Markdown: htmlesc

#
# Email protection
#

"""Insert a javascript blob for assembling emails"""
function hfun_email_unprotect_js()
return """<script>
Expand All @@ -19,6 +25,9 @@ function protected_email_link(email::AbstractString)
end
hfun_protect_email(params) = protected_email_link(params[1])

#
# News
#

"""Get all news sorted by publication date"""
function news_sorted()
Expand Down Expand Up @@ -121,6 +130,10 @@ function hfun_newsheader()
end
end

#
# People list
#

function normalised_from_email(s::AbstractString)
@assert endswith(s, "@epfl.ch")
beginning = split(s, "@")[1]
Expand Down Expand Up @@ -240,3 +253,62 @@ function hfun_people_table()

String(take!(io))
end

#
# Publications
#


function format_bibentry(entry::BibInternal.Entry)
@assert entry.type == "article" || entry.type == "unpublished"
io = IOBuffer()

# TODO Highlight authors from my group

# Format authors
function format_name(s)
join(filter(!isempty, [s.first, s.middle, s.particle, s.last, s.junior]), " ")
end
join(io, format_name.(entry.authors), ", ", " and ")
print(io, ". ")
print(io, "*[$(entry.title)]($(entry.access.url))*. ")

if !isempty(entry.in.journal)
# Published article
print(io, entry.in.journal, " ")
if !isempty(entry.in.volume) && !isempty(entry.in.pages)
print(io, "**", entry.in.volume, "**, $(entry.in.pages) ")
end
print(io, "(", entry.date.year, ").")
end

if !isempty(entry.access.doi)
print(io, " [DOI $(entry.access.doi)](https://doi.org/$(entry.access.doi))")
end

# TODO Code, data etc.

String(take!(io))
end

function hfun_allpublications()
biblio = collect(values(Bibliography.import_bibtex("_data/publications.bib")))
biblio = sort(biblio, by=e -> Date(
parse(Int, e.date.year),
parse(Int, e.date.month),
parse(Int, e.date.day),
), rev=true)
io = IOBuffer()

println(io, "## Under review")
for entry in filter(e -> e.type == "unpublished", biblio)
println(io, "- ", format_bibentry(entry))
end

println(io, "## Peer-reviewed articles")
for entry in filter(e -> e.type == "article", biblio)
# TODO Improve
println(io, "- ", format_bibentry(entry))
end
Franklin.fd2html(String(take!(io)); internal=true)
end

0 comments on commit 0724665

Please sign in to comment.