Skip to content

Commit

Permalink
typst fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wjschne committed May 3, 2024
1 parent 28e9f13 commit b49a553
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 29 deletions.
5 changes: 5 additions & 0 deletions _extensions/apaquarto/typst/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ set table(
lang: lang
)

show link: set text(blue)

show quote: set pad(x: 0.5in)
show quote: set par(leading: leading)
show quote: set block(spacing: spacing, above: spacing, below: spacing)
// show LaTeX
show "TeX": TeX
show "LaTeX": LaTeX
Expand Down
8 changes: 8 additions & 0 deletions bibliography.bib
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@book{brownHowKilledPluto2012,
address = {New York},
title = {How {I} killed {Pluto} and why it had it coming},
publisher = {Spiegel \& Grau},
author = {Brown, Mike},
year = {2012},
}

@book{CameronTrivedi2013,
author = {A. Colin Cameron and Pravin K. Trivedi},
title = {Regression Analysis of Count Data},
Expand Down
5 changes: 4 additions & 1 deletion changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ engine: knitr
* Full language option support



# Version 4.0.1 (2024-05-01)

- Improvemements for typst
* Render LaTeX logo correctly
* Implemented NoIndent feature for typst
* Proper indenting for multi-paragraph abstracts
* Fixed numbering of tables in appendices
- Fixed bug that reversed floatsintext to the opposite of expectations.
* Block quote indenting corrected
* Color links blue
- Fixed bug that reversed `floatsintext` to the opposite of expectations.
- On the remote chance that anyone needs more than 26 appendices, subsequent appendices are AA, AB, AC, ..., BA, BB, BC, ... AAA, AAB, ...

# Version 4.0.0 (2024-05-01)
Expand Down
4 changes: 3 additions & 1 deletion docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ <h1>Version 4.0.1 (2024-05-01)</h1>
<li>Implemented NoIndent feature for typst</li>
<li>Proper indenting for multi-paragraph abstracts</li>
<li>Fixed numbering of tables in appendices</li>
<li>Block quote indenting corrected</li>
<li>Color links blue</li>
</ul></li>
<li>Fixed bug that reversed floatsintext to the opposite of expectations.</li>
<li>Fixed bug that reversed <code>floatsintext</code> to the opposite of expectations.</li>
<li>On the remote chance that anyone needs more than 26 appendices, subsequent appendices are AA, AB, AC, …, BA, BB, BC, … AAA, AAB, …</li>
</ul>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ <h4 class="anchored" data-anchor-id="an-existing-file">An existing file</h4>
});
</script>
</div> <!-- /content -->
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","closeEffect":"zoom","openEffect":"zoom","loop":false,"descPosition":"bottom"});
<script>var lightboxQuarto = GLightbox({"descPosition":"bottom","closeEffect":"zoom","openEffect":"zoom","selector":".lightbox","loop":false});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
2 changes: 1 addition & 1 deletion docs/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ <h1>Options for .pdf</h1>
</section>
<section id="options-for-.html" class="level1">
<h1>Options for .html</h1>
<p>Everything that works for .docx should work for .html.</p>
<p>With one exeception, everything that works for .docx should work for .html. For .html, there is no benefit to having line numbers in the text because the text wrapping differs depending on the device and size of the window the document is being viewed.</p>
</section>
<section id="language-options" class="level1">
<h1>Language Options</h1>
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"href": "writing.html#block-quotes-and-suppressing-indentation",
"title": "APA Style via Markdown",
"section": "Block Quotes and Suppressing Indentation",
"text": "Block Quotes and Suppressing Indentation\nSometimes you want to give a longer quote that needs to go in its own paragraph. Block quotes are on their own line starting with the &gt; character. For example, Jane Austen’s (1814/1990) Mansfield Park has some memorable insights about the mind:\n\n&gt; If any one faculty of our nature may be called more wonderful than the rest, I do think it is memory. There seems something more speakingly incomprehensible in the powers, the failures, the inequalities of memory, than in any other of our intelligences. The memory is sometimes so retentive, so serviceable, so obedient; at others, so bewildered and so weak; and at others again, so tyrannic, so beyond control! We are, to be sure, a miracle every way; but our powers of recollecting and of forgetting do seem peculiarly past finding out. (p. 163)\n\nIf the quote spans multiple paragraphs, put a &gt; on its own line between them like so:\n&gt; First paragraph of the quote\n&gt; \n&gt; Second paragraph of the quote\nIf the text after a quote is a new paragraph, you can create it in the usual fashion (i.e., plain text with an empty line between the block text and the new paragraph). However, if the text after a quote is part of the same paragraph, you can suppress the indentation by creating a div with the .NoIndent class. As an example:\nInitial paragraph\n\n&gt; Block quote paragraph\n\n:::{.NoIndent}\nBecause this sentence continues the intial paragraph, \nthe indentation is suppresed.\n:::"
"text": "Block Quotes and Suppressing Indentation\nSometimes you want to give a longer quote that needs to go in its own paragraph. Block quotes are on their own line starting with the &gt; character. For example, Jane Austen’s (1814/1990) Mansfield Park has some memorable insights about the mind:\n\n&gt; If any one faculty of our nature may be called more wonderful than the rest, I do think it is memory. There seems something more speakingly incomprehensible in the powers, the failures, the inequalities of memory, than in any other of our intelligences. The memory is sometimes so retentive, so serviceable, so obedient; at others, so bewildered and so weak; and at others again, so tyrannic, so beyond control! We are, to be sure, a miracle every way; but our powers of recollecting and of forgetting do seem peculiarly past finding out. (p. 163)\n\nIf your quote has multiple paragraphs, like this passage from Brown (2012), separate them with a lone &gt; character between the lines:\n\n\n&gt; In the entire field of astronomy, there is no word other than planet that has a precise, lawyerly definition, in which certain criteria are specifically enumerated. Why does planet have such a definition but star, galaxy, and giant molecular cloud do not? Because in astronomy, as in most sciences, scientists work by concepts rather than by definitions. The concept of a star is clear; a star is a collection of gas with fusion reactions in the interior giving off energy. A galaxy is a large, bound collection of stars. A giant molecular cloud is a giant cloud of molecules. The concept of a planet—in the eight-planet solar system—is equally simple to state. A planet is a one of a small number of bodies that dominate a planetary system. That is a concept, not a definition. How would you write that down in a precise definition?\n&gt;\n&gt; I wouldn’t. Once you write down a definition with lawyerly precision, you get the lawyers involved in deciding whether or not your objects are planets. Astronomers work in concepts. We rarely call in the attorneys for adjudication. (p. 242)\nIf the text after a quote is a new paragraph, you can create it in the usual fashion (i.e., plain text with an empty line between the block text and the new paragraph). However, if the text after a quote is part of the same paragraph, you can suppress the indentation by creating a div with the .NoIndent class. As an example:\nInitial paragraph\n\n&gt; Block quote paragraph\n\n:::{.NoIndent}\nBecause this sentence continues the intial paragraph, \nthe indentation is suppresed.\n:::"
},
{
"objectID": "writing.html#figures-in-code-chunks",
Expand Down
17 changes: 11 additions & 6 deletions docs/writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,12 @@ <h2 data-anchor-id="block-quotes-and-suppressing-indentation">Block Quotes and S
<div id="austin">
<div class="sourceCode" id="cb6"><pre class="sourceCode default code-with-copy"><code class="sourceCode default"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>&gt; If any one faculty of our nature may be called more wonderful than the rest, I do think it is memory. There seems something more speakingly incomprehensible in the powers, the failures, the inequalities of memory, than in any other of our intelligences. The memory is sometimes so retentive, so serviceable, so obedient; at others, so bewildered and so weak; and at others again, so tyrannic, so beyond control! We are, to be sure, a miracle every way; but our powers of recollecting and of forgetting do seem peculiarly past finding out. (p. 163)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>If the quote spans multiple paragraphs, put a <code>&gt;</code> on its own line between them like so:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode md code-with-copy"><code class="sourceCode markdown"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="at">&gt; First paragraph of the quote</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="at">&gt; </span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="at">&gt; Second paragraph of the quote</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>If your quote has multiple paragraphs, like this passage from Brown (<a href="#ref-brownHowKilledPluto2012">2012</a>), separate them with a lone <code>&gt;</code> character between the lines:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode md code-with-copy"><code class="sourceCode markdown"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="at">&gt; In the entire field of astronomy, there is no word other than planet that has a precise, lawyerly definition, in which certain criteria are specifically enumerated. Why does planet have such a definition but star, galaxy, and giant molecular cloud do not? Because in astronomy, as in most sciences, scientists work by concepts rather than by definitions. The concept of a star is clear; a star is a collection of gas with fusion reactions in the interior giving off energy. A galaxy is a large, bound collection of stars. A giant molecular cloud is a giant cloud of molecules. The concept of a planet—in the eight-planet solar system—is equally simple to state. A planet is a one of a small number of bodies that dominate a planetary system. That is a concept, not a definition. How would you write that down in a precise definition?</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="at">&gt;</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="at">&gt; I wouldn’t. Once you write down a definition with lawyerly precision, you get the lawyers involved in deciding whether or not your objects are planets. Astronomers work in concepts. We rarely call in the attorneys for adjudication. (p. 242)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>If the text after a quote is a new paragraph, you can create it in the usual fashion (i.e., plain text with an empty line between the block text and the new paragraph). However, if the text after a quote is part of the same paragraph, you can suppress the indentation by creating a div with the .NoIndent class. As an example:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode md code-with-copy"><code class="sourceCode markdown"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>Initial paragraph</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -749,7 +751,7 @@ <h1>Tables in Code Chunks</h1>
</figcaption>
<div aria-describedby="tbl-mytable-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output-display">
<div class="tabwid tabwid_left"><style>.cl-7706d276{}.cl-76fd8428{font-family:'Times New Roman';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-7701c060{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-7701d870{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0.75pt solid rgba(0, 0, 0, 1.00);border-top: 0.75pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7701d871{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-7701d87a{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0.75pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table data-quarto-disable-processing="true" class="cl-7706d276"><thead><tr style="overflow-wrap:break-word;"><th class="cl-7701d870"><p class="cl-7701c060"><span class="cl-76fd8428">Letters</span></p></th><th class="cl-7701d870"><p class="cl-7701c060"><span class="cl-76fd8428">Numbers</span></p></th></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-7701d871"><p class="cl-7701c060"><span class="cl-76fd8428">A</span></p></td><td class="cl-7701d871"><p class="cl-7701c060"><span class="cl-76fd8428">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-7701d871"><p class="cl-7701c060"><span class="cl-76fd8428">B</span></p></td><td class="cl-7701d871"><p class="cl-7701c060"><span class="cl-76fd8428">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-7701d87a"><p class="cl-7701c060"><span class="cl-76fd8428">C</span></p></td><td class="cl-7701d87a"><p class="cl-7701c060"><span class="cl-76fd8428">3</span></p></td></tr></tbody></table></div>
<div class="tabwid tabwid_left"><style>.cl-23129ca2{}.cl-2309dc02{font-family:'Times New Roman';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(0, 0, 0, 1.00);background-color:transparent;}.cl-230d4da6{margin:0;text-align:center;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 2;background-color:transparent;}.cl-230d66ba{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0.75pt solid rgba(0, 0, 0, 1.00);border-top: 0.75pt solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-230d66c4{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-230d66c5{width:0.75in;background-color:transparent;vertical-align: middle;border-bottom: 0.75pt solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table data-quarto-disable-processing="true" class="cl-23129ca2"><thead><tr style="overflow-wrap:break-word;"><th class="cl-230d66ba"><p class="cl-230d4da6"><span class="cl-2309dc02">Letters</span></p></th><th class="cl-230d66ba"><p class="cl-230d4da6"><span class="cl-2309dc02">Numbers</span></p></th></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-230d66c4"><p class="cl-230d4da6"><span class="cl-2309dc02">A</span></p></td><td class="cl-230d66c4"><p class="cl-230d4da6"><span class="cl-2309dc02">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-230d66c4"><p class="cl-230d4da6"><span class="cl-2309dc02">B</span></p></td><td class="cl-230d66c4"><p class="cl-230d4da6"><span class="cl-2309dc02">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-230d66c5"><p class="cl-230d4da6"><span class="cl-2309dc02">C</span></p></td><td class="cl-230d66c5"><p class="cl-230d4da6"><span class="cl-2309dc02">3</span></p></td></tr></tbody></table></div>
</div>
</div>
</figure>
Expand Down Expand Up @@ -966,6 +968,9 @@ <h1>Appendices</h1>
<div id="ref-austenMansfieldPark1990" class="csl-entry" role="listitem">
Austen, J. (1990). <em>Mansfield <span>P</span>ark</em>. Oxford University Press. (Original work published 1814)
</div>
<div id="ref-brownHowKilledPluto2012" class="csl-entry" role="listitem">
Brown, M. (2012). <em>How <span>I</span> killed <span>Pluto</span> and why it had it coming</em>. Spiegel &amp; Grau.
</div>
<div id="ref-CameronTrivedi2013" class="csl-entry" role="listitem">
Cameron, A. C., &amp; Trivedi, P. K. (2013). <em>Regression analysis of count data</em> (2nd ed.). Cambridge University Press. <a href="https://doi.org/10.1017/CBO9781139013567">https://doi.org/10.1017/CBO9781139013567</a>
</div>
Expand Down Expand Up @@ -1387,7 +1392,7 @@ <h1>Appendices</h1>
});
</script>
</div> <!-- /content -->
<script>var lightboxQuarto = GLightbox({"closeEffect":"zoom","loop":false,"descPosition":"bottom","selector":".lightbox","openEffect":"zoom"});
<script>var lightboxQuarto = GLightbox({"loop":false,"openEffect":"zoom","closeEffect":"zoom","descPosition":"bottom","selector":".lightbox"});
window.onload = () => {
lightboxQuarto.on('slide_before_load', (data) => {
const { slideIndex, slideNode, slideConfig, player, trigger } = data;
Expand Down
Loading

0 comments on commit b49a553

Please sign in to comment.