Giter Club home page Giter Club logo

pandoc-amsthm's Introduction

amsthm—provide a syntax to use amsthm environments in pandoc, with output in LaTeX and HTML

Date: January 26, 2022

Documentation Status image1

GitHub Actions Coverage Status image2 Codacy Badge Scrutinizer Status CodeClimate Quality Status

Supported versions Supported implementations PyPI Wheel PyPI Package latest release GitHub Releases Development Status Downloads Commits since latest release License

Conda Recipe Conda Downloads Conda Version Conda Platforms

amsthm provide a syntax to use amsthm environments in pandoc, with output in LaTeX and HTML.

From makefile:

tests/model-target.md: tests/model-source.md
    pandoc -F amsthm $< -o $@
tests/model-latex.tex: tests/model-source.md
    pandoc -F amsthm $< -o $@ --top-level-division=chapter --toc -N
tests/model-latex.pdf: tests/model-source.md
    pandoc -F amsthm $< -o $@ --top-level-division=chapter --toc -N
tests/model-html.html: tests/model-source.md
    pandoc -F amsthm $< -o $@ --toc -N -s

See tests/model-source.md (or next page in documentation site) for an example.

  • Use -N, --number-sections to enable numbering in pandoc. This is mandatory for LaTeX output.
  • To match LaTeX and non-LaTeX output numbering scheme, match these 2 settings manually
    • LaTeX output: pandoc’s cli flag --top-level-division=[section|chapter|part] and the use of parent_counter in pandoc-amsthm
    • non-LaTeX output: counter_depth in pandoc-amsthm

pandoc versioning semantics is MAJOR.MAJOR.MINOR.PATCH and panflute’s is MAJOR.MINOR.PATCH. Below we shows matching versions of pandoc that panflute supports, in descending order. Only major version is shown as long as the minor versions doesn’t matter.

Version Matching [1]
pandoc-amsthm panflute version supported pandoc versions supported pandoc API versions
2.0.0 2.1.3 2.14.0.3–2.17.x 1.22–1.22.1
[1]For pandoc API verion, check https://hackage.haskell.org/package/pandoc for pandoc-types, which is the same thing.

pandoc-amsthm's People

Contributors

ickc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pandoc-amsthm's Issues

Integrating the templates into the filter

Currently the filter is not "self-contained". A few templates are distributed and are required to use together for it to function properly.

@jgm suggested in jgm/pandoc#3138:

If you include Text.Pandoc.Templates in your filter, you can use its functions to resolve your custom template, and then insert the result into header-includes.

Complete rewrite using panflute

In light of issue #12 and #13, both requires a complete rewrite of the templates. Given @jgm recommended panflute, and Haskell has a tighter integration (allows the use of Text.Pandoc.Templates). It seems pandocfilters should be abandoned.

Either way requires some extra installations. panflute still seems to have a lower barrier since it is a scripting language (and cabal/stack install could be intimidating).

Edit: Todo list:

  • revert 330768e (at least partially): not a good idea to check output format and branching from there. Reason: panflute autofilter calls the main function, and may not pass the arg as the output format.

Default latex definitions

I have been writing plenty of maths and physics docs and I liked this filter and wanted to use it.
However what I do not like is to use the YAML block repeatedly in my every document.

I wonder if it is possible for the current YAML block specified in the README to be set as default in the filter in order to remove the need to define the environments in YAML of every document I write.
And since the defaults are set, it should be possible to override them within the YAML block.

But good job!

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.