quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.92k stars 324 forks source link

Option to display academic publications #1324

Open drfurtado opened 2 years ago

drfurtado commented 2 years ago

It would be very helpful if Quarto had a way to streamline the process of adding academic publications to a page.

Something similar to the example below:

https://research-group.netlify.app/publication/

jjallaire commented 2 years ago

You could probably do something like this using the listings feature: https://quarto.org/docs/websites/website-listings.html. Esp. using custom listings: https://quarto.org/docs/websites/website-listings-custom.html. Note that listings can use documents as their source but also custom YAML.

All of that said I agree that it would be much better if we created an integrated feature for doing this!

jjallaire commented 2 years ago

@dragonstyle Let's note this as a future improvement to "blogs" / "about pages"

drfurtado commented 2 years ago

@dragonstyle Let's note this as a future improvement to "blogs" / "about pages"

I see this being used not only by individuals but also by research groups; for instance: https://csun-mllab.netlify.app

I am impressed with Quarto. I am slowly moving all my "academic life" into Quarto... and convincing others to do so.

jhelvy commented 2 years ago

I hacked together something like this on my distill site here. I'm working on converting my site to Quarto, and I was planning on using the listings feature to replicate this layout. I'll post it here if I figure it out.

dragonstyle commented 2 years ago

@jhelvy That looks great- pretty cool (and I like the haiku summaries :) )

jhelvy commented 2 years ago

@jhelvy That looks great- pretty cool (and I like the haiku summaries :) )

I stole the haiku summaries idea from @andrewheiss's research page (which is also a great example of a publications page).

jmgirard commented 2 years ago

I've built a very simple version of this for my lab website. It takes the listing approach rather than pulling from .bib or something like that but it works for now. https://jmgirard.github.io/affcomlab/publications.html

Here is the EJS powering it: https://github.com/jmgirard/affcomlab/blob/main/ejs/article.ejs

<ul class="pub-list list">
<% for (const item of items) { %>
  <li <%= metadataAttrs(item) %>>
    <span class="listing-authors"><%= item.authors %>. </span>
    <span class="listing-year">(<%= item.year %>). </span>
    <span class="listing-title"><%= item.title %>. </span>
    <span class="listing-publication fst-italic "><%= item.publication %>.</span>
    <br />
    <a href="<%- item.path %>" class="btn btn-primary">
      Details
    </a>
    <% if (item.doi) { %>
    <a href="<%- item.doi %>" class="btn btn-secondary" target="_blank" rel="noopener noreferrer">
      DOI
    </a>
    <% } %>
    <% if (item.preprint) { %>
    <a href="<%- item.preprint %>" class="btn btn-light" target="_blank" rel="noopener noreferrer">
      <i class="bi bi-file-earmark-text"></i> Preprint
    </a>
    <% } %>
    <% if (item.materials) { %>
    <a href="<%- item.materials %>" class="btn btn-light" target="_blank" rel="noopener noreferrer">
      <i class="bi bi-file-earmark-zip"></i> Materials
    </a>
    <% } %>
  </li>
<% } %>
</ul>
drfurtado commented 2 years ago

I've built a very simple version of this for my lab website. It takes the listing approach rather than pulling from .bib or something like that but it works for now. https://jmgirard.github.io/affcomlab/publications.html

Here is the EJS powering it: https://github.com/jmgirard/affcomlab/blob/main/ejs/article.ejs

<ul class="pub-list list">
<% for (const item of items) { %>
  <li <%= metadataAttrs(item) %>>
    <span class="listing-authors"><%= item.authors %>. </span>
    <span class="listing-year">(<%= item.year %>). </span>
    <span class="listing-title"><%= item.title %>. </span>
    <span class="listing-publication fst-italic "><%= item.publication %>.</span>
    <br />
    <a href="<%- item.path %>" class="btn btn-primary">
      Details
    </a>
    <% if (item.doi) { %>
    <a href="<%- item.doi %>" class="btn btn-secondary" target="_blank" rel="noopener noreferrer">
      DOI
    </a>
    <% } %>
    <% if (item.preprint) { %>
    <a href="<%- item.preprint %>" class="btn btn-light" target="_blank" rel="noopener noreferrer">
      <i class="bi bi-file-earmark-text"></i> Preprint
    </a>
    <% } %>
    <% if (item.materials) { %>
    <a href="<%- item.materials %>" class="btn btn-light" target="_blank" rel="noopener noreferrer">
      <i class="bi bi-file-earmark-zip"></i> Materials
    </a>
    <% } %>
  </li>
<% } %>
</ul>

Could you please provide more information how you implemented this approach using Quarto?

jmgirard commented 2 years ago

Step 1

Create a .qmd file (e.g., blog post) for a publication (I have a folder for all publications and then subfolders within that for articles and proceedings). So an example of a publication (article) page might be ./publications/articles/girard2021a.qmd. Note that the YAML header should include some information about the publication like author, title, year, etc. (even custom fields).

e.g., https://github.com/jmgirard/affcomlab/blob/main/publications/articles/girard2021a.qmd

Step 2

Create a .ejs file (i.e., template) for how to turn the YAML fields from your publication page into a listing entry. A relatively simple example is what I posted above, which might be saved in a file such as ./ejs/article.ejs. Note that this EJS code needs to be in an HTML chunk.

