Skip to content

Commit

Permalink
possessive citations
Browse files Browse the repository at this point in the history
  • Loading branch information
wjschne committed Mar 6, 2024
1 parent 6e00013 commit f7ab1bf
Show file tree
Hide file tree
Showing 12 changed files with 503 additions and 96 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
- Tables in .pdf jou mode should fit automatically.
- Typst version that would allow for easy customization

# Version 3.4.1 (2024-03-05)

- Added “possessive” citations such that `@schneider2024 ['s]` will
render as “Schneider’s (2024)”

# Version 3.4.0 (2024-03-04)

- Implemented [language
Expand Down
4 changes: 4 additions & 0 deletions NEWS.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ engine: knitr
- Tables in .pdf jou mode should fit automatically.
- Typst version that would allow for easy customization


# Version 3.4.1 (2024-03-05)
- Added "possessive" citations such that `@schneider2024 ['s]` will render as "Schneider's (2024)"

# Version 3.4.0 (2024-03-04)

- Implemented [language options](https://wjschne.github.io/apaquarto/options.html#language-options) for internationalization and customization.
Expand Down
23 changes: 22 additions & 1 deletion _extensions/wjschne/apaquarto/apaandcite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,30 @@ local function replace_and(elem)
Str = function(el)
return pandoc.Str(string.gsub(el.text, "&", andreplacement))
end})
if elem.citations[1].suffix and #elem.citations[1].suffix > 0 then

if elem.citations[1].suffix[1].text == "’s" or elem.citations[1].suffix[1].text == "'s" then

if elem.content.content then
local intLeftParen = 0
for i, j in pairs(elem.content.content) do
if j.tag == "Str" and string.find(j.text, "’s") then
j.text = string.gsub(j.text, "’s", "")
end
if j.tag == "Str" and string.find(j.text, "%(") then
intLeftParen = i
end
end
if intLeftParen > 2 then
elem.content.content[intLeftParen - 2].text = elem.content.content[intLeftParen - 2].text .. "’s"
end
end
end
end
--print(elem.content)
return elem.content
end
return pandoc.Cite(elem.content, elem.citations)
--return pandoc.Cite(elem.content, elem.citations)
end

return {
Expand Down
4 changes: 2 additions & 2 deletions _extensions/wjschne/apaquarto/apafloatstoend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pandoc = function(doc)
local fig = {}
for i = #doc.blocks, 1, -1 do

if doc.blocks[i].t == "Div" then

if doc.blocks[i].identifier then
if doc.blocks[i].identifier:find("^tbl%-") then
if FORMAT == "docx" then
Expand Down Expand Up @@ -47,7 +47,7 @@ Pandoc = function(doc)
end

end
end

end

if #tbl > 0 then
Expand Down
Binary file added docs/img/sampleimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h2 id="toc-title">On this page</h2>

<ul>
<li><a href="#install-quarto" id="toc-install-quarto" class="nav-link active" data-scroll-target="#install-quarto">Install Quarto</a></li>
<li><a href="#select-your-environment-for-using-quarto" id="toc-select-your-environment-for-using-quarto" class="nav-link" data-scroll-target="#select-your-environment-for-using-quarto">Select your environment for using Quarto</a></li>
<li><a href="#select-your-language-and-programming-environment-for-using-quarto" id="toc-select-your-language-and-programming-environment-for-using-quarto" class="nav-link" data-scroll-target="#select-your-language-and-programming-environment-for-using-quarto">Select your language and programming environment for using Quarto</a></li>
<li><a href="#install-apaquarto" id="toc-install-apaquarto" class="nav-link" data-scroll-target="#install-apaquarto">Install apaquarto</a>
<ul class="collapse">
<li><a href="#creating-a-new-project-with-apaquarto" id="toc-creating-a-new-project-with-apaquarto" class="nav-link" data-scroll-target="#creating-a-new-project-with-apaquarto">Creating a new project with apaquarto</a></li>
Expand Down Expand Up @@ -202,7 +202,8 @@ <h1 class="title">Installation</h1>
<p>Installing apaquarto is not hard, but it takes a bit more effort than installing a standalone program. There are four main steps:</p>
<ol type="1">
<li>Install Quarto</li>
<li>Install a programming environment (e.g., RStudio, VS Code, Jupyter) along with a programming language (e.g., R, Python, Julia).</li>
<li>Install a programming langauge (e.g., R, Python, Julia)</li>
<li>Install a programming environment (e.g., RStudio, VS Code, Jupyter)</li>
<li>Install apaquarto</li>
</ol>
<section id="install-quarto" class="level2 page-columns page-full">
Expand All @@ -222,8 +223,8 @@ <h2 class="anchored" data-anchor-id="install-quarto">Install Quarto</h2>
<p>The stable version of Quarto has everything apaquarto needs. However, if you are feeling bold and zesty, you can get the latest-but-not-fully-vetted features of Quarto via the <a href="https://quarto.org/docs/download/prerelease.html">pre-release builds</a>. This is what I use, and I update Quarto frequently. If it does not behave as expected, you can always revert back to the stable version.</p>
</div>
</div></div></section>
<section id="select-your-environment-for-using-quarto" class="level2">
<h2 class="anchored" data-anchor-id="select-your-environment-for-using-quarto">Select your environment for using Quarto</h2>
<section id="select-your-language-and-programming-environment-for-using-quarto" class="level2">
<h2 class="anchored" data-anchor-id="select-your-language-and-programming-environment-for-using-quarto">Select your language and programming environment for using Quarto</h2>
<p>At the <a href="https://quarto.org/docs/get-started/">same link for installing Quarto</a>, there are links for selecting an environment for using Quarto.</p>
<p><a href="https://posit.co/download/rstudio-desktop/">RStudio</a> will probably give the smoothest experience to anyone new to data analysis. It is made by Posit, the same company that makes Quarto. If you are an R user, you will probably want to select <a href="https://posit.co/download/rstudio-desktop/">RStudio</a>. Using the links there, 1) install R for your operation system (Windows, Mac, or Linux) and 2) install RStudio Desktop.</p>
<p>If you use Python, Julia, or Observable as your primary tool for analyzing data, you can use RStudio, but using other tools you already know might be more comfortable (e.g., VS Code, Jupyter, NeoVim, or any other text editor). Some R users really like VS Code. Everyone has options—Quarto won’t box you in.</p>
Expand Down
Loading

0 comments on commit f7ab1bf

Please sign in to comment.