Skip to content

Commit 2e80a86

Browse files
committed
Fix list-of-figures / list-of-tables numbering in HTML.
This uses the new $$lt$$ template variable from pandoc-crossref to render each item as a link, instead of raw text.
1 parent b010e9d commit 2e80a86

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,16 @@ do_html() {
10111011
local crossref=$3
10121012
mkdir -p "$(dirname ${output})"
10131013
echo "Generating HTML Output"
1014+
1015+
local processed_input="processed.input"
1016+
cp "${input}" ${processed_input}
1017+
1018+
# Configure lofItemTemplate/lotItemTemplate in the YAML frontmatter.
1019+
# These are placed first in the frontmatter so they won't override any existing settings.
1020+
# These can't be passed as --metadata since the dollar signs won't expand properly.
1021+
sed -i '0,/^---$/{s/---/---\nlofItemTemplate: |\n 1. \$\$lt\$\$/}' ${processed_input}
1022+
sed -i '0,/^---$/{s/---/---\nlotItemTemplate: |\n 1. \$\$lt\$\$/}' ${processed_input}
1023+
10141024
local cmd=(pandoc
10151025
--toc
10161026
-V colorlinks=true
@@ -1050,7 +1060,7 @@ do_html() {
10501060
${EXTRA_PANDOC_OPTIONS}
10511061
--to=html
10521062
--output="'${output}'"
1053-
"'${input}'")
1063+
"'${processed_input}'")
10541064
retry 5 "${cmd[@]}"
10551065
if [ $? -ne 0 ]; then
10561066
FAILED=true

0 commit comments

Comments
 (0)