vortispicy.blogg.se

Spine numbers
Spine numbers






spine numbers

Var paragraphNumbersStyle = "Paragraph Numbers" var numberedParagraphStyle = "Numbered paragraphs" The fourth line is the text that will show up in your Undo menu (“Undo Add paragraph numbers in margin” it will say) you can change that too if you want, to anything you like.

spine numbers

Change the three style names at the top to match the names you’ve used in your document.

#Spine numbers code#

If your paragraphs (and their numbers) change after you’ve run the script, just run it again – it will first remove all the frames with the Paragraph Numbers object style applied and then add in new ones to replace them.Ĭopy the entire script below into a text editor ( not a word processor like Word, which will likely mess it up – I’d recommend Visual Studio Code, but any code or plain-text editor will do). That should leave you with something like what you’re looking for in my example, this: It just so happens that I needed to do a similar thing not too long ago and wrote a script that does more or less that for that, so I could just adapt that script for your use case here (see below).Īdd the script to your scripts panel and double-click it to run it. When you’ve done this, you can use a script to insert an anchored text frame at the beginning of each of these paragraphs, containing the paragraph number.

spine numbers

Once you’ve got this all set up, go through your entire document and make sure that all the paragraphs that should be numbered have the correct style applied. You may also want to specify some Size and Position Options to make sure that the frame inserted is big enough to contain the number (I just used “Adjust: Height and Width” and gave it a width of 12 mm and a height of 7 mm). Or in simpler terms, ‘place the frame so it’s 6 mm from the outer edge of the text block’. Note the checkmark in “Relative to spine” and that the reference point of the object (the anchored frame) is towards the spine, while the reference point for the positioning (the page margin) is away from the spine – in other words, I’m telling it to use the point on the anchored frame closest to the spine and position that point relative to the page margin furthest from the spine, at a distance of 6 mm. The only things you really need to set up here are the paragraph style (the one just made in the previous point) and the anchored positioning options which control the frame’s positioning on the page, relative to the paragraph it’s anchored in they should look something like this: I’ve chosen to align them away from the spine, so that numbers of uneven length (i.e., ‘5’ vs ‘192’) will always appear at the same distance from the text block ( Edit: This is wrong – the text should be aligned towards the spine, not away from it, to achieve the desired result, so ignore that bit of the screenshot):įinally, I set up an object style for the frames that will hold the actual numbers. Next, I set up a paragraph style to be used for the actual numbers – the main thing here is whether to align the numbers towards or away from the spine. I’ve added a character style for the paragraph marker as well, just for show:įilling a spread with placeholder text, that gives me this: Both are left-justified and essentially identical, except that the style for the numbered paragraph is bulleted (and has no first-line indent), using the paragraph marker as the bullet (if you already have an actual paragraph marker as plain text in all the paragraphs you want numbered, you can just skip this). In my example here, I’ve set up a document with facing pages and some basic paragraph styles – I’ve just used and made a style based on it to use for those paragraphs that should be numbered (in case you need both numbered and unnumbered paragraphs). The easiest way to do this is, I think, by setting up some paragraph and object styles to automate the layout as much as possible, and then use a script to add in the numbers in anchored frames attached to each paragraph.








Spine numbers