Skip to content

Commit 5d61b9a

Browse files
committed
Update readme documentation
1 parent 82c6238 commit 5d61b9a

File tree

11 files changed

+58
-25
lines changed

11 files changed

+58
-25
lines changed

README.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,14 @@ With the testing file `tests/test.tex`:
285285
## Default Metadata
286286

287287
```bash
288-
pandoc -o output.docx -F pandoc-tex-numbering test.tex -M theorem-names="thm,lem"
288+
pandoc test.tex -o output.docx -F pandoc-tex-numbering -M theorem-names="thm,lem" -M appendix-names="Appendix"
289289
```
290290

291291
The results are shown as follows:
292292

293293
![alt text](https://github.com/fncokg/pandoc-tex-numbering/blob/main/images/default-page1.jpg?raw=true)
294294
![alt text](https://github.com/fncokg/pandoc-tex-numbering/blob/main/images/default-page2.jpg?raw=true)
295+
![alt text](https://github.com/fncokg/pandoc-tex-numbering/blob/main/images/default-page3.jpg?raw=true)
295296

296297
## Customized Metadata
297298

@@ -307,13 +308,17 @@ In the following example, we custom the following **silly** items *only for the
307308
- For figures:
308309
- at the beginning of captions, use styles like `Figure 1.1:1`
309310
- when referred to, use styles like `as shown in Fig. 1.1.1,`
310-
- For equations, at the end of equations, use styles like `(1-1-1)`
311+
- For equations, suppress the parentheses and use the format `1.1.1`
311312
- For subfigures:
312313
- use greek letters for symbols
313314
- at the beginning of captions, use styles like `[β(1)]`
314315
- For theorems:
315316
- Theorem environment "thm" uses "Theorem" as the prefix
316317
- Lemma environment "lem" uses "Lemma" as the prefix
318+
- For appendices:
319+
- Suppress the top level appendix number
320+
- Use (upper case) Roman numbers for the second level appendices
321+
- Suppress the top level numbering in all references
317322
- Turn on custom list of figures and tables and:
318323
- Use custom titles as "图片目录" and "Table Lists" respectively.
319324
- Use hyphens as the leader in the lists.
@@ -331,31 +336,45 @@ pandoc -o output.docx -F pandoc-tex-numbering --metadata-file test.yaml -f latex
331336

332337
```yaml
333338
# test.yaml
339+
number-reset-level: 2
334340
theorem-names: "thm,lem"
341+
appendix-names: "Appendix"
342+
343+
# Prefix Settings
335344
figure-prefix: Fig
336345
table-prefix: Tab
337346
equation-prefix: Eq
338347
theorem-thm-prefix: Theorem
339348
theorem-lem-prefix: Lemma
340-
number-reset-level: 2
341-
non-arabic-numbers: true
349+
350+
# Numbering Style Settings
351+
subfigure-numstyle: "greek"
352+
appendix-numstyle-2: "Roman"
353+
354+
# Formatting Settings
342355
section-src-format-1: "第{h1_zh}章"
343-
section-src-format-2: "Section {h1}.{h2}."
356+
section-src-format-2: "Section {num}."
344357
section-cref-format-1: "chapter {h1}"
345-
section-cref-format-2: "第{h1}.{h2}节"
346-
table-src-format: "Table {h1}-{h2}-{tab_id}"
347-
table-cref-format: "table {tab_id} (in Section {h1}.{h2})"
348-
figure-src-format: "Figure {h1}.{h2}:{fig_id}"
358+
section-cref-format-2: "第{num}节"
359+
table-src-format: "Table {h1}-{h2}-{this_num}"
360+
table-cref-format: "table {this_num} (in Section {parent_num})"
361+
figure-src-format: "Figure {parent_num}:{this_num}"
349362
figure-cref-format: "as shown in Fig. {num}"
350-
equation-src-format: "\\qquad({h1}-{h2}-{eq_id})"
351-
subfigure-src-format: "[{subfig_sym}({subfig_id})]"
352-
subfigure-symbols: "αβγδεζηθικλμνξοπρστυφχψω"
363+
equation-src-format: "\\qquad {num}"
364+
subfigure-src-format: "[{this_num}({subfig_id})]"
365+
appendix-src-format-1: "" # Suppress the top level appendix number
366+
appendix-ref-format-2: "{this_num}"
367+
appendix-src-format-2: "Appendix {this_num}"
368+
369+
# List of Figures and List of Tables Settings
353370
custom-lot: true
354371
custom-lof: true
355372
lot-title: "Table List"
356373
lof-title: "图片目录"
357374
list-leader-type: "hyphen"
358375
data-export-path: "data.json"
376+
377+
# Multiple Reference Settings
359378
multiple-ref-suppress: false
360379
multiple-ref-separator: ""
361380
multiple-ref-last-separator: "\\ &\\ "

images/custom-page1.jpg

-30.4 KB
Loading

images/custom-page2.jpg

-67.9 KB
Loading

images/custom-page3.jpg

49.5 KB
Loading

images/default-page1.jpg

-57.9 KB
Loading

images/default-page2.jpg

-68.9 KB
Loading

images/default-page3.jpg

81.2 KB
Loading

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages = ["src/pandoc_tex_numbering"]
77

88
[project]
99
name = "pandoc-tex-numbering"
10-
version = "1.2.5"
10+
version = "1.3.0"
1111
dependencies = ["pylatexenc", "panflute"]
1212
requires-python = ">=3.8"
1313
authors = [{ name = "Chao Kong", email = "kongchao1998@gmail.com" }]

src/pandoc_tex_numbering/lang_num.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def arabic2upper_cyrillic(num):
7979
"roman": arabic2lower_roman,
8080
"latin": arabic2lower_latin,
8181
"Latin": arabic2upper_latin,
82-
"grekk": arabic2lower_greek,
82+
"greek": arabic2lower_greek,
8383
"Greek": arabic2upper_greek,
8484
"cyrillic": arabic2lower_cyrillic,
8585
"Cyrillic": arabic2upper_cyrillic

src/pandoc_tex_numbering/numbering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def next_thm(self,thm_type):
200200

201201
@property
202202
def current_sec_nums(self):
203-
return self.sec[:self.reset_level] if self.isin_apx else self.apx[:self.reset_level]
203+
return self.apx[:self.reset_level] if self.isin_apx else self.sec[:self.reset_level]
204204

205205
def current_sec(self,level):
206206
if level <=0: return None

0 commit comments

Comments
 (0)