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

Referencing objects which are not tables or figures #21

Open
OliverPStuart opened this issue Mar 17, 2021 · 2 comments
Open

Referencing objects which are not tables or figures #21

OliverPStuart opened this issue Mar 17, 2021 · 2 comments

Comments

@OliverPStuart
Copy link
Collaborator

Description:
In chapter 10 there are two objects, programs and boxes, which are included in the original textbook cross-referencing. These are not integrated into MyST's cross-referencing architecture. It's possible to integrate them, by using the MyST {admonition} directive for boxes, and {code-block} for the programs. If these are given :name: attributes, they can then be referred to using the standard [text](reference) cross-referencing method, which is fine, but it can't be integrated into the automated numbering system, and so it leaves this open to guesswork, which isn't ideal.

Using the {code-block} directive also creates a pseudo-figure-title for the code-block, and names it as a "listing":
Screen Shot 2021-03-17 at 2 51 31 pm

Problem

  1. There is no way to integrate boxes and code-blocks into the automated referencing.
  2. Code-blocks are automatically labelled as a "Listing"
@mikheyev
Copy link
Member

There are several ways of referencing of objects including a fairly custom way of just using a reference name/number.

E.g.,

{ref}`text <label>`

@OliverPStuart
Copy link
Collaborator Author

OliverPStuart commented Mar 19, 2021

Yep but the problem is that they need to be integrated into the automatic numbering somehow, otherwise they'll need to be manually referred to with chapter numbers etc. at the very end once everything is built at the end.

They're listed as Box 10.1,10.2, Program 10.1. etc., and they are cross-referenced across chapters, so automatic would be the simplest method, otherwise we can leave it and do it at the end.

Currently, if I use the numbered

{numref}`Box %s <box_10_1>`

The output is "Box %s" just as text without the hyperlinked reference.

The problem for the programs is that code-blocks can be integrated into the automated referencing, but that gives the code-block the automatic caption of "Listing 7.1".

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

No branches or pull requests

2 participants