Auto numbering Images

Ja
Jai
Posts: 4
Joined: Sat Apr 04, 2015 5:18 am
Platform: Mac + Windows

Sat Apr 04, 2015 5:22 am Post

Hi, One of the things that would be so amazing is if there was some way to add self-numbering images. So I could say, add an image to a section which is part of a group and in the text I want to reference that image, if I re-arrange the sections and the image reference would change and be formatted based on a single source of image formatting, that would make life so much easier.

Thanks,

Online
User avatar
KB
Site Admin
Posts: 19148
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Apr 04, 2015 9:48 am Post

Hi,

You can already do this using auto-numbering tags. Take a look at the Placeholder Tags List in the Help menu. But you would use the following format:

Number: <$n:tagName:itemName>
Reference: <$n#tagName:itemName>

E.g:

Code: Select all

[An Image]
Figure <$n:img:birds>

Refer to figure <$n#img:birds> above, and also see figure <$n#img:bees> below.

[Another Image]
Figure <$n:img:bees>


Note that in the above example, "n" gives the number type (1, 2, 3), "img" is an arbitrary tag you have selected to identify this numbering stream (you might have another that uses <$n:table:itemName>, for instance), and "birds" and "bees" is a tag you have selected to identify the particular image. When compiled, this would become:

Code: Select all

[An Image]
Figure 1

Refer to figure 1 above, and also see figure 2 below.

[Another Image]
Figure 2


If all this looks a little ugly in your text, you can set up a replacement in Compile. For instance, suppose you set up the following replacements in Compile:

Replace: #img:#@
With: <$n:img:#@>

Replace: #imgref:#@
With: <$n#img:#@>

Then the above example text could instead be written as:

Code: Select all

[An Image]
Figure #img:birds

Refer to figure #imgref:birds above, and also see figure #imgref:bees below.

[Another Image]
Figure #img:bees


All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

Ja
Jai
Posts: 4
Joined: Sat Apr 04, 2015 5:18 am
Platform: Mac + Windows

Sat Apr 04, 2015 10:31 am Post

Thanks Keith, that does exactly what I was after. It's just that I have not used Scrivener as extensively.

while on the topic, I tried to export the same to word, it does not export that in the final form but instead as the raw form. Is there a way to export to word in the compiled form? It is kind of connected to the other wishlist item, where I can write my chapters and content in Scrivener and then export it to word for uploading to the publisher's intranet?

Online
User avatar
KB
Site Admin
Posts: 19148
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Sat Apr 04, 2015 1:55 pm Post

How are you exporting? You need to use File > Compile... File > Export is for exporting individual files to get work out of Scrivener, and it doesn't support any of the tags. Compile is Scrivener's main work horse for creating a document (whether a Word document, a PDF document, an e-book or whatever) for sharing with others, and it's Compile where all these tags get converted.
All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

Ja
Jai
Posts: 4
Joined: Sat Apr 04, 2015 5:18 am
Platform: Mac + Windows

Mon Apr 06, 2015 2:41 am Post

:D
Cool... I did not export as doc/docx format. Thanks, this is amazing.

gl
glupilogin
Posts: 2
Joined: Mon Jul 27, 2015 3:07 pm
Platform: Windows

Mon Jul 27, 2015 3:11 pm Post

Is this supposed to work with windows version as well? I have troubles with it.

Separate autonumbering for tables and images (that I will place in openoffice after the document is compiled) is a priority #1 feature for my thesis wrinting.

Could you please help me out? Im on a trial version now and can't switch from msword if this is not working :(

otherwise I like the idea of how scivener works

User avatar
AmberV
Posts: 20579
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Jul 27, 2015 8:44 pm Post

Complex numbering streams have not been fully implemented on Windows yet, sorry for that.

But I am not quite clear on how this would be a major problem for you given how you have described your intentions for the life of the document. You mention that you’re going to be using OpenOffice to insert the figures and tables—surely the best approach would be to use real captions right then and there, and let those captions handle the numbering, rather than using sequences of formatted paragraph text made to look like a caption with a baked in number that won’t react to editing changes after you compile, no? I mean, ordinarily I’d recommend that approach anyway if you anticipate the document living on for some time after you’re done with the principle writing in Scrivener.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

gl
glupilogin
Posts: 2
Joined: Mon Jul 27, 2015 3:07 pm
Platform: Windows

Tue Jul 28, 2015 7:09 am Post

Amber thanks for your reply.
Maybe, indeed I lack some workflow knowledge here...

Im writing my PhD thesis graphs and tables are prepared in other programs and will pasted when the text is ready. The thing I dont know how to control is, references within the text to apropriate tables and graphs. Thats my main pain.

If I place a barchart somwhere (well, in scrivener I would reserve a blank line for it and put a caption below) - how can I make reference to it (say in next chapter) and control proper numbering? If manual is the only way to go, that would be a problem.

Sorry for my english

in
intermedia
Posts: 1
Joined: Thu Sep 10, 2015 12:52 pm
Platform: Windows

