Giter VIP home page Giter VIP logo

Comments (4)

scoskey avatar scoskey commented on June 15, 2024

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:

  1. The environment has no counter and goes unnumbered and un-ref-able
  2. The environment joins forces with an existing counter.
  3. 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:

  1. 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.
  2. 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.

scoskey avatar scoskey commented on June 15, 2024

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.

pkra avatar pkra commented on June 15, 2024

Thanks, Sam!

from laml.

pkra avatar pkra commented on June 15, 2024

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)

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.