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

Messed up with Figure numbering #14

Closed
xxks-kkk opened this issue Dec 29, 2021 · 1 comment
Closed

Messed up with Figure numbering #14

xxks-kkk opened this issue Dec 29, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@xxks-kkk
Copy link
Owner

include sphinxcontrib.pseudocode will mess up the figure directive numbering. As an example, before using the sphinxcontrib.pseudocode in conf.py, we have

image

But, after using the sphinxcontrib.pseudocode in conf.py, we have

image

@xxks-kkk xxks-kkk added the bug Something isn't working label Dec 29, 2021
@xxks-kkk
Copy link
Owner Author

Around this line

self.body.append(" — ")

xxks-kkk added a commit that referenced this issue Jan 3, 2022
** Why is this change required? **

When numfig is set to true, figure directives are automatically
numbered. However, before this fix, the caption of figures is
overriden and the automatically numbering is gone. This commit
fixed the issue (also listed on github
#14).

** How does this change solve the issue? **

Instead of using nodes.caption directly (also with override when
add_node, which causes bug), we create a subclass pseudocodeCaption
and use it instead.

** Does this commit cause any expected behavior to change?  If so, what? **

** Issue: **

** Design Docs: **
@xxks-kkk xxks-kkk closed this as completed Jan 3, 2022
xxks-kkk added a commit that referenced this issue Jan 3, 2022
** Why is this change required? **

When numfig is set to true, figure directives are automatically
numbered. However, before this fix, the caption of figures is
overriden and the automatically numbering is gone. This commit
fixed the issue (also listed on github
#14).

** How does this change solve the issue? **

Instead of using nodes.caption directly (also with override when
add_node, which causes bug), we create a subclass pseudocodeCaption
and use it instead.

** Does this commit cause any expected behavior to change?  If so, what? **

** Issue: **

** Design Docs: **
xxks-kkk added a commit that referenced this issue Jan 3, 2022
** Why is this change required? **

When numfig is set to true, figure directives are automatically
numbered. However, before this fix, the caption of figures is
overriden and the automatically numbering is gone. This commit
fixed the issue (also listed on github
#14).

** How does this change solve the issue? **

Instead of using nodes.caption directly (also with override when
add_node, which causes bug), we create a subclass pseudocodeCaption
and use it instead.

** Does this commit cause any expected behavior to change?  If so, what? **

** Issue: **

** Design Docs: **
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant