Comments (4)
First let me record the amsthm way. Then we should think about whether this is good.
There are chapter, section, and subsection counters. There are also counters for theorem-like environments. Whenever you declare a theorem-like environment, you have an initial choice from 3 options:
- The environment has no counter and goes unnumbered and un-ref-able
- The environment joins forces with an existing counter.
- The environment gets its own new counter.
If you choose (3), you have a choice from 2 options:
A) The counter is numbered alone continuously through the document
B) The counter is numbered "within" another counter, resets when that one increments, and is printed parent.child.
Extra items:
- One can also choose the "style" of the environment. The options are Theorem, Definition, and Remark. These three style names are stupid and arbitrary. Theorem style has italic contents. Definition style looks "normal". Remark style has italicized name but not content. We should just leave this to CSS.
- One should also be able to control how the counter is printed by default (as a number or letter). This isn't standard in amsthm but presumably easy to implement.
from laml.
The amsthm way described above is kind of weird in that it conflates counter names and environment names (by choosing option 3). Maybe it makes more sense for the user to be able to declare named counters, and then specify which environments use which counters.
The default should probably be a "statement" counter which is numbered within a "section" counter, and that's it.
Here is a sample (but would be simpler given we'd have defaults).
---
counters:
- section
- appearance: roman
- statement:
- numberwithin: section
- appearance: arabic
- exercise
- appearance: arabic
statements:
- theorem:
- counter: statement
- definition:
- counter: statement
- exercise:
- counter: exercise
- question [no counter]
---
from laml.
Thanks, Sam!
from laml.
Extending statements to read the fulll configuration (so you get access to the counters property which is separate from the statements options that are passed now), then do something like
var elem=document.createElement('style');
elem.styleSheet.cssText=css;
document.getElementsByTagName('head')[0].appendChild(elem);
from laml.
Related Issues (20)
- add new sample: scoskey/m522 HOT 14
- create samples directory and move vatter samples to it.
- [samples/vatter/ fix link to laml-browser.js
- [cli] exit on incorrect arguments
- fix html-head (for fragments)
- add: sectioning module
- [figures] fix belowOrAbove (more generalized)
- [refs] add fault tolerance
- [worker] upgrade to mathjax 2.7.3
- [tex2jax] fix \begin{}
- add "npm live" script
- [bin] add mathjax-node processing
- [yaml.js] add error handling
- [readme] give some background
- update pdf experiment
- [htmlhead] enable server-side processing
- [statement] support empty selectors
- move CM css and webfonts to ./css
- mathjax store should use global paths HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laml.