tomduck / pandoc-fignos

A pandoc filter for numbering figures and figure references.
GNU General Public License v3.0
331 stars 25 forks source link

Feature Request: Custom seperators #67

Open gepcel opened 5 years ago

gepcel commented 5 years ago

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.

tomduck commented 5 years ago

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.

gepcel commented 5 years ago

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

tomduck commented 5 years ago

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 commented 5 years ago

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.

anti-destiny commented 2 years ago

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.