Package: pancritic
Author:Kolen CheungDate:April 5, 2019ContentsDefinition of CriticMarkupInstallationUsage: pancritic as a markdown wrapper (including but not limited to pandoc)pancritic specific optionsPrevious UsersPrevious Users of pandoc-criticmarkupPrevious Users ofcriticParser_CLI.pyAdvanced Usage: pancritic as a pandoc preprocessorCaveatsLaTeX OuptutCreditsUsing CriticMarkup with pandoc. It serves both as a wrapper and a
pre-processor.Definition of CriticMarkupDeletions: This is {–is –}a test.Additions: This {++is ++}a test.Substitutions: This {~~isn’t~>is~~} a test.Highlighting: This is a {==test==}.Comments: This is a test{>>What is a test for?<<}.InstallationInstall usingpipinstallpancriticUsage: pancritic as a markdown wrapper (including but not limited to pandoc)pancritic provides a pandoc-like cli. Pandoc users will feel right at
home. See help frompancritic-hA typical use of pancritic will be likepancritic-s-oindex.htmlindex.mdSee examples inHTMLandPDF.pancritic specific options--engineThe default engine ismarkdown. Valid options aremarkdown,markdown2,panflute,pypandoc. You need to install the
respective package in order to use them.markdownandmarkdown2are pure Python, hence useful for other CPU
architechture.panfluteandpypandocboth uses pandoc as
backend.-m|--critic-modea/accept, r/reject: accept/reject changes.d/diff: generates a diff. In HTML output, JS is used for toggling
between diff, accept, reject.
m/markup: treat the CriticMarkup as Markup. i.e. in HTML output there
isn’t any toggles but the diff view only. In LaTeX output, diff and
markup modes are identical except for an additional nav.-mmshould be used with LaTeX output.Previous UsersPrevious Users of pandoc-criticmarkupThis is completely rewritten in Python. The cli has been completely
changed too. The former options of-a,-r,-dare replaced
with-ma,-mr,-md, and added a-mm.Previous Users ofcriticParser_CLI.pyThis is a heavy fork ofcriticParser_CLI.py, with these differences:CLI has changed, with a more pandoc-like interface.Python 3 (and 2) compatible.Bug fixes (formerly hightlight without comment are parsed
incorrectly).It has much more input/output format options as well as engines.Examples,criticParser_CLI.pyinput.md-m2-ooutput.html--csscss.html# is equivalent topancritic-ooutput.htmlinput.md--critic-templatecss.html--enginemarkdown2Advanced Usage: pancritic as a pandoc preprocessorA somewhat surprising behavior is when the to-format and output
extension is different. In pancritic, the to-format indicates the
CriticMarkup parsing behavior (mainly tex vs. html). And the output
extension controls the final output’s format (e.g. markdown, html, etc.)An interesting use of this is to use pancritic as a pandoc preprocessor
instead, like thispancriticinput.md-tmarkdown-mm|pandoc-s-ooutput.htmlThis will be useful if more advanced pandoc args are needed.CaveatsNesting CriticMarkup might have unexpected behavior, especially in
LaTeX output. Seethe caveats section in the spec of
CriticMarkup.mainly tested with HTML and LaTeX output. RST output almost works,
but injecting CSS/JS into the output causes some problems. Currently,
it can be get arround with--critic-templateand injecting the
CSS/JS manually. Seepancritic/template.pyfor the template used.LaTeX OuptutNote that the LaTeX output requires the LaTeX packageschanges>=3.[1]One can tell pandoc to use this package by either using a custom
template or--include-in-headeroption. Or you can use the trick of
putting the following in your YAML front matter, like this file:---fontfamily:lmodern,changes...Markdown within the CriticMarkup will not be rendered in LaTeX output.
If you want to change this behavior, you can take a look at:LaTeX
Argument
Parser.Translation from CriticMarkup to LaTeX.CriticMarkupLaTeX{--[text]--}\deleted{[text]}{++[text]++}\added{[text]}{~~[text1]~>[text2]~~}\replaced{[text2]}{[text1]}{==[text]==}\highlight{[text]}{>>[text]<<}\comment{[text]}CreditsHeavily modified fromCriticMarkup Toolkit’s
criticParser_CLI.pytests.mdis modified fromMMD-Test-Suite/Critic.text
at master ·
fletcher/MMD-Test-Suite[1]The version of the package in TeXLive 2018 is still v2.TeXLive 2019
should be available on 2019-4-30,
meanwhile you need to# sudo is needed in most cases, depending on where you put itsudotlmgrupdate--selfsudotlmgrupdatechanges# check it is >=3tlmgrinfochanges