Thu Sep 10, 2015 4:17 pm Post

I have just tried the image referencing technique on my recently purchased windows scrivener, but it does not appear to compile:

<$n:img:bees>

I would prefer to do all the image importing and referencing within Scrivener rather than having to do it as another phase of activity in word/office libre.

Can someone confirm whether this feature is only available on the Mac version, and if so, is there a work around within Windows Scrivener?

Many thanks..

User avatar
AmberV
Posts: 20579
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Thu Sep 10, 2015 11:26 pm Post

Yes, as noted above, “complex numbering streams have not been fully implemented on Windows yet, sorry for that.”

I would prefer to do all the image importing and referencing within Scrivener rather than having to do it as another phase of activity in word/office libre.


You can definitely put figures into the document and mark them. But if you want real captions and cross-references, even Scrivener for Mac doesn’t do that. You’re going to have to edit the document page by page post-compile anyway to get images arranged nicely on the page in most cases anyway, to avoid awkward breaks and such.

Alternatively you could pick up the practice of writing with MultiMarkdown. This plain-text approach to writing will let you place images and use real cross-reference and automatic numbering from something as simple as a flip phone with a text editor. It’s all I use to write, I haven’t messed with WYSIWYG style writing since the mid–90s. It’s not for everyone though.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Di
DimNC
Posts: 10
Joined: Mon Nov 27, 2017 4:19 pm
Platform: Mac

Mon Nov 27, 2017 4:27 pm Post

To go further with auto-numbering, is it possible to refer to the page in which is something?
For instance, in my text, I talk about a figure which is in the appendices. Is possible to refer to its page number?

Code: Select all

C.f., figure <$n#figure:birds>, first appendix page <$p#figure:birds>.

[In the first appendix: the figure]
Figure <$n:figure:birds>

Of course, the <$p#img:birds> part doesn't work, but is there a way to make it work?

[edit] By the way, first post, not in the correct section of the forum…  :D

User avatar
AmberV
Posts: 20579
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Nov 27, 2017 5:15 pm Post

It should be noted that at this point in time there is another method that can be used to automatically number captions: styles. This method removes all mechanism from the editor, keeping the source copy clean and easy to read. The attached project demonstrates the method:
  1. In the main editor, you will see that we’ve merely marked captions using the Caption style.
  2. Open File/Compile... and double-click on the “Caption Numbering” format in the left sidebar.
  3. In the Styles pane, select “Caption” if necessary, and examine the Prefix/Suffix field.
    The auto-numbering code has been added to the style itself, meaning that whenever you compile, any text assigned to “Caption” will automatically have “Fig. <$n:figure>: ” added before the text you see in the editor.
  4. Click the Test... button to generate a print preview.
The downside to this method is that since caption numbers are procedurally generated, it would be difficult to cross-reference them. I made an attempt, with the other compile format in that project, and a document that I set to be excluded from compile. The full style approach doesn’t quite work as it looks like style prefixes are added after forward-reference codes are evaluated. But although that fully-styled approach doesn’t work, one could use still use the idea provided in the second example for the figures themselves, and contrive some other way of generating <$n#figure:key_name> (including of course just typing it in).

DimNC wrote:To go further with auto-numbering, is it possible to refer to the page in which is something?

Not in Scrivener, it doesn’t know what page an image falls on.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Di
DimNC
Posts: 10
Joined: Mon Nov 27, 2017 4:19 pm
Platform: Mac

Mon Nov 27, 2017 5:22 pm Post

AmberV wrote:It should be noted that at this point in time there is another method that can be used to
DimNC wrote:To go further with auto-numbering, is it possible to refer to the page in which is something?

Not in Scrivener, it doesn’t know what page an image falls on.

And what if I refer to the page and not necessarily something on the page?
Since it's possible to insert a link to another part of the document, I thought it'd be possible to have the page number of the part.

User avatar
AmberV
Posts: 20579
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Nov 27, 2017 5:53 pm Post

Sure, you can link to a section in most cases, Scrivener can do that because it places a token at the section break that it can later calculate the page number from, and for word processing files it uses a bookmark referencing code that does that automatically in the word processor. The method is to type in the page number code: <$p>, select the code in entirety, and create a document link pointing to the section you want to reference.

So by extension, if your figure was in its own document by itself, that would be a way of referring to by page—or if you were happy with the link being general to the section the figure is contained within, then linking to its document in the above manner would work.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Di
DimNC
Posts: 10
Joined: Mon Nov 27, 2017 4:19 pm
Platform: Mac

Tue Nov 28, 2017 11:30 am Post

Thank you very much AmberV!
I'm not sure I'm doing it right. The <$p >  thing works, it displays the correct page, but, once compiled, when I click on the link, I have an error sound and it does nothing.

But, I'll check in the manual before asking here, I think I'm missing something.
Last edited by DimNC on Tue Nov 28, 2017 2:25 pm, edited 1 time in total.