Git Product home page Git Product logo

undo-pandoc-citeproc's Introduction

After discussion with @mbroedl on this pandoc-citeproc ticket, this attempts to invert the citeproc references so-as to allow for easily converting docx back to markdown.

This supports a workflow of Markdown -> docx -> Markdown. Often the case when co-authors use docx, but the manuscript is written with md.

Because there is no clear way to embed meta data into the docx and extract when going docx to md, this wraps every citation in an Emph section. This allows for finding Emph sections with links that match the citeproc format, thus allowing for delimiting the citation area. This approach allows for diacritics in author names.

Further, it writes out meta data to citations.txt. This allows for saving the prefix and suffix, as well as citation type so as to easily reinsert this. For example:

adams1992mostly;see;;NormalCitation
verne1870twenty;e.g.;;NormalCitation
adams1992mostly;cf.;or so;NormalCitation
adams1992mostly;;, page 10;NormalCitation
verne1870twenty;;, notes 20-25;NormalCitation

If this file isn't present, then '(' and ')' are used to try to guess if it is a Normal citation or an inline citation. This will only work for author-year in-text style citations (e.g., Marsh et al (2018)).

This approach relies on converting md->docx using the -M link-citations flag. This preseves the initial citation key and without this, this cannot work.

undo-pandoc-citeproc's People

Contributors

chrismarsh avatar

Watchers

 avatar  avatar  avatar

Forkers

shenghxie

undo-pandoc-citeproc's Issues

installation as a pandoc filter

This is a wonderful idea to close the loop between scientific writing in markdown and feedback from collaborators that use office. I am wondering if it would be possible to write a mini tutorial on how to use the scripts. Is it a pandoc filter? How can it be installed. Say the to docx command would be

pandoc test.md --bibliography=lib.bib -o test.docx -M link-citations=true

and back some thing like?

pandoc test.docx -o test2.md -F undo-pandoc-citeproc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.