├── .gitattributes ├── .gitignore ├── .gitmodules ├── .luarc.json ├── LICENSE ├── Makefile ├── README.md ├── TODO.md ├── docs ├── .gitignore ├── 404.html ├── Gemfile ├── Gemfile.lock ├── _config.yml ├── _data │ └── menu.yml ├── _includes │ ├── header.html │ └── repo.html ├── img │ ├── thm-spivak-html-docx.png │ └── thm-spivak.png ├── index.md ├── manual.md └── tour.md ├── extras ├── layouttranslations └── parser.lua ├── src ├── Crossref.aggregate_references.lua ├── Crossref.collect_identifiers.lua ├── Crossref.get_pre_mode.lua ├── Crossref.lua ├── Crossref.parse_Cite.lua ├── Crossref.parse_Link.lua ├── Crossref.parse_identifier.lua ├── Crossref.parse_target.lua ├── Crossref.process.lua ├── Crossref.register_identifier.lua ├── Crossref.write.lua ├── Helpers.font_format.lua ├── Helpers.font_format_native.lua ├── Helpers.length_format.lua ├── Setup.DEFAULTS.lua ├── Setup.LOCALE.lua ├── Setup.create_aliases.lua ├── Setup.create_counters.lua ├── Setup.create_kinds_and_styles.lua ├── Setup.create_kinds_and_styles_defaults.lua ├── Setup.create_kinds_and_styles_user.lua ├── Setup.font_format.lua ├── Setup.increment_counter.lua ├── Setup.length_format.lua ├── Setup.read_options.lua ├── Setup.set_kind.lua ├── Setup.set_style.lua ├── Setup.update_meta.lua ├── Setup.validate_defaults.lua ├── Setup.write_counter.lua ├── Statement.DefListitem_is_statement.lua ├── Statement.Div_is_statement.lua ├── Statement.extract_fbb.lua ├── Statement.is_kind_key.lua ├── Statement.is_statement.lua ├── Statement.lua ├── Statement.new_kind_from_label.lua ├── Statement.new_kind_unnumbered.lua ├── Statement.parse_DefList.lua ├── Statement.parse_DefList_kind.lua ├── Statement.parse_Div.lua ├── Statement.parse_heading_inlines.lua ├── Statement.parse_identifier.lua ├── Statement.set_count.lua ├── Statement.set_identifier.lua ├── Statement.set_is_numbered.lua ├── Statement.set_labels.lua ├── Statement.set_values.lua ├── Statement.trim_dot_space.lua ├── Statement.write.lua ├── Statement.write_html.lua ├── Statement.write_jats.lua ├── Statement.write_kind.lua ├── Statement.write_label.lua ├── Statement.write_latex.lua ├── Statement.write_native.lua ├── Statement.write_style.lua ├── Walker.crossreferences.lua ├── Walker.lua ├── Walker.statements_in_lists.lua ├── Walker.walk.lua ├── helpers.lua ├── main.lua └── setup.lua ├── statement.lua └── tests ├── AMSthm-test-file-swap-numbers.md ├── AMSthm-test-file.md ├── Linebreak_theorem_style.md ├── Lists_in_theorems.md ├── Makefile ├── aliases.md ├── automatic_locale.md ├── benchmark_pandoc-amsthm.md ├── benchmark_pandoc-theorem.md ├── cross-references.md ├── define_kinds_by_style.md ├── documentation_examples.md ├── number_offset.md ├── principles_vignettes.md ├── recursion_and_lists.md ├── styles_based_on_styles.md ├── styles_customize.md ├── syntax_definition_lists.md └── syntax_fenced_div.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Temporary MS Word and Libreoffice files 2 | ~$*.docx 3 | .*.odt# 4 | *.pdf 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lua-builder"] 2 | path = lua-builder 3 | url = https://github.com/jdutant/lua-builder 4 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Generator": [ 3 | "Quarto", 4 | "This file provides type information for Lua completion and diagnostics.", 5 | "Quarto will automatically update this file to reflect the current path", 6 | "of your Quarto installation, and the file will also be added to .gitignore", 7 | "since it points to the absolute path of Quarto on the local system.", 8 | "Remove the 'Generator' key to manage this file's contents manually." 9 | ], 10 | "Lua.runtime.version": "Lua 5.3", 11 | "Lua.workspace.checkThirdParty": false, 12 | "Lua.workspace.library": [ 13 | "/Applications/quarto/share/lua-types" 14 | ], 15 | "Lua.runtime.plugin": "/Applications/quarto/share/lua-plugin/plugin.lua", 16 | "Lua.completion.showWord": "Disable", 17 | "Lua.completion.keywordSnippet": "Both", 18 | "Lua.diagnostics.disable": [ 19 | "lowercase-global", 20 | "trailing-space" 21 | ] 22 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Julien Dutant, Thomas Hodgson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DIFF ?= diff --strip-trailing-cr -u 2 | INFO = quiet # use make INFO=verbose to get Pandoc verbose output 3 | SRC_FILES = $(wildcard src/*.lua) 4 | 5 | .PHONY: statement.lua 6 | 7 | statement.lua: $(SRC_FILES) lua-builder/lua-builder.lua 8 | @lua lua-builder/lua-builder.lua src/main.lua -o statement.lua --verbose --recursive 9 | 10 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | * bug: statement in lists hide the heading. Perhaps use a 2 | statement-span? the trick is that the minipage wrapping must be 3 | done before statement processing, but leave the header visible to 4 | the statement parser 5 | * clarify code: take trim_dot_space in Helpers 6 | * parse-only mode? Find statements and write crossrefs, but do not 7 | write statements themselves. Collection filter: needs to amend 8 | Cites that refer to statements; for that it needs all the statement 9 | IDs, sort out the Cites into crossref vs biblio. 10 | * provide styling of crossref label, esp. smallcaps for statement 11 | * provide head-pattern, '