Giter Site home page Giter Site logo

pandoc-latex-extensions's Introduction

pandoc-latex-extensions 0.2.2

pandoc-latex-extensions is a pandoc filter that adds latex extensions.

Bug reports and feature requests may be posted on the project's Issues tracker. If you find pandoc-latex-extensions useful, then please kindly give it a star on GitHub.

Plugin contributions are welcome. Information for developers is given in DEVELOPERS.md.

See also: pandoc-fignos, pandoc-eqnos, pandoc-tablenos, pandoc-secnos, and pandoc-comments.

Contents

  1. Installation
  2. Usage
  3. Markdown Syntax

Installation

Pandoc-latex-extensions requires python, a programming language that comes pre-installed on macOS and linux. It is easily installed on Windows -- see here.

Pandoc-latex-extensions may be installed using the shell command

pip install pandoc-latex-extensions --user

and upgraded by appending --upgrade to the above command. Pip is a program that downloads and installs software from the Python Package Index, PyPI. It normally comes installed with a python distribution.1

Usage

Pandoc-latex-extensions is activated by using the

--filter pandoc-latex-extensions

option with pandoc.

Extensions

The following extensions are enabled. Options for each extension will be implemented on request.

newpage

Synopsis: Converts pandoc horizontal rules to \newpage commands.

lettrine

Synopsis: Converts pandoc spans of class lettrine to \lettrine (drop caps) commands.

Installs: The lettrine package.

Example markdown:

[Lorem]{.lettrine} ipsum dolor sit amet, consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo. Donec id velit non mauris porttitor semper. Suspendisse non pharetra lorem, luctus euismod odio. Integer eu diam at odio feugiat venenatis vitae sit amet libero. Duis ut auctor libero, et venenatis nisi. Fusce nec posuere nisi, porta rutrum justo. Suspendisse blandit tellus eget venenatis scelerisque.

Result:

lettrine demonstration

noindent

Synopsis: Removes indentation from the content of pandoc divs with class noindent.

Example markdown:

::: {.noindent}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo. Donec id velit non mauris porttitor semper.
:::

Result:

noindent demonstration

epigraph

Synopsis: Converts pandoc divs with class epigraph to \epigraph commands.

Installs: The epigraph package.

Example markdown:

::: {.epigraph}
Aliquam erat volutpat.

Lorem Ipsum Generatis
:::

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo. Donec id velit non mauris porttitor semper.

Result:

epigraph demonstration

The last line in the div is taken to be the quote author. There must be a blank line above it.

Indentation is removed from the first paragraph after the epigraph.

newthought

Synopsis: Converts pandoc spans with class newthought to tufte-latex \newthought commands.

Documentclass: tufte-book or tufte-handout.

Example markdown:

---
documentclass: tufte-handout
...

[Lorem ipsum dolor sit amet,]{.newthought} consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo.

Result:

newthought demonstration

marginnote

Synopsis: Converts pandoc divs with class marginnote to tufte-latex \marginnote commands.

Documentclass: tufte-book or tufte-handout.

Options: offset.

Example markdown:

---
documentclass: tufte-handout
...

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo. Donec id velit non mauris porttitor semper. Suspendisse non pharetra lorem, luctus euismod odio. Integer eu diam at odio feugiat venenatis vitae sit amet libero. Duis ut auctor libero, et venenatis nisi. Fusce nec posuere nisi, porta rutrum justo. Suspendisse blandit tellus eget venenatis scelerisque.

::: {.marginnote offset=-2cm}
Maecenas vehicula hendrerit massa, sed consequat ipsum facilisis et. Fusce eu velit neque. Duis vel aliquam ex.
:::

Result:

marginnote demonstration

marginfigure

Synopsis: Converts pandoc implicit figures with class marginfigure to tufte-latex marginfigure environments.

Documentclass: tufte-book or tufte-handout.

Options: offset.

Example markdown:

---
documentclass: tufte-handout
...

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non massa semper, commodo massa a, molestie justo. Donec id velit non mauris porttitor semper. Suspendisse non pharetra lorem, luctus euismod odio. Integer eu diam at odio feugiat venenatis vitae sit amet libero. Duis ut auctor libero, et venenatis nisi. Fusce nec posuere nisi, porta rutrum justo. Suspendisse blandit tellus eget venenatis scelerisque.

![Duis nisi eros, consectetur facilisis odio id, vehicula accumsan justo.](img/fig-1.png){.marginfigure offset=-2cm}

Result:

marginfigure demonstration


Footnotes

1: Anaconda users may be tempted to use conda instead. This is not advised. The packages distributed on the Anaconda cloud are unofficial, are not posted by me, and in some cases are ancient. Some tips on using pip in a conda environment may be found here.

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.