<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>zotero &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/zotero/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Fri, 24 Apr 2026 07:35:12 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>zotero &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Using Pandoc to format a Dissertation from Markdown to HTML, PDF, and ePub]]></title>
		<link>https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/</link>
					<comments>https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 24 Apr 2023 11:34:20 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[pandoc]]></category>
		<category><![CDATA[zotero]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45592</guid>

					<description><![CDATA[Metawork is so much more fun than real work. Sharpening your pencils. Colour coordinating your filing system. Creating Gantt charts of what you intend to do. Marvellous!  In that spirit, here&#039;s how I used the venerable pandoc to convert my MSc dissertation from .md into a variety of more readable formats.  Prep  I&#039;ve no idea what you already have installed on your system but, at a minimum, you…]]></description>
										<content:encoded><![CDATA[<p>Metawork is <em>so</em> much more fun than real work. Sharpening your pencils. Colour coordinating your filing system. Creating Gantt charts of what you <em>intend</em> to do. Marvellous!</p>

<p>In that spirit, here's how I used the venerable <code>pandoc</code> to convert <a href="https://shkspr.mobi/blog/2023/04/msc-dissertation-exploring-the-visualisation-of-hierarchical-cybersecurity-data-within-the-metaverse/">my MSc dissertation</a> from .md into a variety of more readable formats.</p>

<h2 id="prep"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#prep">Prep</a></h2>

<p>I've no idea what you already have installed on your system but, at a minimum, you need to <a href="https://pandoc.org/installing.html">install the latest version of pandoc</a> and you'll need a modern version of the <a href="https://pypi.org/project/weasyprint/">weasyprint library</a>.</p>

<p>I found pandoc's dependencies... interesting. Depending on your operating system, you may find yourself having to install all sorts of esoteric libraries.</p>

<h2 id="commands"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#commands">Commands</a></h2>

<p>This is what you'll need to run to generate the outputs. I'll show you the commands, then what you need in each file.</p>

<h3 id="html"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#html">HTML:</a></h3>

<pre><code class="language-bash">pandoc dissertation.md \
   --citeproc --metadata-file=metadata.yml --embed-resources --standalone \
    -o ../output/dissertation.html
</code></pre>

<h3 id="epub"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#epub">ePub:</a></h3>

<pre><code class="language-bash">pandoc dissertation.md \
   --citeproc --metadata-file=metadata.yml --epub-embed-font=fonts/font.ttf \
   -o ../output/dissertation.epub
</code></pre>

<h3 id="pdf"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#pdf">PDF:</a></h3>

<pre><code class="language-bash">pandoc dissertation.md \
   --citeproc --metadata-file=metadata.yml --pdf-engine=weasyprint \
   -o ../output/dissertation.pdf
</code></pre>

<h2 id="metadata"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#metadata">Metadata</a></h2>

<p>You'll need a metadata file called <code>metadata.yml</code>. It <em>must</em> start and finish with <code>---</code></p>

<pre><code class="language-yaml">---
lang: en-GB
title: My awesome dissertation
bibliography: Bibliography.bib
csl: harvard-cite-them-right.csl
link-citations: true
reference-section-title: References
author: Terence Eden
creator: Terence Eden
rights:  🄯 CC BY-NC 4.0
keywords: [Some, comma, separated, keywords]
date: 2023-04-24
description: A dissertation about stuff
css: style.css
cover-image: media/cover.jpg
---
</code></pre>

<p>Hopefully all those entries are self-explanatory. Now let's go into each <em>extra</em> file that this requires!</p>

<h2 id="bibliography"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#bibliography">Bibliography</a></h2>

<p>I assume that you're using Zotero or some other citation manager. Export all your citations using in Better BibTex format as Bibliography.bib.</p>

<p>You may need to <a href="https://github.com/retorquere/zotero-better-bibtex/releases">install a Better BibTex plugin</a>.</p>

<h2 id="citation-style-language-csl"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#citation-style-language-csl">Citation Style Language - CSL</a></h2>

<p>Your citation manager probably already has your preferred <a href="https://citationstyles.org/">CSL format</a>. If not, you can <a href="https://www.zotero.org/styles?q=harvard">download the .csl file from Zotero</a> or from the <a href="https://github.com/citation-style-language/styles">CSL GitHub</a>.</p>

<h2 id="layout-css"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#layout-css">Layout CSS</a></h2>

<p>The layout for HTML, ePub, and PDF is all controlled by CSS. Here's a minimum viable stylesheet. It's designed for A4 paper as well as screens. Figures and tables stay on their own printed page. Sections also get a page-break.</p>

<p>I've commented any interesting bits. Feel free to add to it for your own use:</p>

<pre><code class="language-css">@page {
    /* Set paper options */
    size: A4;
    margin: 1cm;
}

@media print {
    /* Stop figures &amp; tables from being broken */
    figure, table {
      break-inside: avoid-page;
    }

    /*  Put each section on a new page*/
    h2 {
        break-before: always;
    }
}

@media screen {
    body {
        max-width: 45em;
        margin-left: auto;
        margin-right: auto;
    }
}

@font-face {
    font-family: "My-Font";
    /* WOFF2 for web, TTF for ePub */
    src:
        url("fonts/font.ttf"),
        url("fonts/font.woff2") format("woff2");
}

html {
    font-size: 1em;
}

body {
    text-align: justify;
    font-family: "My-Font", sans-serif;
}

a {
    color: #001aff; 
}

img {
    max-width: 100%;
    margin: auto;
    display: block;
}

/* Make references spaced out better */
#refs &gt; div {
    padding-bottom: 1em;
}

figure {
    border: 1px solid gray;
    max-width: fit-content;
}

figcaption {
    font-size: .9em;
    color: rgb(24, 24, 24);
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9em;
}
td {
    padding: .5em;
    border: 1px solid black;
    text-align: left;
}

h2 {
    text-align: left;
}

p {
    margin:.5em;
}
</code></pre>

<h2 id="fonts"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#fonts">Fonts</a></h2>

<p>If you want a custom font, you'll need it in TTF <em>and</em> WOFF2 format. Not all eReaders can use WOFF2, so TTF is needed as a fallback. I recommend using <a href="https://www.fontsquirrel.com/tools/webfont-generator">FontSquirrel to generate the font formats</a>.</p>

<h2 id="markdown"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#markdown">Markdown</a></h2>

<p>OK, now here we go!  You can use a mix of Markdown and HTML.</p>

<p>A few points that may not be obvious:</p>

<ul>
<li>No need for a <code>#</code> top level heading. Pandoc will insert one for you.</li>
<li>No need for a table of contents. Again, let Pandoc doc it.</li>
<li>You <em>will</em> need to manually add lists for figures, acronyms, tables, glossary, etc.</li>
<li>I like to use internal links in Markdown. For example</li>
</ul>

<pre><code class="language-markdown">## 1. Introduction {#1-introduction}

### 1.1 Context {#1-1-context}
</code></pre>

<ul>
<li>That lets you write <code>as can be seen [in Methodology](#2-Methodology)</code></li>
<li>Speaking of which, I couldn't find a good way to do figures and captions in Markdown, so I reverted to HTML:</li>
</ul>

<pre><code class="language-html">&lt;figure id="figure-01"&gt;
   &lt;figcaption&gt;Figure 01 - A fictional depiction of 3D visualisations of Cybersecurity interfaces&lt;/figcaption&gt;
   &lt;img src="media/jurassic.jpg" width="" alt="Screenshots from the movie Jurassic Park. A young woman looks at a 3D display on a monitor. She exclaims It's a UNIX System. I know this."&gt;
   &lt;figcaption&gt;[@spielbergJurassicPark1993]&lt;/figcaption&gt;
&lt;/figure&gt;
</code></pre>

<ul>
<li>Notice the way citations are done there? I, again, <a href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/">use Zotero and a VS Code plugin to insert citations</a>. Don't attempt to do them by hand!</li>
<li>No need to add your own list of references. Pandoc will add them where it sees:</li>
</ul>

<pre><code class="language-html">&lt;div id="refs"&gt;
## References
&lt;/div&gt;
</code></pre>

<p>So, a sample document will look something like:</p>

<pre><code class="language-markdown">## 1. Introduction {#1-introduction}

### 1.1 Context {#1-1-context}
Blah blah blah

![Alt text.](media/photo.jpg)

Or

&lt;figure id="figure-01"&gt;
   &lt;figcaption&gt;Figure 01&lt;/figcaption&gt;
   &lt;img src="media/example.jpg" width="" alt="Description."&gt;
   &lt;figcaption&gt;[@spielbergJurassicPark1993]&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;div id="refs"&gt;
## References
&lt;/div&gt;

## Appendix
* Some
* Bullets
</code></pre>

<h2 id="is-it-worth-it"><a href="https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/#is-it-worth-it">Is it worth it?</a></h2>

<p>Well, now, there's the question! You can just export these formats from Google Docs, Office 365, etc. But this method gives you much more control over what the end-product looks like.</p>

<p>Isn't yak-shaving fun⸮</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45592&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/04/using-pandoc-to-format-a-dissertation-from-markdown-to-html-pdf-and-epub/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Zotero citations in Markdown - publishing to ePub or PDF]]></title>
		<link>https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/</link>
					<comments>https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 23 Nov 2022 12:34:22 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[citation]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[zotero]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=43835</guid>

					<description><![CDATA[Mostly notes to myself - I hope you find them useful.  So, you want to write your dissertation or thesis in Markdown. But how do you manage all your citations?   Install Zotero Install the Better BibTex plugin Restart Zotero. The BBT plugin will launch a configuration screen - use it to set your preferences Install VS Code (or VS Codium) Install the VS Code Zotero plugin   Now, when you want to…]]></description>
										<content:encoded><![CDATA[<p>Mostly notes to myself - I hope you find them useful.</p>

<p>So, you want to write your dissertation or thesis in Markdown. But how do you manage all your citations?</p>

<ol>
<li>Install <a href="https://www.zotero.org/">Zotero</a></li>
<li>Install the <a href="https://retorque.re/zotero-better-bibtex/">Better BibTex plugin</a></li>
<li>Restart Zotero. The BBT plugin will launch a configuration screen - use it to set your preferences</li>
<li>Install <a href="https://code.visualstudio.com/">VS Code</a> (or <a href="https://github.com/VSCodium/vscodium">VS Codium</a>)</li>
<li>Install the <a href="https://github.com/mblode/vscode-zotero">VS Code Zotero plugin</a></li>
</ol>

<p>Now, when you want to enter a citation in Markdown, the combined plugins will generate something like this:</p>

<pre><code class="language-markdown">## Abstract

Space is really big @adamsHitchhiker1979
</code></pre>

<p>That <code>@adamsHitchhiker1979</code> is the citation.</p>

<h2 id="formatting-citations"><a href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#formatting-citations">Formatting citations</a></h2>

<p>You want to export your Markdown to something like ePub or PDF with nicely formatted citations like <code>(Adams, 1979)</code></p>

<p>Use Pandoc!</p>

<ol>
<li>Install <a href="https://pandoc.org/">Pandoc</a></li>
<li>In Zotero, use File → Export Library. Export in Better BibTex format as <code>test.bib</code>.</li>
</ol>

<p>Add the following configuration section to the top of your Markdown file:</p>

<pre><code class="language-markdown">---
bibliography: test.bib
...
</code></pre>

<p>Run the following command:</p>

<p><code>pandoc --citeproc test.md -o test.epub</code></p>

<p>Hey presto! You now have a nicely formatted ePub with all the citations in your preferred format, and the bibliography at the end.</p>

<h2 id="format-the-citations-better"><a href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#format-the-citations-better">Format the citations better</a></h2>

<p>The citations don't look the way I want them to!</p>

<ol>
<li>Download your preferred <a href="https://www.zotero.org/styles">Citation Style from Zotero</a>, save it as <code>whatever.csl</code></li>
<li>Add the following into your Markdown file's configuration section <code>csl: whatever.csl</code></li>
<li><strong>Important</strong> Make sure that your citations are wrapped in <code>[</code> and <code>]</code> otherwise Pandoc will mess things up. See <a href="https://pandoc.org/MANUAL.html#extension-citations">the Pandoc Citations Extension</a> for more details.</li>
</ol>

<p>Your Markdown should look something like this:</p>

<pre><code class="language-markdown">---
bibliography: test.bib
csl: whatever.csl
link-citations: true
...

# Intro

Computers are complicated [@verletComputerExperimentsClassical1967].
</code></pre>

<p>Then run <code>pandoc --citeproc test.md -o test.epub</code> - you can change the file type to html, pdf, or anything else your system supports.</p>

<h2 id="make-it-look-even-nicer"><a href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#make-it-look-even-nicer">Make it look even nicer</a></h2>

<p>This is the boilerplate that I use.</p>

<pre><code class="language-markdown">---
bibliography: test.bib
csl: whatever.csl
link-citations: true
reference-section-title: References
title: My brilliant title
...

# Intro

Computers are complicated [@verletComputerExperimentsClassical1967].

## Something

More info [@smithEvolutionInnovationCapability2017]

&lt;div id="refs"&gt;
## References
&lt;/div&gt;

## The End
Goodbye!
</code></pre>

<p>That gives you a title, ensures that all in-text citations link down to the references, and <a href="https://pandoc.org/MANUAL.html#placement-of-the-bibliography">puts the references somewhere other than the end</a>.  Here's the HTML it produces using <code>pandoc --citeproc test.md -o bib.html</code> :</p>

<pre><code class="language-html">&lt;h1 id="intro"&gt;Intro&lt;/h1&gt;
&lt;p&gt;Computers are complicated &lt;span class="citation" data-cites="verletComputerExperimentsClassical1967"&gt;(&lt;a
         href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#ref-verletComputerExperimentsClassical1967" role="doc-biblioref"&gt;Verlet, 1967&lt;/a&gt;)&lt;/span&gt;.&lt;/p&gt;
&lt;h2 id="something"&gt;Something&lt;/h2&gt;
&lt;p&gt;More info &lt;span class="citation" data-cites="smithEvolutionInnovationCapability2017"&gt;(&lt;a
         href="https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/#ref-smithEvolutionInnovationCapability2017" role="doc-biblioref"&gt;Smith &lt;em&gt;et al.&lt;/em&gt;, 2017&lt;/a&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;div id="refs" class="references csl-bib-body" role="doc-bibliography"&gt;
   &lt;h2 id="references"&gt;References&lt;/h2&gt;
   &lt;div id="ref-smithEvolutionInnovationCapability2017" class="csl-entry" role="doc-biblioentry"&gt;
      Smith, C. &lt;em&gt;et al.&lt;/em&gt; (2017) &lt;span&gt;‘The &lt;span&gt;Evolution&lt;/span&gt; of an
         &lt;span&gt;Innovation Capability&lt;/span&gt;’&lt;/span&gt;, &lt;em&gt;Research-Technology
         Management&lt;/em&gt;, 60(2), pp. 26–35. Available at: &lt;a
         href="https://doi.org/10.1080/08956308.2017.1276388"&gt;https://doi.org/10.1080/08956308.2017.1276388&lt;/a&gt;.
   &lt;/div&gt;
   &lt;div id="ref-verletComputerExperimentsClassical1967" class="csl-entry" role="doc-biblioentry"&gt;
      Verlet, L. (1967) &lt;span&gt;‘Computer "&lt;span&gt;Experiments&lt;/span&gt;" on
         &lt;span&gt;Classical Fluids&lt;/span&gt;. &lt;span&gt;I&lt;/span&gt;. &lt;span&gt;Thermodynamical
            Properties&lt;/span&gt; of &lt;span&gt;Lennard-Jones Molecules&lt;/span&gt;’&lt;/span&gt;,
      &lt;em&gt;Physical Review&lt;/em&gt;, 159(1), pp. 98–103. Available at: &lt;a
         href="https://doi.org/10.1103/PhysRev.159.98"&gt;https://doi.org/10.1103/PhysRev.159.98&lt;/a&gt;.
   &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="the-end"&gt;The End&lt;/h2&gt;
&lt;p&gt;Goodbye!&lt;/p&gt;
</code></pre>

<p>If that was useful to you - or if you think you know a better way - please drop a comment in the box.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=43835&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/11/zotero-citations-in-markdown-publishing-to-epub-or-pdf/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Zotero Citations to Markdown Links via CSL]]></title>
		<link>https://shkspr.mobi/blog/2021/05/zotero-citations-to-markdown-via-csl/</link>
					<comments>https://shkspr.mobi/blog/2021/05/zotero-citations-to-markdown-via-csl/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 17 May 2021 11:13:12 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[citation]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[zotero]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38943</guid>

					<description><![CDATA[I use Zotero to manage my references. Instead of in-text citations of (Smith, 1984) - I want that to be hyperlinked to the academic paper referenced.  For example ([Smith, 1984](https://doi.org/.....))  This is possible, if you&#039;re willing to hack around with CSL - the Citation Style Language.  Here&#039;s a fragment of CSL that I&#039;ve adapted from Brenton M. Wiernik&#039;s zotero-tools/apa-doi-in-text.csl    …]]></description>
										<content:encoded><![CDATA[<p>I use Zotero to manage my references. Instead of in-text citations of <code>(Smith, 1984)</code> - I want that to be hyperlinked to the academic paper referenced.</p>

<p>For example <code>([Smith, 1984](https://doi.org/.....))</code></p>

<p>This is possible, if you're willing to hack around with <a href="https://docs.citationstyles.org/en/stable/specification.html">CSL - the Citation Style Language</a>.</p>

<p>Here's a fragment of CSL that I've adapted from <a href="https://github.com/bwiernik/zotero-tools/blob/master/apa-doi-in-text.csl">Brenton M. Wiernik's zotero-tools/apa-doi-in-text.csl</a></p>

<pre><code class="language-xml">  &lt;macro name="url-intext"&gt;
    &lt;choose&gt;
      &lt;if variable="DOI"&gt;
        &lt;text variable="DOI" prefix="https://doi.org/"/&gt;
      &lt;/if&gt;
      &lt;else-if variable="URL"&gt;
        &lt;text variable="URL"/&gt;
      &lt;/else-if&gt;
      &lt;else&gt;
        &lt;text value=""/&gt;
      &lt;/else&gt;
    &lt;/choose&gt;
  &lt;/macro&gt;
  &lt;citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year"&gt;
    &lt;sort&gt;
      &lt;key macro="year-date"/&gt;
    &lt;/sort&gt;
    &lt;layout delimiter="; "&gt;
      &lt;group prefix="([" suffix="]" delimiter=", "&gt;
        &lt;group delimiter=", "&gt;
          &lt;text macro="author-short"/&gt;
          &lt;text macro="year-date"/&gt;
        &lt;/group&gt;
        &lt;group&gt;
          &lt;label variable="locator" form="short" suffix=" "/&gt;
          &lt;text variable="locator"/&gt;
        &lt;/group&gt;
      &lt;/group&gt;
      &lt;text macro="url-intext" prefix="(" suffix="))"/&gt;
    &lt;/layout&gt;
  &lt;/citation&gt;

</code></pre>

<p>I'm a neophyte at CSL, so I'm sure there is a better way to do it.  Essentially, this is creating a group, starting with <code>([</code>. Inside that it places the author(s) and date. It ends the group with <code>]</code> - then obtains the URl from a macro, surrounds it by <code>(</code> and <code>))</code>, then prints it.</p>

<p>There are a few bugs. If there is no URl, you might end up with mismatched brackets. But it seems to work OK.</p>

<p>My University insists on <a href="https://www.zotero.org/styles?q=id%3Aharvard-cite-them-right">Cite Them Right's Harvard style</a> - so that's what I'm using.</p>

<p>I've released a <a href="https://gitlab.com/edent/zotero-markdown-harvard-citations/-/tree/master">Zotero CSL file on GitLab</a> if you want to use it. Feedback is <em>very</em> welcome - because I have <em>no idea</em> what I'm doing!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38943&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/05/zotero-citations-to-markdown-via-csl/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
