Skip to content

Commit 623b460

Browse files
authored
Improve TOC indentation, add equations and references to samples (#53)
* minor tweaks to toc indentation * test something about the html * reorder params to RawInline * experiment with math mode * increase indents even more * experiment with equations * Update sample1.md * Update sample1.md * Update sample1.md * add some references to sample1 * update crossref config * test unlisted * fix Dockerfile * number but do not list, and caption html table
1 parent 8ba0b89 commit 623b460

File tree

6 files changed

+31
-8
lines changed

6 files changed

+31
-8
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ COPY ./filter/* /resources/filters/
9595
RUN mkdir -m 0777 /home/user
9696
ENV HOME="/home/user"
9797

98+
COPY ./filter/pandoc-crossref.yaml /home/user/.pandoc-crossref/config.yaml
99+
98100
COPY build.sh /usr/bin/build.sh
99101
ENTRYPOINT ["/usr/bin/build.sh"]
100102
CMD ["--help"]

filter/pandoc-crossref.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
figPrefix: "Figure"
2+
eqnPrefix: "Equation"
3+
tblPrefix: "Table"
4+
secPrefix: "Clause"

filter/parse-html.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function RawBlock (raw)
88

99
function RawInline (raw)
1010
return raw.format:match 'html'
11-
and pandoc.RawInline(raw.text, 'html')
11+
and pandoc.RawInline('html', raw.text)
1212
or raw
1313
end
1414

sample1.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Draft specification, with a list of tables and a list of figures.
6464
> Informative text 2: here is a block of
6565
> informative text.
6666
67-
## Details
67+
## Details {#sec:details}
6868

6969
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
7070
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
@@ -73,21 +73,31 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
7373
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
7474
culpa qui officia deserunt mollit anim id est laborum.
7575

76-
00 01 02 03 04<sub>16</sub>
76+
### Hidden details {.unlisted}
7777

78-
a<sup>n</sup> + b<sup>n</sup> = c<sup>n</sup>
78+
An inline bit of math is here: $00 01 02 03 04_{16}$
79+
80+
Here is an equation:
81+
82+
$$a^n + b^n = c^n$$ {#eq:FermatsLastTheorem}
83+
84+
As @eq:FermatsLastTheorem demonstrates, math is hard.
7985

8086
## Figures
8187

8288
### Computer
8389

8490
![a computer](computer.jpg){#fig:computer}
8591

92+
as @fig:computer shows: computers are.
93+
94+
Remember from @sec:details
95+
8696
## Tables
8797

8898
### Mandatory Algorithms
8999

90-
Table: List of Mandatory Algorithms
100+
Table: List of Mandatory Algorithms {#tbl:algorithms}
91101

92102
| **Algorithm ID** | **M/R/O/D** | **Comments** |
93103
| ---------------- | ----------- | --------------------------------------------- |
@@ -111,6 +121,8 @@ Table: List of Mandatory Algorithms
111121

112122
### Mandatory Curves
113123

124+
This table is a lot like @tbl:algorithms.
125+
114126
Table: List of Mandatory Curves
115127

116128
| **Curve Identifier** | **M/R/O/D** | **Comments** |
@@ -203,4 +215,4 @@ Internet Engineering Task Force, "PKCS #10: Certification Request Syntax Specifi
203215

204216
4. Internet Engineering Task Force,
205217
"PKCS #10: Certification Request Syntax Specification Version 1.7," 2000.
206-
[Online]. Avilable: <https://www.ietf.org/rfc/rfc2986.txt>.
218+
[Online]. Avilable: <https://www.ietf.org/rfc/rfc2986.txt>.

sample3.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ Table: List of Mandatory Curves
137137

138138
This section contains a Grid Table.
139139

140+
Table: Temperatures
141+
140142
+---------------------+-----------------------+
141143
| Location | Temperature 1961-1990 |
142144
| | in degree Celsius |
@@ -153,6 +155,7 @@ This section contains a Grid Table.
153155
This section contains an HTML Table.
154156

155157
<table>
158+
<caption>HTML Table</caption>
156159
<colgroup>
157160
<col style="width: 13%" />
158161
<col style="width: 86%" />

template/eisvogel.latex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,19 +666,21 @@ $endif$
666666
\RedeclareSectionCommand[
667667
runin=false,
668668
afterindent=false,
669-
tocnumwidth=3em,
669+
tocnumwidth=1.5em,
670670
beforeskip=\baselineskip,
671671
afterskip=0em]{section}
672672
\RedeclareSectionCommand[
673673
runin=false,
674674
afterindent=false,
675+
tocindent=1.5em,
675676
tocnumwidth=3em,
676677
beforeskip=.75\baselineskip,
677678
afterskip=0em]{subsection}
678679
\RedeclareSectionCommand[
679680
runin=false,
680681
afterindent=false,
681-
tocnumwidth=3em,
682+
tocindent=4.5em,
683+
tocnumwidth=4em,
682684
beforeskip=.5\baselineskip,
683685
afterskip=0em]{subsubsection}
684686
\RedeclareSectionCommand[

0 commit comments

Comments
 (0)