diff options
| author | John MacFarlane <[email protected]> | 2023-03-27 10:46:07 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-03-27 10:47:15 -0700 |
| commit | fd85560b848e1cd83cef737ed9d0b9bdc587fff2 (patch) | |
| tree | c8c14aade7fbbf719782baad2fc456ab616ec5bd /test/writer.typst | |
| parent | cf6a742710f631364bbb3145566927b17b794a02 (diff) | |
Typst: Use customized term instead of custom macro for def lists.
Diffstat (limited to 'test/writer.typst')
| -rw-r--r-- | test/writer.typst | 90 |
1 files changed, 56 insertions, 34 deletions
diff --git a/test/writer.typst b/test/writer.typst index 18a618163..26462a269 100644 --- a/test/writer.typst +++ b/test/writer.typst @@ -1,9 +1,4 @@ // Some definitions presupposed by pandoc's typst output. -#let definition(term, ..defs) = [ - #strong(term) \ - #(defs.pos().join("\n")) -] - #let blockquote(body) = [ #set text( size: 0.92em ) #block(inset: (left: 1.5em, top: 0.2em, bottom: 0.2em))[#body] @@ -16,6 +11,15 @@ #let endnote(num, contents) = [ #stack(dir: ltr, spacing: 3pt, super[#num], contents) ] +#show terms: it => { + it.children + .map(child => [ + #strong[#child.term] + #block(inset: (left: 1.5em, top: -0.4em))[#child.description] + ]) + .join() +} + #let conf( title: none, authors: none, @@ -388,43 +392,56 @@ B. Williams #label("definition-lists") Tight using spaces: -#definition[apple][red fruit] +/ apple: #block[ +red fruit +] -#definition[orange][orange fruit] +/ orange: #block[ +orange fruit +] -#definition[banana][yellow fruit] +/ banana: #block[ +yellow fruit +] Tight using tabs: -#definition[apple][red fruit] +/ apple: #block[ +red fruit +] -#definition[orange][orange fruit] +/ orange: #block[ +orange fruit +] -#definition[banana][yellow fruit] +/ banana: #block[ +yellow fruit +] Loose: -#definition[apple][red fruit - +/ apple: #block[ +red fruit ] -#definition[orange][orange fruit - +/ orange: #block[ +orange fruit ] -#definition[banana][yellow fruit - +/ banana: #block[ +yellow fruit ] Multiple blocks with italics: -#definition[#emph[apple]][red fruit +/ #emph[apple]: #block[ +red fruit contains seeds, crisp, pleasant to taste - ] -#definition[#emph[orange]][orange fruit +/ #emph[orange]: #block[ +orange fruit ``` { orange code block } @@ -433,42 +450,47 @@ contains seeds, crisp, pleasant to taste #blockquote[ orange block quote ] - ] Multiple definitions, tight: -#definition[apple][red fruit][computer] +/ apple: #block[ +red fruit +computer +] -#definition[orange][orange fruit][bank] +/ orange: #block[ +orange fruit +bank +] Multiple definitions, loose: -#definition[apple][red fruit - -][computer +/ apple: #block[ +red fruit +computer ] -#definition[orange][orange fruit - -][bank +/ orange: #block[ +orange fruit +bank ] Blank line after term, indented marker, alternate markers: -#definition[apple][red fruit - -][computer +/ apple: #block[ +red fruit +computer ] -#definition[orange][orange fruit +/ orange: #block[ +orange fruit + sublist + sublist - ] = HTML Blocks |