e.g., https://github.com/jmgirard/affcomlab/blob/main/ejs/article.ejs

Step 3

Create a listing page to show all your publications in the format specified in your EJS template. This might be the page that you link to from your navbar, for instance, and that visitors to your site actually go to such as ./publications.qmd. Note that this page needs to have the YAML header specify your listing's contents (i.e., a regex for where to find your publication files) and your template (i.e., the path to your EJS file). As you add more publications (.qmd) files that match your contents regex, the listing will grow to show those publications as well.

e.g., https://github.com/jmgirard/affcomlab/blob/main/publications.qmd

See it in action

https://lab.jmgirard.com/publications.html

drfurtado commented 2 years ago

Step 1

Create a .qmd file (e.g., blog post) for a publication (I have a folder for all publications and then subfolders within that for articles and proceedings). So an example of a publication (article) page might be ./publications/articles/girard2021a.qmd. Note that the YAML header should include some information about the publication like author, title, year, etc. (even custom fields).

e.g., https://github.com/jmgirard/affcomlab/blob/main/publications/articles/girard2021a.qmd

Step 2

Create a .ejs file (i.e., template) for how to turn the YAML fields from your publication page into a listing entry. A relatively simple example is what I posted above, which might be saved in a file such as ./ejs/article.ejs. Note that this EJS code needs to be in an HTML chunk.

e.g., https://github.com/jmgirard/affcomlab/blob/main/ejs/article.ejs

Step 3

Create a listing page to show all your publications in the format specified in your EJS template. This might be the page that you link to from your navbar, for instance, and that visitors to your site actually go to such as ./publications.qmd. Note that this page needs to have the YAML header specify your listing's contents (i.e., a regex for where to find your publication files) and your template (i.e., the path to your EJS file). As you add more publications (.qmd) files that match your contents regex, the listing will grow to show those publications as well.

e.g., https://github.com/jmgirard/affcomlab/blob/main/publications.qmd

See it in action

https://lab.jmgirard.com/publications.html

Thank you so much; it's very helpful.

camilogarciabotero commented 1 year ago

Hi,

I just wanted to put together some of the above publication listing sites, and add some others as the pattern seems to happen in several websites (I'm trying to find an alternative as well):

Here are some Quarto publications listing sites:

Non quarto publications lists:

Here is also a question on StackOverflow related to this as well and a couple of related discussions (https://github.com/quarto-dev/quarto-cli/discussions/5837, https://github.com/quarto-dev/quarto-cli/discussions/2925)

Above all, the @mcanouil alternative appears to me as the best and most effective one as it can generate a publications.qmd and a publications.yml from a single R script that uses a pandoc command. Yet the others might have more buttons and decorators in theirs lists.

mcanouil commented 1 year ago

Because it's a YAML file with the publication, you can easily change the listings since this one is completely customisable. For instance, the EJS from Andrew.

jhelvy commented 7 months ago

I previously was using {distill}, but in switching to Quarto I've come up with a couple hacks for my website.

I used fences and CSS to create my lab page. I made a float-left class to float images to the left with wrapped text. You can see how I use it in my lab.qmd file with the associated CSS.

My research page has a list of my publications with buttons to read more. The overall strategy is to store all of the data about each paper in a single googlesheet and then use a bunch of custom functions to generate HTML code out of them. The main function is make_pub_list(), which creates the list of publications for a given category. This is all highly customized, but the overall framework should be easy enough to adapt to different use cases. The nice thing is I only have to modify the googlesheet and my research page gets automatically updated (my site renders regularly on a github action).

I also came up with a way to generate "summary" pages of my papers using a template qmd file. I have a research folder where that template lives, then inside each paper folder I have an index.qmd file (for example, this one) that uses a child doc to render that template. The only thing that changes is a unique identifier for each paper (I use google scholar IDs stored in the googlesheet). This allows each rendered summary page to follow the same format, with all content sourced from the googlesheet.

jhelvy commented 7 months ago

Oh and btw, I use the same general strategy to automatically update my cv. It's just a quarto doc that renders to pdf, but it uses a similar set of custom functions to insert an up-to-date set of publications (and other content) from the same googlesheet. So if you adopt the "googlesheet as a database" idea, you can get an updated website and CV for free by just updating the googlesheet!

jpfairbanks commented 4 months ago

One problem I ran into with this strategy is that it creates a new HTML page for each publication. This extends build times and makes them scale with the number of publications. You can also make a listing using a YAML metadata block using this section of the docs. https://quarto.org/docs/websites/website-listings-custom.html#metadata-file-listings. So if you have the database of publications in a centralized bibtex or YAML file, you can just generate the listing input and still have quarto generate a table of your publications without generating an individual page for each publication.

jhelvy commented 4 months ago

Oh absolutely - the separate page for each publication is totally optional and not necessary unless you want it. In my case, I wanted both a summary list of all my papers (e.g. my main research page) as well as separate pages for each paper that give a larger overall summary, including the abstract, bibtex, etc. (e.g. like this one). I added a _metadata.yml file in my research folder with the freeze: true setting so that these pages don't re-render unless changed. That addresses the build time issue. Plus, to be completely honest, I'm not some powerhouse academic putting out tens of papers each year, so this list doesn't grow all that fast 😂