Giter Club home page Giter Club logo

my-pandoc-filters's Introduction

Repository containing pandoc filters that I have implemented.

Currently implemented filters

siunitx-filter.py

Pandoc filter to use numbers with physical units.

In markdown you should write NUMBER{UNIT}. Ex: 10{ms}, 2.6{GHz}, etc

The filter will then separate the number and the unit.

In latex it will be replaced with \SI{NUMBER}{UNIT};

In HTML the number + unit will inside a span tag with "phy-quantity" class, the number alone will be in a span tag with "phy-number" class and the unit will be in a span tag with "phy-unit" tag. You can then edit your CSS as desired to, for instance, add a small left margin to the phy-unit class.

For all the other formats NUMBER{UNIT} will be replaced with NUMBER UNIT (just add a space).

Note that the replacements will also work inside equations, but in that case they will not have any span tags and just typeset as regular text.

latex_to_org-ref

Pandoc filter to convert from latex to org-mode using org-ref.

This performs he following conversions:

  • ~ to \nbsp{}_pattern
  • \cite{bibkey} to cite:bibkey
  • \ac.{x} to \gls.:x
  • \ref{x} to ref:x
  • \eqref{x} to eqref:x.

Filter Usage

You can apply filters in pandoc with the the --filter option.

As an example, if you have the siunitx-filter.py filter and a siunitx_sample.md file in the same folder you can convert siunitx_sample.md using the filter with the following command

pandoc --filter=./siunitx-filter.py siunitx_sample.md -o siunitx_sample.html

my-pandoc-filters's People

Contributors

darcamo avatar

Stargazers

db avatar  avatar Dilawar Singh avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

guillaumeallain

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.