# How to change Pandoc's citation style from default to APA when Pandoc it custom word processor I Marked 2?

#### Simon

27 Feb, 2019 07:33 AM

Hello!

I have Pandoc 2.6 as a custom word processor in Marked 2. I use a .bib file for generating my citations. It works great and now I wanna change the citation-style from the default Chicago-author-date to APA. I have searched on the internet and found (what I think) can be possible solutions but I have not been able to find a complete guide that is easy to follow. I don't have the knowledge to determine whats the easiest way to go. Whats the best solution to solve this problem?

Can this be possible solution alternatives:
1. I installed a program called pandoc-citeproc but I don't know how to implement it to my situation.

2. I have found that at a command like these maybe can solve this ”—csl /Users/S/Downloads/apa.cslshell” or something called bash script to call the pandoc command. http://support.markedapp.com/discussions/problems/139702-marked-does-not-read-csl-file.

3. Can this be solved with MMD3 metadata, YAML frontmatter (or something else)?

At the moment this is what i have under the advanced tab in Marked 2:
Path: /usr/local/bin/pandoc
Args: -f markdown -t html5 --bibliography=/Users/USR/Desktop/References.bib -s

Thanks.

1. Support Staff Posted by Brett on 27 Feb, 2019 04:58 PM

Hi Simon,

The solution will be handled through the arguments of the custom
processor, but I'm not well-versed enough with Pandoc to provide any
support on figuring those out. If you do end up needing to run multiple
commands, I'm happy to demonstrate how to create a bash script, but
ideally you'll find the options required to get the results you want
from the command line and then transfer those to Marked's settings.

-Brett

2. Posted by Simon on 01 Mar, 2019 07:35 AM

Is a bash script used when I wanna combine multiple commands and don't want to write it all in the Args field?
What I have done so far is to use this command into the Args field;

But it crashing.

Can you help me make these commands into a bash script and guide me where I should put things?

Thanks

Simon

3. Support Staff Posted by Brett on 01 Mar, 2019 02:53 PM

Like I've said, my experience with Pandoc is limited enough that I can't immediately discern what might be wrong with your arguments line. It looks fine from a syntax standpoint, but you need to verify that it works from Terminal before looking for the issue in Marked.

In Terminal, run

cat [yourfile.md] | /usr/local/bin/pandoc -f markdown -t html5 --bibliography=/Users/S/Desktop/References.bib -s --csl /Users/S/Downloads/apa.csl


And ensure you get the results you expect. If that works, let me know and we can try to debug the issue in Marked.

-Brett

4. Posted by Simon on 03 Mar, 2019 07:14 PM

Thanks.

When I run the command in the terminal I get this:
---
[WARNING] This document format requires a nonempty <title> element.
e.g. by using --metadata pagetitle="..." on the command line.
Falling back to 'Untitled'
---

Any ideas?

5. Support Staff Posted by Brett on 03 Mar, 2019 07:33 PM

Are you passing the text of your document to the command? It should look
like

\$ cat FILENAME.md | [your command]

If that's already in place, I'm afraid I can't help much further. This
is more of a Pandoc question than a Marked issue.

-Brett

6. Posted by Simon on 03 Mar, 2019 08:03 PM

I think my knowledge is to limited in the subject.

Thanks any way :)

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

### »

#### Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 06 Mar, 2021 09:34 PM appears in display 01 Mar, 2021 02:00 PM Rendering Mermaid 01 Mar, 2021 01:56 PM Source Line Numbers 26 Feb, 2021 02:24 PM *manual* refresh needed when using mathjax from script 24 Feb, 2021 06:25 AM pdflatex not found

## Recent Articles

 Intra-document links in exported PDFs Using Ulysses with Marked Fenced code blocks inside indented code blocks Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked