Table Number Question

I use <$hn> as Title Prefix and have a document structure like this:
Chapter: 9
Sub-heading: 9.1
Section: 9.1.2

I have tables in some sections and subsections . I would like to number all the tables in Chapter 9 as Table 9.1, 9.2, 9.3, etc irrespective of the sub-section levels they are in. In other words, I don’t want something like Table How can I do this?

Unless I am mistaken, there is no way to abbreviate <$hn>. But:
You should be able to put <$hn> in the metadata of the top file, and using links, have this included wherever you would otherwise have put <$hn>…

So: <$hn> in your chapters’ root document’s metadata.
Use <$Custom:…> linked to the current chapter’s root document + <$n>.
This way: “Table <$Custom:…>-<$n>” → will give you “Table 6-1 … 6-2 …” etc; no matter what <$hn> would normally have returned.

→ Insert <$rst_n> at the end of your chapters, to reset <$n> for the next chapter. (Or put it at the start of the chapters, whichever.)

If that doesn’t do (if <$custom:…> gets replaced by <$hn> that ends up being in turn replaced not by the linked document’s level but by the current document’s), well… then beside numbering your chapters’ top document in the metadata manually, I don’t know…

Else (assuming that it’ll work), if you plan on compiling only parts of your project while wishing the numbering to keep with what it’d be should you compile the whole thing, you’ll have to compile making your selection from the drop down documents list, and have this option unchecked:

Thanks, Vincent.

Say I have custom metadata PN <$hn> set up in the chapter title page Chapter 10.
How do I refer to it on another page, say Section 10.3.2? Something like <$custom:PN:Chapter_10>?

It needs to be <$Custom:TheNameYouGaveYourCustomMetadataField>.
Then, selecting that placeholder (like you’d select normal text in the editor), link to the root file of your chapter. (You don’t have to do anything though for that placeholder when it is already in that root file.)


Select + right click:

P.S. Metadata is text type.

Once you’ve set that placeholder in a sub-chapter, you can just copy/paste it everywhere else you need it inside that same chapter.
New chapter: You’ll have to redo the link so that it points to the proper chapter’s root file.

I recommend that you test-compile a chapter before doing it for all your chapters, in case it rather does what I envisioned as a way for it not to work.

I just tested it :frowning:
It doesn’t work… crap. (It prints “<$hn>”.)

I think you’ll have to do everything like I said, but instead of <$hn>, number your chapters by hand in the metadata… Or just insert 6-<$n> by hand wherever you have a table. (No metadata, no link – might as well…)
Sorry mate.

Perhaps someone has a better solution. I don’t.

Or perhaps using replacements at compile there is a way of tricking the software… (perhaps replacing <$hn> with <$hn> would do it… however ridiculous it may sound. [ ← NOPE]

@drmajorbob is good with placeholders. (I think.)

Or it is something that’s doable but using Latex. That @AmberV would know.

I’ve exhausted all possibilities I can think of.

I can do everything he wants except the back-referencing. Divorcing hierarchical numbering from $hn and binder structure, in other words. That I can do.

This works for me:

For Chapter Heading Page, put <$n:chapter><$rst_table><$rst_figure> as Title Suffix (in Compile)
Make the font size of the Title Suffix to 1 point to hide it
Use Table <$n#chapter>.<$n:table:Identifier> Caption to create the table caption
Use Table <$n#chapter>.<$n#table:Identifier> to refer to the table

EXCEPT: is there a better way to hide <$n:chapter> besides making its font size 1?

Might be a bit uselessly complicated, but:

What if you insert dummy documents, above each chapter, compiling to nothing, but to which you’d put your <$n:STREAMS> instead of in your real chapter’s document’s title ?

You assign them a no separator - no title - no nothing section layout and that’s it ?
And if the fact that the title ain’t part of the layout bypasses the numbering, include the title, but have the font be white and the line super small like you were doing. (1pt) ?

. . . . . .
Or perhaps simply use the section layout’s prefix instead, where the font can be white. (No need for dummy documents.)
All you need is <$n:chapter> to go up +1 right ? That should do it. As well as the two resets.
If you make it 1pt, that won’t offset your page much.

Here is a link to a guide on creating chapter and figure numbering (equally applicable to tables), including tips on how to keep the clutter out of the editor (and what you have to type in):

Thank you, AmberV. This is exactly what I’m looking for, EXCEPT:

I want to use <$hn> for chapter/section labels in the Title Prefix. So I add <$n#chapter:<$level1_title_no_spaces>> in the Title Suffix. But I need to hide it from the compiled document. Any suggestion on how this can be done beside white font or fontsize=1?

Did I not answer that ?
Use the section layout prefix instead (not the title’s) - white font. ?

I’ve responded to your question in the original thread, so as to keep usage and implementation discussions relating to these methods all together rather than spread out across multiple forum threads.

Works. Thank you, AmberV and Vincent.

1 Like