You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,24 @@
1
+
# 1.3.0 (2025-03-26)
2
+
Support various custom numbering styles in a more clear and flexible way:
3
+
- support various and auto-extend numbering symbols: arabic numbers, roman numbers, latin/greek/cyrillic letters (both upper and lower case), Chinese numbers, etc.
4
+
- support custom numbering symbols for anything: any level of section, figure, table, equation, theorem, etc.
5
+
6
+
Support appendix numbering.
7
+
8
+
Metadata `{item_type}-symbols` and fields `{item_type}_sym` are no longer supported.
9
+
10
+
## Migration Guide
11
+
For people who are using 1.2.x version, there are some **removals**:
12
+
13
+
The following metadata keys have already marked as deprecated in the previous version, and they are now **removed**:
14
+
- metadata keys `section-format-source-i` and `section-format-ref-i` for the i-the level section numbering formatting are now removed. You should use the new `section-src-format-i` and `section-cref-format-i` keys instead.
15
+
16
+
The following features are now **removed**, and you should use the new API instead:
17
+
- metadata keys `{item_type}-symbols` and formatting fields `{item_type}_sym` are now removed. Now you can simply use `{item_type}-numstyle` to specify the numbering style directly.
18
+
1
19
# 1.2.5 (2025-03-13)
2
20
Support theorem numbering. Also refer to a [StackExchange question](https://tex.stackexchange.com/questions/738132/simultaneously-cross-referencing-numbered-amsthm-theorems-and-numbered-equations).
3
21
4
-
5
22
# 1.2.4 (2025-03-07)
6
23
Support customizable spacing command in the `equation-src-format` field (default now is `"\\quad({num})"`). Also refer to issue #11.
Copy file name to clipboardExpand all lines: README.md
+51-11Lines changed: 51 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# pandoc-tex-numbering
2
-
This is an all-in-one pandoc filter for converting your LaTeX files to any format while keeping **numbering, hyperlinks, caption formats and (clever) cross references in (maybe multi-line) equations, sections, figures, tablesand theorems**. The formating is highly customizable, easy-to-use, and even more flexible than the LaTeX default.
2
+
This is an all-in-one pandoc filter for converting your LaTeX files to any format while keeping **numbering, hyperlinks, caption formats and (clever) cross references in (maybe multi-line) equations, sections, figures, tables, theorems and appendices**. The formating is highly customizable, easy-to-use, and even more flexible than the LaTeX default.
3
3
4
4
# Contents
5
5
-[pandoc-tex-numbering](#pandoc-tex-numbering)
@@ -11,6 +11,7 @@ This is an all-in-one pandoc filter for converting your LaTeX files to any forma
11
11
-[Quick Start](#quick-start)
12
12
-[Customization](#customization)
13
13
-[General](#general)
14
+
-[Numbering System](#numbering-system)
14
15
-[Formatting System](#formatting-system)
15
16
-[Prefix-based System](#prefix-based-system)
16
17
-[Custom Formatting System (f-string formatting)](#custom-formatting-system-f-string-formatting)
@@ -20,8 +21,7 @@ This is an all-in-one pandoc filter for converting your LaTeX files to any forma
20
21
-[Theorems](#theorems)
21
22
-[List of Figures and Tables](#list-of-figures-and-tables)
22
23
-[Multiple References](#multiple-references)
23
-
-[Details](#details)
24
-
-[Equations](#equations-1)
24
+
-[Appendix](#appendix)
25
25
-[List of Figures and Tables](#list-of-figures-and-tables-1)
26
26
-[Data Export](#data-export)
27
27
-[Log](#log)
@@ -41,7 +41,8 @@ This is an all-in-one pandoc filter for converting your LaTeX files to any forma
41
41
-**`cleveref` Package**: `cref` and `Cref` commands are supported. You can customize the prefix of the references.
42
42
-**Subfigures**: `subcaption` package is supported. Subfigures can be numbered with customized symbols and formats.
43
43
-**Theorems**: Theorems are supported with customized formats.
44
-
-**Non-Arabic Numbers**: Chinese numbers "第一章", "第二节" etc. are supported. You can customize the numbering format.
44
+
-**Appendices**: Appendices are supported with customized formats.
45
+
-**Non-Arabic Numbers**: Various non-arabic numbers are supported, such as Latin letters, Chinese, Roman, Greek, Cyrillic, etc.
45
46
-**Custom List of Figures and Tables**: **Short captions** as well as custom lof/lot titles are supported for figures and tables.
46
47
-**Custom Formatting of Everything**: You can customize the format of the numbering and references with python f-string format based on various fields we provide.
47
48
@@ -84,6 +85,26 @@ You can set the following variables in the metadata of your LaTeX file to custom
84
85
-`data-export-path`: Where to export the filter data. Default is `None`, which means no data will be exported. If set, the data will be exported to the specified path in the JSON format. This is useful for further usage of the filter data in other scripts or filter-debugging.
85
86
-`auto-labelling`: Whether to automatically add identifiers (labels) to figures and tables without labels. Default is `true`. This has no effect on the output appearance but can be useful for cross-referencing in the future (for example, in the `.docx` output this will ensure that all your figures and tables have a unique auto-generated bookmark).
86
87
88
+
## Numbering System
89
+
-`{item_type}-numstyle`: The style of the numbering of figures, tables, equations, sections, theorems, subfigures. For example `figure-numstyle` represents the style of the numbering of figures.
90
+
-`{item_type}-numstyle-{i}`: The style of the i-th level of the numbering of sections or appendices. For example, `section-numstyle-1` represents the style of the first level of the numbering of sections.
91
+
92
+
Possible values are:
93
+
-`arabic`: Arabic numbers (1, 2, 3, ...)
94
+
-`roman`: Lowercase Roman numbers (i, ii, iii, ...)
95
+
-`Roman`: Uppercase Roman numbers (I, II, III, ...)
Default values of most of the items are `arabic`. Exceptions are:
105
+
- Default value of `subfigure-numstyle` is `latin`.
106
+
- Default value of `appendix-numstyle-1` is `Latin`.
107
+
87
108
## Formatting System
88
109
89
110
We support a very flexible formatting system for the numbering and references. There are two different formatting systems for the numbering and references. You can use them together. The two systems are:
@@ -119,18 +140,28 @@ For sections, every level has its own formatting. You can set the metadata, for
119
140
For equations, the default `src` format (i.e. `equation-src-format`) is `"\\qquad({num})"`. `\qquad` is used to offer a little space between the equation and the number. You can customize it as you like.
120
141
121
142
#### Metadata Values
122
-
The metadata values are python f-string format strings. Various fields are provided for you to customize the format. For example, if you set the `number-reset-level` to 2, `figure-prefix` to `figure` and `prefix-space` to `True`. Then, the fifth figure under subsection 2.3 will have the following fields:
123
-
-`num`: `2.3.5`
124
-
-`parent_num`: `2.3`
143
+
The metadata values are python f-string format strings. Various fields are provided for you to customize the format. For example, if you have the following settings:
144
+
-`number-reset-level`: `2`
145
+
-`figure-prefix`:`"figure"`
146
+
-`prefix-space` to `True`.
147
+
-`section-numstyle-1`: `"Roman"`
148
+
-`figure-numstyle`: `"latin"`
149
+
150
+
Then, the fifth figure under subsection 2.3 will have the following fields:
151
+
-`num`: `II.3.e`
152
+
-`parent_num`: `II.3`
153
+
-`this_num`: `e` (note that the fields ended with `_num` will keep the numbering style settings)
125
154
-`fig_id`: `5`
126
155
-`prefix`: `figure ` (note the space at the end)
127
156
-`Prefix`: `Figure `
128
157
-`h1`: `2`
129
158
-`h2`: `3`(note that `h2` is accessible only when the `number-reset-level` >= 2 and so on)
130
-
-`h1_zh`: `二` (Chinese number support)
131
-
-`h2_zh`: `三`
132
-
133
-
For the subfigures, a special field `subfig_sym` is provided to represent the symbol of the subfigure. For example, if you set the `subfigure-symbols` metadata to `"αβγδ"`, the second subfigure will have the `subfig_sym` field as `"β"` while the `subfig_id` field as `2`.
159
+
-`h1_zh`: `二`
160
+
-`h1_roman`: `ii`
161
+
-`h1_Roman`: `II`
162
+
-`h1_latin`: `b`
163
+
-`h1_Latin`: `B`
164
+
- ... (any supported languages or symbols, see the [Numbering System](#numbering-system) section)
134
165
135
166
Here are some examples of the metadata values:
136
167
- set the `fig-src-format` metadata to `"{prefix}{num}"`, the numbering before its caption will be shown as "Figure 2.3.5"
@@ -168,6 +199,15 @@ For more details, see the [List of Figures and Tables](#list-of-figures-and-tabl
168
199
169
200
NOTE: in case of setting metadata in a yaml file, the spaces at the beginning and the end of the values are by default stripped. Therefore, if you want to keep the spaces in the yaml metadata file, **you should mannually escape those spaces via double slashes.** For example, if you want set `multiple-ref-last-separator` to `" and "` (spaces appear at the beginning and the end), you should set it as `"\\ and\\ "` in the yaml file. See pandoc's [issue #10539](https://github.com/jgm/pandoc/issues/10539) for more further discussions.
170
201
202
+
## Appendix
203
+
-`appendix-names`: The names of the appendices separated by "/,". If you have this in your tex file:
204
+
```latex
205
+
\appendix
206
+
\chapter{First Appendix}
207
+
\chapter{Second Appendix}
208
+
```
209
+
You should set the metadata `appendix-names` to `"First Appendix/,Second Appendix"`. Note that the names should be separated by `"/,"`, not by `","` (so as to avoid conflicts with the commas in the names).
0 commit comments