From 6fce82b34a9a0a795c34a3c38f788f2dfd0a3c4b Mon Sep 17 00:00:00 2001 From: Leo Werneck Date: Sun, 5 Jan 2025 20:52:13 -0800 Subject: [PATCH] Several updates to how research papers are presented --- _config.yml | 1 - _plugins/bibtex_tag.rb | 18 +- _research/publications.md | 67 +++--- _sass/minimal-mistakes/_base.scss | 2 +- _sass/minimal-mistakes/_buttons.scss | 10 +- _sass/minimal-mistakes/_page.scss | 3 +- _sass/minimal-mistakes/_sidebar.scss | 42 ++-- _sass/minimal-mistakes/_variables.scss | 4 +- assets/css/bibtex.css | 47 +++-- .../{2021_armengol.png => 2022_armengol.png} | Bin ...{2021_assumpcao.png => 2022_assumpcao.png} | Bin .../{2022_werneck.png => 2023_werneck.png} | Bin assets/js/bibtex-parser.js | 191 ++++++++++++++---- 13 files changed, 270 insertions(+), 115 deletions(-) rename assets/images/papers/{2021_armengol.png => 2022_armengol.png} (100%) rename assets/images/papers/{2021_assumpcao.png => 2022_assumpcao.png} (100%) rename assets/images/papers/{2022_werneck.png => 2023_werneck.png} (100%) diff --git a/_config.yml b/_config.yml index 6674814..55969d6 100644 --- a/_config.yml +++ b/_config.yml @@ -346,7 +346,6 @@ defaults: toc: true sidebar: nav: "research" - # _dsa - scope: path: "" diff --git a/_plugins/bibtex_tag.rb b/_plugins/bibtex_tag.rb index 829f653..f18e7a7 100644 --- a/_plugins/bibtex_tag.rb +++ b/_plugins/bibtex_tag.rb @@ -1,4 +1,4 @@ -# _plugins/paper_tag.rb +# _plugins/bibtex_tag.rb module Jekyll class BibtexTag < Liquid::Block def initialize(tag_name, image_url, tokens) @@ -17,11 +17,17 @@ def render(context)
Paper thumbnail
-
-

