|
| 1 | +#let poster( |
| 2 | + // set variables for use throughout |
| 3 | + // note: some are referenced from `.qmd` file |
| 4 | + size: "'36x24' or '48x36''", |
| 5 | + title: "Paper Title", |
| 6 | + authors: "Author Names (separated by commas)", |
| 7 | + departments: "Department Name", |
| 8 | + univ_logo: "Logo Path", |
| 9 | + footer_text: " ", |
| 10 | + footer_url: "Footer URL", |
| 11 | + footer_email_ids: "Email IDs (separated by commas)", |
| 12 | + footer_color: "Hex Color Code", |
| 13 | + keywords: (), |
| 14 | + num_columns: "4", |
| 15 | + univ_logo_scale: "160", |
| 16 | + univ_logo_column_size: "10", |
| 17 | + title_column_size: "33", |
| 18 | + title_font_size: "48", |
| 19 | + authors_font_size: "36", |
| 20 | + footer_url_font_size: "40", |
| 21 | + footer_text_font_size: "40", |
| 22 | + body |
| 23 | +) = { |
| 24 | + // initialize template display formatting |
| 25 | + set text(font: "Lato", size: 30pt) |
| 26 | + let sizes = size.split("x") |
| 27 | + let width = int(sizes.at(0)) * 1in |
| 28 | + let height = int(sizes.at(1)) * 1in |
| 29 | + univ_logo_scale = int(univ_logo_scale) * 1% |
| 30 | + title_font_size = int(title_font_size) * 1pt |
| 31 | + authors_font_size = int(authors_font_size) * 1pt |
| 32 | + num_columns = int(num_columns) |
| 33 | + univ_logo_column_size = int(univ_logo_column_size) * 1in |
| 34 | + title_column_size = int(title_column_size) * 1in |
| 35 | + footer_url_font_size = int(footer_url_font_size) * 1pt |
| 36 | + footer_text_font_size = int(footer_text_font_size) * 1pt |
| 37 | + |
| 38 | + // create overall page output |
| 39 | + set page( |
| 40 | + // total dimensions |
| 41 | + width: width, |
| 42 | + height: height, |
| 43 | + // margin on all sides |
| 44 | + margin: |
| 45 | + (top: .8in, left: .8in, right: .8in, bottom: 1.8in), |
| 46 | + // footer section |
| 47 | + footer: [ |
| 48 | + #set align(center) |
| 49 | + #set text(42pt) |
| 50 | + #block( |
| 51 | + fill: rgb(footer_color), |
| 52 | + width: 100%, |
| 53 | + inset: 20pt, |
| 54 | + radius: 10pt, |
| 55 | + // adds text to footer |
| 56 | + [ |
| 57 | + #text(font: "Lato", size: footer_url_font_size, footer_url) |
| 58 | + #h(1fr) |
| 59 | + #text(size: footer_text_font_size, smallcaps(footer_text)) |
| 60 | + #h(1fr) |
| 61 | + #text(font: "Lato", size: footer_url_font_size, footer_email_ids) |
| 62 | + ] |
| 63 | + ) |
| 64 | + ] |
| 65 | + ) |
| 66 | + |
| 67 | + // set math display properties |
| 68 | + set math.equation(numbering: "(1)") |
| 69 | + show math.equation: set block(spacing: 0.65em) |
| 70 | + |
| 71 | + set enum(indent: 10pt, body-indent: 9pt) |
| 72 | + set list(indent: 10pt, body-indent: 9pt) |
| 73 | + |
| 74 | + // set the heading numbering system |
| 75 | + set heading(numbering: "I.A.1.") |
| 76 | + show heading: it => context { |
| 77 | + // Get numbering tuple for *this* heading at the current location. |
| 78 | + let levels = counter(heading).at(here()) |
| 79 | + let deepest = if levels != () { levels.last() } else { 1 } |
| 80 | + |
| 81 | + // defines how sub-headers display |
| 82 | + set text(24pt, weight: 400) |
| 83 | + |
| 84 | + // sub-header level 0 |
| 85 | + if it.level == 0 [ |
| 86 | + #set text(style: "italic") |
| 87 | + #v(32pt, weak: true) |
| 88 | + #if it.numbering != none { |
| 89 | + numbering("i.", deepest) |
| 90 | + h(7pt, weak: true) |
| 91 | + } |
| 92 | + #it.body |
| 93 | + |
| 94 | + // sub-header level 1 |
| 95 | + ] else if it.level == 1 [ |
| 96 | + #v(10pt, weak: true) |
| 97 | + #set align(left) |
| 98 | + #set text({ 40pt }, weight: 600, font: "Vollkorn", fill: rgb("#73213b")) |
| 99 | + #v(50pt, weak: true) |
| 100 | + #if it.numbering != none { |
| 101 | + numbering("I.", deepest) |
| 102 | + h(7pt, weak: true) |
| 103 | + } |
| 104 | + #it.body |
| 105 | + #v(30pt, weak: true) |
| 106 | + #line(length: 100%, stroke: rgb(200, 200, 200)) |
| 107 | + #v(30pt, weak: true) |
| 108 | + |
| 109 | + // all other headers |
| 110 | + ] else [ |
| 111 | + #set text({ 36pt }, weight: 600, font: "Vollkorn", fill: rgb("#af4e6d"), style: "italic") |
| 112 | + #if it.level == 2 { |
| 113 | + numbering("⧈ a)", deepest) |
| 114 | + [ ] |
| 115 | + } |
| 116 | + #it.body |
| 117 | + #v(40pt, weak: true) |
| 118 | + ] |
| 119 | +} |
| 120 | + |
| 121 | + // header grid |
| 122 | +align(left, |
| 123 | + grid( |
| 124 | + // add one more column at the start for the left-side image |
| 125 | + rows: (auto, auto), |
| 126 | + columns: (200pt, title_column_size, univ_logo_column_size), |
| 127 | + column-gutter: 5pt, |
| 128 | + row-gutter: 30pt, |
| 129 | + |
| 130 | + // left-side image cell |
| 131 | + grid.cell( |
| 132 | + pad(top: -18pt, |
| 133 | + image("images/cdf_icon.svg", width: 190pt), |
| 134 | + ), |
| 135 | + rowspan: 3, |
| 136 | + align: left, |
| 137 | + ), |
| 138 | + |
| 139 | + // main title |
| 140 | + text(font: "Vollkorn", weight: 500, size: 55pt)[ |
| 141 | + Exploring single-cell |
| 142 | + #text(weight: 800, style: "italic")[images and profiles] together with~~ |
| 143 | + #text(baseline: 0pt)[ |
| 144 | + #box( |
| 145 | + stroke: (paint: rgb("#BF0A30"), thickness: 3pt), |
| 146 | + outset: 26pt, |
| 147 | + radius: 4pt, |
| 148 | + box( |
| 149 | + stroke: (paint: rgb("#BF0A30"), thickness: 3pt), |
| 150 | + outset: 17pt, |
| 151 | + radius: 4pt, |
| 152 | + text(fill: rgb("#BF0A30"), weight: 800)[CytoDataFrame]))] |
| 153 | + ], |
| 154 | + |
| 155 | + // university logo on the far right |
| 156 | + grid.cell( |
| 157 | + pad(top: 0pt, |
| 158 | + image(univ_logo, width: univ_logo_scale), |
| 159 | + ), |
| 160 | + rowspan: 3, |
| 161 | + align: right, |
| 162 | + ), |
| 163 | + |
| 164 | + // author display |
| 165 | + pad(top: 5pt, text(size: 38pt, authors)), |
| 166 | + |
| 167 | + // department and notes display |
| 168 | + pad(top: 5pt, text(size: 30pt, emph(departments))) |
| 169 | + ) |
| 170 | + ) |
| 171 | + |
| 172 | + // spacing between the header and body |
| 173 | + v(40pt) |
| 174 | + |
| 175 | + // set main body display |
| 176 | + show: columns.with(num_columns, gutter: 60pt) |
| 177 | + // paragraph display properties |
| 178 | + set par(leading: 10pt, |
| 179 | + justify: false, |
| 180 | + first-line-indent: 0em, |
| 181 | + linebreaks: "optimized" |
| 182 | + ) |
| 183 | + |
| 184 | + // Configure figures. |
| 185 | + show figure: it => block({ |
| 186 | + // Display a backdrop rectangle. |
| 187 | + it.body |
| 188 | + |
| 189 | + // Display caption. |
| 190 | + if it.has("caption") { |
| 191 | + set align(left) |
| 192 | + v(if it.has("gap") { it.gap } else { 24pt }, weak: true) |
| 193 | + set text(weight: "bold") |
| 194 | + it.caption |
| 195 | + } |
| 196 | + |
| 197 | + }) |
| 198 | + |
| 199 | + // adds body content to page |
| 200 | + body |
| 201 | +} |
0 commit comments