Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Custom Counter Style #22

Open
samueldodson opened this issue Jul 29, 2016 · 4 comments
Open

Feature Request: Custom Counter Style #22

samueldodson opened this issue Jul 29, 2016 · 4 comments

Comments

@samueldodson
Copy link

samueldodson commented Jul 29, 2016

Hi, @tomduck. Can I customize the counter style of figures and figure references? A counter-style variable could be used to set the style:

counter-style: Roman

Styles could be:

arabic -> 1, 2, 3, ...
alph -> a, b, c, ...
Alph -> A, B, C, ...
roman -> i, ii, iii, ...
Roman -> I, II, III, ...

Thank you.

@khalid-hussain
Copy link

We can also add a slightly more enhanced style as well.

Example:
heading.figureno -> 1.1, 1.2, 1.3, ...

@ghost
Copy link

ghost commented Jan 6, 2018

How the numbers are presented is presentation logic and really belongs in the application responsible for rendering the result. The application could be ConTeXt, LaTeX, CSS (in case of HTML), and so forth. While it would be convenient to put it in the Markdown, it seems to move away from the separation of content and presentation.

@tomduck
Copy link
Owner

tomduck commented Jan 14, 2018

This is a very good point, @DaveJarvis. I know this is easy to do in LaTeX, but I'm not sure how I would do it in CSS -- or if the pandoc-fignos html is written correctly to take advantage of this possibility. Can you comment further?

@ghost
Copy link

ghost commented Jan 15, 2018

Consider the following Markdown document:

1. Line 1
1. Line 2
1. Line 3

Converted to HTML:

<ol><li>Line 1</li><li>Line 2</li><li>Line 3</li></ol>

With CSS, you can change how the number format is presented to the reader throughout the entire document:

ol {list-style-type: upper-roman;}

Now, arguably, if you wanted to convert only one list in the document (instead of all lists), you'd have to find a different way to style it. This might mean marking up the document a little differently to describe the intent of the section, such as:

::: algorithm
1. Line 1
1. Line 2
1. Line 3
:::

This becomes:

<div class="algorithm">
<ol><li>Line 1</li><li>Line 2</li><li>Line 3</li></ol>
</div>

And it's trivial to change the CSS for only that single list accordingly:

div.algorithm ol {list-style-type: upper-roman;}

ConTeXt is syntactically different, but the concept is the same.

I don't know if pandoc-fignos is written to take advantage of this possibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants