Copy link to clipboard
Copied
I want to define a different paragraph style for footnotes of one and two digits (1–99), and footnotes of three digits (in order to increase the separating space for the latter). Can I find the number of digits of a footnote via GREP?
Or is there a better way to this? I aim to have a hanging indent for the footnote number, and then the footnote text aligned. I currently do this with a 5mm indent for the whole style and a -5mm first line indent for the hanging footnote number, which is separated from the text by a tab set to 5mm.
tntype wrote
Thanks Chad, a shame that footnotes are still treated like an afterthought in the leading page layout application.
They are not, really. (Actually they are, but for other numerous reasons I could list.) What you are after is equivalent to hoping to find the "2" in an automatic page number "123" -- this Just Won't Happen.
But footnotes can be scripted! The following very quickly written Javascript (so save as "jsx") will apply separate styles to 1-, 2-, and 3-digit footnotes. Make sure
...Copy link to clipboard
Copied
The issue of indenting numbered items always comes down to preference. I understand your issue because when you get to 3 digits, the indent required for a single or even double-digit number often looks odd.
The problem is that the footnote number is a variable of sorts and InDesign doesn't find it as a digit it seems. Even choosing the "include footnotes" option in the GREP Find/Change doesn't find them. Honestly, I think GREP is overkill anyway because it's probably just as quick for you to manually highlight footnote numbers 1-9 and then 10 through 99 and apply a new style to it.
Copy link to clipboard
Copied
Thanks Chad, a shame that footnotes are still treated like an afterthought in the leading page layout application.
Copy link to clipboard
Copied
tntype wrote
Thanks Chad, a shame that footnotes are still treated like an afterthought in the leading page layout application.
They are not, really. (Actually they are, but for other numerous reasons I could list.) What you are after is equivalent to hoping to find the "2" in an automatic page number "123" -- this Just Won't Happen.
But footnotes can be scripted! The following very quickly written Javascript (so save as "jsx") will apply separate styles to 1-, 2-, and 3-digit footnotes. Make sure the text cursor is inside the story to process before running it.
oneDigitStyle = "one digit note";
twoDigitStyle = "two digit note";
threeDigitStyle = "three digit note";story = app.selection[0].parentStory;
try {
for (n=1; n<10; n++)
{
story.footnotes[n-1].texts[0].paragraphs[0].appliedParagraphStyle = oneDigitStyle;
}
for (n=10; n<100; n++)
{
story.footnotes[n-1].texts[0].paragraphs[0].appliedParagraphStyle = twoDigitStyle;
}
for (n=100; n<1000; n++)
{
story.footnotes[n-1].texts[0].paragraphs[0].appliedParagraphStyle = threeDigitStyle;
}
} catch (err)
{
/* most likely out of range footnote number, so we don't care */
}
Copy link to clipboard
Copied
Oh, wow. I'm blown away, thank you very much indeed!
Copy link to clipboard
Copied
Yeah I don't know that I can fully blame Adobe for this behavior. After all, they need to keep track of the footnote and it's relationship to the reference. So if you just go changing that number, I can see being able to really screw things up. @Jongware, that's a great script! I just have to remember to create the styles before running it. I'm gong to tuck this into my ID Script pocket for future use 😉
Copy link to clipboard
Copied
Good Morning,
Just found this post, looks exactly what I was looking for but by I have no knowledge in writing scripts.
I tried to copy and paste the script into "ExtendScript Toolkit" app on mac, but I keep get an error.
"Cannot write to file FootnotesFindDigits.jsx!
IOError: I/O error"
I'm sure i'm doing it all wrong,
Can you please help?
Thank you,
Shlomit