-
-
- #{text} +
+
+
+
+
+ Journal + arXiv +
+
+ #{text} +
HTML diff --git a/_research/publications.md b/_research/publications.md index 6779bf1..2f0b2d0 100644 --- a/_research/publications.md +++ b/_research/publications.md @@ -1,11 +1,38 @@ --- title: Publications permalink: /research/publications/ +classes: wide toc: false bibtex: true --- -# Peer-Reviewed +# 2024 +{% bibtex /assets/images/papers/2024_pierre-jacques.png %} +@article{Jacques:2024pxh, + author = "Jacques, Terrence Pierre and Cupp, Samuel and Werneck, Leonardo R. and Tootle, Samuel D. and Hamilton, Maria C. Babiuc and Etienne, Zachariah B.", + title = "{GRoovy: A General Relativistic Hydrodynamics Code for Dynamical Spacetimes with Curvilinear Coordinates, Tabulated Equations of State, and Neutrino Physics}", + eprint = "2412.03659", + archivePrefix = "arXiv", + primaryClass = "gr-qc", + month = "12", + year = "2024", + misc = "Submitted to Phys. Rev. D" +} +{% endbibtex %} + +{% bibtex /assets/images/papers/2024_duez.png %} +@article{Duez:2024ujs, + author = "Duez, Matthew D. and Cadenhead, Courtney L. and Etienne, Zachariah B. and Kelly, Bernard and Werneck, Leonardo R.", + title = "{Toward 2D Dynamo Models Calibrated by Global 3D Relativistic Accretion Disk Simulations}", + eprint = "2409.02899", + archivePrefix = "arXiv", + primaryClass = "astro-ph.HE", + month = "9", + year = "2024", + misc = "Submitted to Phys. Rev. D" +} +{% endbibtex %} + {% bibtex /assets/images/papers/2024_zenati.png %} @article{Zenati:2024pgn, author = "Zenati, Yossef and Krolik, Julian H. and Werneck, Leonardo R. and Etienne, Zachariah B. and Noble, Scott C. and Murguia-Berthier, Ariadna and Schnittman, Jeremy D.", @@ -39,6 +66,7 @@ bibtex: true } {% endbibtex %} +# 2023 {% bibtex /assets/images/papers/2023_zenati.png %} @article{Zenati:2023lwh, author = "Zenati, Yossef and Krolik, Julian H. and Werneck, Leonardo R. and Murguia-Berthier, Ariadna and Etienne, Zachariah B. and Noble, Scott C. and Piran, Tsvi", @@ -55,9 +83,9 @@ bibtex: true } {% endbibtex %} -{% bibtex /assets/images/papers/2022_werneck.png %} +{% bibtex /assets/images/papers/2023_werneck.png %} @article{Werneck:2022exo, - author = "Werneck, Leonardo R. and others", + author = "Werneck, Leonardo R. and Etienne, Zachariah B. and Murguia-Berthier, Ariadna and Haas, Roland and Cipolletta, Federico and others", title = "{Addition of tabulated equation of state and neutrino leakage support to illinoisgrmhd}", eprint = "2208.14487", archivePrefix = "arXiv", @@ -71,7 +99,8 @@ bibtex: true } {% endbibtex %} -{% bibtex /assets/images/papers/2021_armengol.png %} +# 2022 +{% bibtex /assets/images/papers/2022_armengol.png %} @article{Armengol:2021mbt, author = "Armengol, Federico G. Lopez and Etienne, Zachariah B. and Noble, Scott C. and Kelly, Bernard J. and Werneck, Leonardo R. and others", title = "{Handing off the outcome of binary neutron star mergers for accurate and long-term postmerger simulations}", @@ -87,7 +116,7 @@ bibtex: true } {% endbibtex %} -{% bibtex /assets/images/papers/2021_assumpcao.png %} +{% bibtex /assets/images/papers/2022_assumpcao.png %} @article{Assumpcao:2021fhq, author = "Assumpcao, Thiago and Werneck, Leonardo R. and Jacques, Terrence Pierre and Etienne, Zachariah B.", title = "{Fast hyperbolic relaxation elliptic solver for numerical relativity: Conformally flat, binary puncture initial data}", @@ -103,6 +132,7 @@ bibtex: true } {% endbibtex %} +# 2021 {% bibtex /assets/images/papers/2021_werneck.png %} @article{Werneck:2021kch, author = "Werneck, Leonardo R. and Etienne, Zachariah B. and Abdalla, Elcio and Cuadros-Melgar, Bertha and Pellicer, C. E.", @@ -135,30 +165,3 @@ bibtex: true } {% endbibtex %} -# Preprints - -{% bibtex /assets/images/papers/2024_pierre-jacques.png %} -@article{Jacques:2024pxh, - author = "Jacques, Terrence Pierre and Cupp, Samuel and Werneck, Leonardo R. and Tootle, Samuel D. and Hamilton, Maria C. Babiuc and Etienne, Zachariah B.", - title = "{GRoovy: A General Relativistic Hydrodynamics Code for Dynamical Spacetimes with Curvilinear Coordinates, Tabulated Equations of State, and Neutrino Physics}", - eprint = "2412.03659", - archivePrefix = "arXiv", - primaryClass = "gr-qc", - month = "12", - year = "2024", - misc = "Submitted to Phys. Rev. D" -} -{% endbibtex %} - -{% bibtex /assets/images/papers/2024_duez.png %} -@article{Duez:2024ujs, - author = "Duez, Matthew D. and Cadenhead, Courtney L. and Etienne, Zachariah B. and Kelly, Bernard and Werneck, Leonardo R.", - title = "{Toward 2D Dynamo Models Calibrated by Global 3D Relativistic Accretion Disk Simulations}", - eprint = "2409.02899", - archivePrefix = "arXiv", - primaryClass = "astro-ph.HE", - month = "9", - year = "2024", - misc = "Submitted to Phys. Rev. D" -} -{% endbibtex %} diff --git a/_sass/minimal-mistakes/_base.scss b/_sass/minimal-mistakes/_base.scss index ca71887..bb15074 100644 --- a/_sass/minimal-mistakes/_base.scss +++ b/_sass/minimal-mistakes/_base.scss @@ -27,7 +27,7 @@ h3, h4, h5, h6 { - margin: 2em 0 0.5em; + margin: 0em 0 0.5em; line-height: 1.2; font-family: $header-font-family; font-weight: bold; diff --git a/_sass/minimal-mistakes/_buttons.scss b/_sass/minimal-mistakes/_buttons.scss index 87e705c..4fe19ca 100644 --- a/_sass/minimal-mistakes/_buttons.scss +++ b/_sass/minimal-mistakes/_buttons.scss @@ -39,7 +39,10 @@ (info, $info-color), (facebook, $facebook-color), (twitter, $twitter-color), - (linkedin, $linkedin-color); + (linkedin, $linkedin-color), + (journal, $facebook-color), + (arxiv, $danger-color), + (pdf, $lighter-gray); @each $buttoncolor, $color in $buttoncolors { &--#{$buttoncolor} { @@ -94,4 +97,9 @@ &--small { font-size: $type-size-7; } + + /* bibtex buttons */ + &--bibtex { + padding: 0em 0.5em; + } } diff --git a/_sass/minimal-mistakes/_page.scss b/_sass/minimal-mistakes/_page.scss index 96c316a..5671fa5 100644 --- a/_sass/minimal-mistakes/_page.scss +++ b/_sass/minimal-mistakes/_page.scss @@ -562,7 +562,8 @@ body { } @include breakpoint($x-large) { - padding-inline-end: 0; + width: calc(100% - #{$right-sidebar-width-narrow}); + padding-inline-end: 50px; } } } diff --git a/_sass/minimal-mistakes/_sidebar.scss b/_sass/minimal-mistakes/_sidebar.scss index ec3f9a5..919b2b9 100644 --- a/_sass/minimal-mistakes/_sidebar.scss +++ b/_sass/minimal-mistakes/_sidebar.scss @@ -325,25 +325,37 @@ Wide Pages ========================================================================== */ -.wide .sidebar__right { - margin-bottom: 1em; +.wide { + .sidebar__right { + margin-bottom: 1em; - @include breakpoint($large) { - position: initial; - top: initial; - inset-inline-end: initial; - width: initial; - margin-inline-end: initial; - padding-inline-start: initial; - z-index: initial; + @include breakpoint($large) { + position: initial; + top: initial; + inset-inline-end: initial; + width: initial; + margin-inline-end: initial; + padding-inline-start: initial; + z-index: initial; + + &.sticky { + float: none; + } + } - &.sticky { - float: none; + @include breakpoint($x-large) { + width: initial; + margin-inline-end: initial; } } - @include breakpoint($x-large) { - width: initial; - margin-inline-end: initial; + .sidebar { + @include breakpoint($large) { + width: calc(#{$right-sidebar-width-narrow} - 1em); + } + + @include breakpoint($x-large) { + width: calc(#{$right-sidebar-width-narrow} - 1em); + } } } diff --git a/_sass/minimal-mistakes/_variables.scss b/_sass/minimal-mistakes/_variables.scss index e95d5da..565b562 100644 --- a/_sass/minimal-mistakes/_variables.scss +++ b/_sass/minimal-mistakes/_variables.scss @@ -61,7 +61,7 @@ $h-size-6: 1em !default; // ~16px $gray: #7a8288 !default; $dark-gray: mix(#000, $gray, 50%) !default; $darker-gray: mix(#000, $gray, 60%) !default; -$light-gray: mix(#fff, $gray, 50%) !default; +$light-gray: #aaa !default; $lighter-gray: mix(#fff, $gray, 90%) !default; $background-color: #fff !default; @@ -69,7 +69,7 @@ $code-background-color: #fafafa !default; $code-background-color-dark: $light-gray !default; $text-color: $dark-gray !default; $muted-text-color: mix(#fff, $text-color, 20%) !default; -$border-color: $lighter-gray !default; +$border-color: $light-gray !default; $form-background-color: $lighter-gray !default; $footer-background-color: $lighter-gray !default; diff --git a/assets/css/bibtex.css b/assets/css/bibtex.css index 6e8f18f..9f700a5 100644 --- a/assets/css/bibtex.css +++ b/assets/css/bibtex.css @@ -1,26 +1,47 @@ .bibtex-entry { display: flex; - align-items: center; - margin-bottom: 20px; - max-width: 800px; + gap: 20px; + margin-bottom: 30px; + max-width: calc(100% - 60px); } .bibtex-image { - border: 1px solid #ccc; - margin-left: 10px; - margin-right: 20px; - width: 100px; - height: 100px; flex-shrink: 0; + width: 150px; + height: 150px; + border: 1px solid #ccc; +} + +.bibtex-image img { + width: 100%; + height: 100%; + object-fit: cover; } -.bibtex-details { +.bibtex-contents { flex-grow: 1; display: flex; - align-items: center; + justify-content: center; + flex-direction: column; +} + +.paper-title { + font-size: 1.1em; + text-align: justify; + padding-bottom: 8px; + border-bottom: 1px solid #bbb; } -.bibtex-details p { - margin: 0; - line-height: 1.5; +.paper-authors { + padding-top: 8px; +} + +.paper-journal { + color: #666; +} + +.bibtex-buttons { + margin-top: 8px; + display: flex; + gap: 10px; } diff --git a/assets/images/papers/2021_armengol.png b/assets/images/papers/2022_armengol.png similarity index 100% rename from assets/images/papers/2021_armengol.png rename to assets/images/papers/2022_armengol.png diff --git a/assets/images/papers/2021_assumpcao.png b/assets/images/papers/2022_assumpcao.png similarity index 100% rename from assets/images/papers/2021_assumpcao.png rename to assets/images/papers/2022_assumpcao.png diff --git a/assets/images/papers/2022_werneck.png b/assets/images/papers/2023_werneck.png similarity index 100% rename from assets/images/papers/2022_werneck.png rename to assets/images/papers/2023_werneck.png diff --git a/assets/js/bibtex-parser.js b/assets/js/bibtex-parser.js index 45791fc..a8bac50 100644 --- a/assets/js/bibtex-parser.js +++ b/assets/js/bibtex-parser.js @@ -33,73 +33,178 @@ function formatAuthorName(authorStr) { return `${initials}. ${lastName}`; } -function formatAuthors(authorStr, boldAuthor = "L.R. Werneck") { - // Replace "others" with italicized "et al." - authorStr = authorStr.replace(/\band\s+others\b/, 'and et al.'); +function formatAuthors(authorStr, myName = "L.R. Werneck") { + // Split authors into array + const authors = authorStr.split(' and ').map(a => a.trim()); - return authorStr.split(' and ') - .map(author => { - author = author.trim(); - // Skip formatting for the et al. part - if (author.includes('et al')) return author; + // Find my position in the author list + const myIndex = authors.findIndex(author => formatAuthorName(author) === myName); - const formattedName = formatAuthorName(author); + // If there are 5 or fewer authors, handle normally + if (authors.length <= 5) { + if (myIndex === -1) { + return authors.map(author => formatAuthorName(author)).join(', '); + } - // Check if this is the author to be bold (compare original unformatted name) - if (formattedName === boldAuthor) { - return `L.R. Werneck`; - } - return formattedName; - }) - .join(', '); + let formattedAuthors = authors + .map((author, index) => { + if (index === myIndex) { + return `${myName}`; + } + return formatAuthorName(author); + }); + + // Add "and" before the last author if needed + if (formattedAuthors.length > 1) { + formattedAuthors[formattedAuthors.length - 1] = 'and ' + formattedAuthors[formattedAuthors.length - 1]; + } + + return formattedAuthors.join(', '); + } + + // More than 5 authors + if (myIndex === -1 || myIndex >= 5) { + // Show first 5 authors and et al. + const firstFive = authors.slice(0, 5).map(author => formatAuthorName(author)); + if (myIndex > 5) { + return firstFive.join(', ') + ', ' + `${myName}` + ' et al.'; + } + return firstFive.join(', ') + ' et al.'; + } + + // I'm among the first 5 authors + let formattedAuthors = authors.slice(0, 5).map((author, index) => { + if (index === myIndex) { + return `${myName}`; + } + return formatAuthorName(author); + }); + + return formattedAuthors.join(', ') + ' et al.'; +} + +function formatTitle(title) { + // List of words to keep lowercase + const lowercaseWords = new Set([ + 'a', 'an', 'the', 'and', 'but', 'or', 'for', 'nor', 'on', 'at', + 'to', 'by', 'in', 'of', 'with', 'as' + ]); + + // List of special terms to preserve exact capitalization + const preserveTerms = new Map([ + ['illinoisgrmhd', 'IllinoisGRMHD'], + ['nrpy+', 'NRPy+'], + ['retinas', 'RETINAS'], + ['nrpycritcol', 'NRPyCritCol'], + ['sfcollapse1d', 'SFcollapse1D'], + ['groovy', 'GRoovy'], + ['grhayl', 'GRHayL'], + ['harm3d+nuc', 'HARM3D+NUC'], + ['1d', '1D'], + ['2d', '2D'], + ['3d', '3D'], + ]); + + // Remove any remaining braces and split into words + const cleanTitle = title.replace(/[{}]/g, ''); + const words = cleanTitle.split(/\s+/); + + // Capitalize words according to rules + const titleCase = words.map((word, index) => { + // Remove punctuation from the word for comparison + const match = word.match(/^([a-zA-Z0-9+]+)([.,:;!?]*)$/); + const baseWord = match ? match[1] : word; + const punctuation = match ? match[2] : ''; + + // Convert base word to lowercase for comparison + const lowercaseWord = baseWord.toLowerCase(); + + // Check if word is a special term that needs preservation + if (preserveTerms.has(lowercaseWord)) { + return preserveTerms.get(lowercaseWord) + punctuation; + } + + // Always capitalize first and last word + if (index === 0 || index === words.length - 1) { + return baseWord.charAt(0).toUpperCase() + baseWord.slice(1).toLowerCase() + punctuation; + } + // Check if word should remain lowercase + if (lowercaseWords.has(lowercaseWord)) { + return baseWord.toLowerCase() + punctuation; + } + // Capitalize first letter of other words + return baseWord.charAt(0).toUpperCase() + baseWord.slice(1).toLowerCase() + punctuation; + }); + + return `${titleCase.join(' ')}`; } function formatCitation(bibData) { if (!bibData) return ''; - const { fields } = bibData; - const parts = []; - if (fields.author) { - const authorsElement = document.createElement('span'); - authorsElement.innerHTML = formatAuthors(fields.author); - parts.push(authorsElement.outerHTML); - } + // Create separate elements for each part + const titleElement = document.createElement('div'); + const authorsElement = document.createElement('div'); + const journalElement = document.createElement('div'); + // Format title if (fields.title) { - // Remove any remaining braces and add italics - const cleanTitle = fields.title.replace(/[{}]/g, ''); - parts.push(`${cleanTitle}`); + titleElement.innerHTML = formatTitle(fields.title); } - if (fields.journal) { - parts.push(`${fields.journal}, ${fields.volume} (${fields.number}) ${fields.pages}`); - } - - if (fields.eprint && fields.archiveprefix === "arXiv") { - parts.push(`arXiv:${fields.eprint} [${fields.primaryclass}]`) - } - - if (fields.misc) { - parts.push(`${fields.misc}`) + // Format authors + if (fields.author) { + authorsElement.innerHTML = formatAuthors(fields.author); } - if (fields.year) { - // Add year in parentheses with bold numbers - return parts.join(', ') + ` (${fields.year}).`; + // Format journal info + if (fields.journal) { + journalElement.innerHTML = `${fields.journal}, ${fields.volume} (${fields.number}) ${fields.pages} (${fields.year})`; + } else if (fields.eprint && fields.archiveprefix === "arXiv") { + journalElement.innerHTML = `arXiv:${fields.eprint} [${fields.primaryclass}] (${fields.year})`; } - return undefined; + return { + title: titleElement.innerHTML, + authors: authorsElement.innerHTML, + journal: journalElement.innerHTML + }; } document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('.bibtex-entry').forEach(container => { const bibtexData = container.querySelector('.bibtex-data'); - const displayElement = container.querySelector('.bibtex-details p'); + const titleElement = container.querySelector('.paper-title'); + const authorsElement = container.querySelector('.paper-authors'); + const journalElement = container.querySelector('.paper-journal'); - if (bibtexData && displayElement) { + if (bibtexData) { const parsed = parseBibTeX(bibtexData.textContent); - displayElement.innerHTML = formatCitation(parsed); + const formatted = formatCitation(parsed); + + // Set the content for each section + if (titleElement) titleElement.innerHTML = formatted.title; + if (authorsElement) authorsElement.innerHTML = formatted.authors; + if (journalElement) journalElement.innerHTML = formatted.journal; + + // Set up the button links + if (parsed && parsed.fields) { + const journalButton = container.querySelector('.btn--journal'); + if (journalButton && parsed.fields.doi) { + journalButton.href = `https://doi.org/${parsed.fields.doi}`; + } else if (journalButton) { + journalButton.style.display = 'none'; + } + + const arxivButton = container.querySelector('.btn--arxiv'); + if (arxivButton && parsed.fields.eprint) { + arxivButton.href = `https://arxiv.org/abs/${parsed.fields.eprint}`; + } else if (arxivButton) { + arxivButton.style.display = 'none'; + } + } + bibtexData.style.display = 'none'; } });