dialoa / statement Goto Github PK
View Code? Open in Web Editor NEWStatement - theorems and statement support in Pandoc's markdown
Home Page: https://dialoa.github.io/statement/
License: MIT License
Statement - theorems and statement support in Pandoc's markdown
Home Page: https://dialoa.github.io/statement/
License: MIT License
Hi, I'm using pandoc to convert a folder of markdown files to HTML, with each markdown to one HTML.
How can I refer to a statement in a different markdown file?
For example, in file A.md
, I have a statement like
::: {.theorem #einstein}
Einstein
:::
And in file B.md
, I want to cite the theorem as
See @Pre:einstein.
If the output is a standalone big HTML, then the above way works. But if there are many generated HTML files, the link in B.html
to the theorem is broken. How can I fix this?
At present localized labels are recognized:
Théorème
: La somme des angles d'un triangle est égale à deux droits.
But in a case-sensitive manner. In English kind recognition appears capitalization-insensitive because both Theorem
(the label) and thereom
(the internal kind name) are recognized. This will be confusing to users; better make label recognition case-insensitive.
Each (document-level) theorem kind should have a shorthand option that allows the user to enter theroem of that kind via a shorthand. Use cases:
::: joke
Decimals have a point.
:::
::: proposition
Decimals have a point.
:::
But that at the same time they could still write:
::: {.statement kind=proposition}
Substracting the same from the same yields the same.
:::
Proposal: add a property shorthand
to statement kinds. Question: should that be a switch (yes / no, and the shorthand is the kind name?) or a string (so that user could set up jk
as a shorthand for joke
)?
I favour the switch.
Suppose a user partially specify some properties of a default kind. E.g. their metadata block contains something like:
statement-filter:
kinds:
lemma:
counter: lemma
The most natural interpretation is that they want to override that property of the defaults, but keep the defaults as is otherwise. So we should still fill in the lemma
kind with its style etc.
Solution: when the filter provides defaults it should do so by adding to existing properties. So:
if kinds.property = nil then ...
.Unless of course the user as set to true
the switch that blocks the filter from setting any default.
It is probably wiser to follow the LaTeX approach of using theorem styles. LaTeX defines three theorem styles (plain, definition and remark) that are typeset differently. This allows specifying a unique style for many theorems.
Proposed addition to the object model:
statement-filter:
kinds:
theorem:
- ...
- style: plain
...
styles:
plain: [style specification]
The question is how the user provides the style specification: in a format-independent way (makes it difficult to provide a fine control of the margins or PDF-specific behaviour), or by format-specific code.
Hi, when I cite a theorem from a book like
::: {.theorem }
[@Humphreys90 section 5.4]
xxxxx
:::
The citation adds an extra pair of ()
around the reference, as the image shows.
Here is my metadata.yml
:
https://github.com/neozhaoliang/hyperbolic-sphere-packings-book/blob/main/metadata.yml
Hi, Thank you for developing this filter, it helped me a lot. I'm having trouble with using my custom labels for the theorem environment.
Below is my metadata yaml config:
statement-filter:
kinds:
theorem:
- label: "定理"
- counter: "theorem"
- prefix: thm # ref to theorem with `@thm:
lemma:
- label: "Lemma"
- counter: "lemma"
- prefix: lem
Here I changed the default label Theorem
to 定理
(theorem in Mandarin).
In my markdown file, I tested it with an example:
::: theorem
Here is a test
:::
But I still got Theorem
(in HTML output) as the rendered label:
Also, the counter "lemma" seems not working as expected, it increases with the "theorem" counter:
May I ask what's wrong here?
We typically want all statements numbering to reset at the same level. If theorems numbering rests at each chapter, then axioms and definitions should too. That's a good default.
But perhaps not something we should make mandatory. Here's an idea of a book: Ten Principles of Mathematical Problem Solving. The book has several chapters, with theorems, definitions etc, whose numbering is best reset at each chapter (Theorem 2.1, etc). But the eponymous Principles need to be numbered continously throughout the book: Principle 1, Principle 2, etc.
All we need to allow that is to provide a statement-kind-level option for resetting counters:
statement-filter:
kinds:
principle:
counter: pple
reset-counter-with-level: 0
What if two kinds share a counter and the user specifies a reset-with-level value for only one of them? Then assume that the counters rest with that level.
What if two statement kinds share a counter but the user specifies reset-with-level properties? Then apply the last you happen to process and throw a warning ("Duplicate and conflicting reset-counter-with-level values for counter ").
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.