pandoc-fignos icon indicating copy to clipboard operation
pandoc-fignos copied to clipboard

Feature Request: Custom seperators

Open gepcel opened this issue 5 years ago • 5 comments

There are two kinds of separators in figure caption I'm talking about. The first is the one between section number and figure number. The second is the one between figure number and figure title. For example (red color in the image): image

Separator 1st: the one between section number and figure number

As the image demonstrates, the 2nd figure of the Chapter might be numbered as "Figure 1.2", and the 2nd section might be numbered as "1.2 Section2". I'm sure this is what has been used widely for a long time and thus is the default behavior. But it would be better that this separator can be customized, for example, "Figure 1-2", even better "Figure 1.1-2" with a chapter_depth parameter.

Separator 2nd: the one between figure number and figure title

I'm not sure why, but most documents I'm dealing with require a blank space as a separator. For example "Figure 1-2 Something", sometimes like "Figure 1-2. Something".

If you are interested in this, but lack of time, I can help with something.

gepcel avatar May 16 '19 02:05 gepcel

Thanks for this suggestion, @gepcel. My first step will be to look into how LaTeX handles this problem.

Note that there is a similar Issue for pandoc-tablenos.

tomduck avatar May 16 '19 19:05 tomduck

Yeath, LaTex is the difficult part for me. I actually have made it works in docx for my own use.

gepcel avatar May 17 '19 00:05 gepcel

The second separator is now configurable in the pandoc-fignos 2.0 beta release. To install it run

pip install pandoc-fignos --upgrade --pre --user

This is a new major release with some incompatibilities to the 1.x series, so please be sure to have a look at the 2.0.0 documentation first.

tomduck avatar Jun 28 '19 02:06 tomduck

For future reference:

  1. This post on StackExchange gives the TeX needed to change the number separator.

  2. This post on latex.org describes how to achieve the second variant of the number separator. It is not exactly full customization, but maybe what is needed. Note that the \counterwithin command comes from the chngcntr package.

tomduck avatar Jun 28 '19 02:06 tomduck

Hi! I'm glad that the second separator is now configurable.

However, it seems not fully customizable. For Chinese users like me, we prefer using ":" as separators instead of ":". (They are quite similar but different.)

Would you like to make pandoc-xnos to support more languages? I would like to provide translations of Chinese words if it's in need.

The second separator is now configurable in the pandoc-fignos 2.0 beta release. To install it run

pip install pandoc-fignos --upgrade --pre --user

This is a new major release with some incompatibilities to the 1.x series, so please be sure to have a look at the 2.0.0 documentation first.

anti-destiny avatar Feb 17 '22 12:02 anti-destiny