tomduck / pandoc-secnos

A pandoc filter for numbering section references.
GNU General Public License v3.0
18 stars 5 forks source link

xnos-number-offset not working in html output #4

Closed jeremy9959 closed 4 years ago

jeremy9959 commented 4 years ago

Here is a markdown file check.md:

---
xnos-number-offset: 10
---

# This is a test {#sec:first}

This is the first section, and we should see an offset reference to +@sec:first.

Here is the pandoc command:

$ pandoc --version
pandoc 2.9.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2
$ pandoc -N --number-offset=10 --filter pandoc-secnos -t html -o check.html check.md

and here is the resulting html file -- note the reference link:

<section id="sec:first" data-number="1">
<h1 data-number="11"><span class="header-section-number">11</span> This is a test</h1>
<p>This is the first section, and we should see an offset reference to section <a href="#sec:first">1</a>.</p>
</section>

The offset works as advertised in the latex file:

(header omitted)
%% pandoc-secnos: required package
\usepackage{cleveref}

% pandoc-secnos: section number offset
\setcounter{section}{10}

\author{}
\date{}

\begin{document}

\hypertarget{sec:first}{%
\section{This is a test}\label{sec:first}}

This is the first section, and we should see an offset reference to
\cref{sec:first}.

\end{document}
tomduck commented 4 years ago

Thank you for reporting this Issue. I have fixed it in pandoc-secnos 2.2.1, just released.

Cheers, Tom