I use <$hn> as Title Prefix and have a document structure like this:
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 22.214.171.124. 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:
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.)
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
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…)
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]
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?
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.
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?