-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: figure caption counter #83
base: master
Are you sure you want to change the base?
fix: figure caption counter #83
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Yes, that was my fault. I somehow forgot to instantiate the counter: basically because I deliberately copy/paste the counters from tables (also not instantiated), and because for me, the numeration works fine without the counter initialization (at least for simple examples). So:
|
Previously, figure and table captions were always numbered as 1 when nested inside certain tags, such as `<center>`. This commit ensures correct sequential numbering.
47aad95
to
a361ab9
Compare
Yes, this includes the tables. I also add
Below, you can find a minimal working example. The enumeration breaks when nested inside certain tags, such as <!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://latex.now.sh/style.min.css" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">
<header>
<h1><span class="latex">Test</h1>
</header>
<main>
<article>
<center>
<figure><figcaption></figcaption></figure>
</center>
<center>
<figure><figcaption></figcaption></figure>
</center>
<center>
<figure><figcaption></figcaption></figure>
</center>
<figure><figcaption></figcaption></figure>
<figure><figcaption></figcaption></figure>
<figure><figcaption></figcaption></figure>
</article>
</main>
<script async defer data-domain="latex.now.sh" src="https://plausible.io/js/plausible.js"></script>
</body>
</html> This will render as follows |
Thanks for this example. So, I think this particular error, and the reason because my simple examples did not fail, is because counter "scope". I should remind you that |
Yes, I know it is deprecated; however, I believe many users of |
Hi again @andywiecko. I don't know very well what you mean by:
But to encourage a deprecated tag will be a really bad markup practice. At this moment, I think the easiest way to center figures would be something like <figure>
<img style="margin-left: auto; margin-right: auto;" src="..." />
<figcaption style="text-align: center;"> [...] </figcaption>
</figure> Moreover, I'm pretty sure that, if finally @vincentdoerig decides that some mechanism should be implemented to center/align figures/tables/text, it will be done through CSS classes. A good point to discuss then, will be the CSS method used for the alignment: "margin-auto" or "flexbox" (taking into account the possibility of horizontally aligning various images in the same figure, for example). And the problems because of LaTeX/HTML differences must not be forgotten. One thing that I don't like with current captions is that they are displayed with a different layout: figure captions are displayed using all the document main text area available, while table captions are limited to table width. That doesn't happen with LaTeX |
Previously, figure and table captions were always numbered as 1 when nested inside certain tags, such as
<center>
.This commit ensures correct sequential numbering.