tomduck / pandoc-theoremnos Goto Github PK
View Code? Open in Web Editor NEWA pandoc filter for numbering theorems and theorem references.
License: GNU General Public License v3.0
A pandoc filter for numbering theorems and theorem references.
License: GNU General Public License v3.0
This project was contributed to the the pandoc-xnos filter suite by @ValiValpas. Many thanks!
I'm going to use this Issue to report and discuss changes as we work toward a release.
I have made some changes to the initial commit. The version number is now 2.0.0a1 which identifies it as an alpha release. Install instructions are given at the top of the README.md. Any existing installation may need to be removed before installing this one.
I have created a 'nextrelease' branch for development.
Pandoc-xnos has been updated and will be automatically upgraded when this project is installed. Some more changes to pandoc-xnos will likely be needed as described in PR #1.
The demos have been built and are pushed to the 'demos' branch.
More soon. βΊοΈ
Got the following error when running:
pandoc -f markdown+smart+fenced_divs --lua-filter=texclass.lua --standalone -F pandoc-theoremnos -F pandoc-crossref --citeproc --number-sections --output=output/test.pdf test.md
Traceback (most recent call last):
File "/usr/local/bin/pandoc-theoremnos", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/pandoc_theoremnos.py", line 488, in main
altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
File "/usr/local/lib/python3.8/dist-packages/pandoc_theoremnos.py", line 488, in <lambda>
altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
File "/usr/local/lib/python3.8/dist-packages/pandocfilters.py", line 110, in walk
res = action(item['t'],
File "/usr/local/lib/python3.8/dist-packages/pandocxnos/core.py", line 856, in process_refs
_process_refs(value[-5], pattern, labels)
File "/usr/local/lib/python3.8/dist-packages/pandocxnos/core.py", line 92, in wrapper
ret = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/pandocxnos/core.py", line 758, in _process_refs
if v['t'] == 'Cite' and len(v['c']) == 2:
TypeError: 'NoneType' object is not subscriptable
re.compile('(asum|prop|lemma):[\\w/-]*')
Error running filter pandoc-theoremnos:
Filter returned error status 1
My example markdown is as follows:
---
title: "ABC"
author: "XYZ"
date: \today
geometry: margin=1in
fontsize: 12pt
fontfamily: times
link-citations: true
abstract: "Example."
header-includes:
- \usepackage{setspace}
- \doublespacing
- \usepackage{floatpag}
- \usepackage{cleveref}
- \usepackage[utf8]{inputenc}
- \floatpagestyle{empty}
- \usepackage[small,compact]{titlesec}
theoremnos-cleveref: True
theoremnos-names:
- id: asum
name: Assumption
- id: prop
name: Proposition
- id: lemma
name: Lemma
---
a b c
--- --- ---
1 2 3
4 5 6
: Caption {#tbl:label}
[My Theorem]{#lemma:id}
: This is my theorem.
[123]{#lemma:n-derivative}
: In equilibrium, $n^*$ can be expressed as:
$$
n^*=\frac{b-\frac{4 (\beta D_H+(1-\beta)D_L)^2}{(\beta D_H^2+(1-\beta)D_L^2)+4/q}}{2 t}
$$
@lemma:n-derivative
@tbl:label
@lemma:id
The problem is with the table reference. That seems to be the one that is conflicting with this filter. Removing the table will resolve the issue, but it is currently the only way to reference a table AFAIK: http://lierdakil.github.io/pandoc-crossref/#table-labels
Hello,
this is a wonderful project. But python3 -m pip install --user pandoc-theoremnos
fails with
ERROR: Could not find a version that satisfies the requirement pandoc-theoremnos (from versions: none)
ERROR: No matching distribution found for pandoc-theoremnos
This is my markdown:
[$\epsilon$]{#dfn:def}
: Epsilon is a letter of the Greek alphabet
This is the error I get
Error producing PDF.
! Missing $ inserted.
<inserted text>
$
l.123 \begin{dfn}[\epsilon]
How can I access mathematical mode inside the theorem name?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.