So, I am trying to add Chapter Header Images to my compile for PDF so I can upload it on the overlord site. But the settings I put in the prefix (this <$img:<$custom:Image>;ebook=80%>) which i found here; Scrivener 3 for macOS Follow-Along: Using Images for Chapter Titles - Literature & Latte , does not in fact work for the PDF. So I went and found a youtube video for a similar thing but different metadata format (here https://www.youtube.com/watch?v=b4lTEvz5KQs ) which also did not work. Is there a specific wording I need to use in order to make the images work in a PDF? If so, what? If there isnāt a way to make this work, please let me know. I have been at this for two days now and Iām getting super frustrated.
See Section 15.6.5 in the (Mac) manual for image placeholder tag syntax. There should be an actual file name in there somewhere.
Iām not on mac, that link was the only one I could find at the time for what works to put chapter header Images on scrivener. Sorry, I should have clarified I am on windows.
The placeholder syntax would be the same on either platform, and there should be a corresponding section in the Windows manual. Without some kind of file name, how is Scrivener supposed to know what image to use?
Could you be more specific about the failure behavior youāre seeing? If you donāt see the image, what do you see?
Also, what happens if you compile to another format, such as Word?
(Moving thread to the Windows support area.)
When I compile, the image is not there. it is a blank space. And not enough space to be the image. Iāve compiled it in rich text file and that also yielded no images as chapter headers. Compiling it in word also yields no image where the chapter header should be.
The only thing I edited in Compile is the prefix in ātitle optionsā option. which is where i wrote <$img:<$custom:Image>;ebook=80%> . The custom images have been added to the document. Iāve labeled them the same as the chapters they are to be added to. I added custom metadata where it links it to the image I want to appear. But it wonāt show up in anything that would āPrintā. It only shows up in the Epub file.
Use <$img:Image_name;w=width;h=height>
with a valid path to an image in the Binder or on your hard drive.
This also works with Replacements to make the image file path shorter and distinguise between file types like jpg and png.
Iām going to try this right now and see if it works! <3 that you solved my issue
Again, this is not a file name. It will not work. Whatever source you got it from was incorrect.
okay, then that opens up to a different problem. As I have different images for each chapter header. So how would it work if iām only inputting one image name for the chapter headers?
I got it from the tutorial on how to add images to my chapter headers on the blog that I linked in my original post. It works but only for ebook it seems.
Ok, I see how itās supposed to work. The <$custom:Image> should be picking up the image from each chapterās custom metadata. If itās working for ebooks, Iām going to assume that the metadata is set up correctly.
What happens if you just drop the ā;ebook=80%ā part?
Dropping the ā;ebook=80%ā doesnāt change anything.
am I putting the width and height in inches or pixels. because so far just typing <$img:<$custom:Image>;<w=2.5;h=2.55> is not changing anything either. Am I supposed to say px or in after the numbers?
Like, it doesnāt change anything from what has been happening. It still shows blank chapter header images.
Pixels. But did you also add the image path, name and extension in the Custom Metadata of the chapters?
You should create a Custom Metadata entry called"Image" of the type Text, and it should be filled with the complete path and image name for specific chapters.
Just to clear up a few points of potential confusion:
-
The imageās identity does not have to be a full valid path. The criteria for that is described in the user manual, Ā§15.6.4, under subheading, Image Identification. One method is indeed a path, but the other is to give the name of any image imported or linked into the binder, by its binder name (sans extension, you donāt have to know the file type when using that method).
-
That text, whether it be a path or a binder title, does not need to be manually typed in by you. Since it is text, it can be generated from other placeholders (<$custom:Image>), or modified by Replacements (like ābaseNameā ā ābaseName-HighResā).
A tip for ādebuggingā compound placeholders like this is to put a backslash in front of any placeholder you donāt want to trigger, so that you can have a look at the rest. For example:
\<$img:<$custom:Image>>
would cause the outer image placeholder to not be interpreted, which will allow you to review whether<$custom:Image>
is creating text in the fashion you expect. We might want to see something like<$img:/Volumes/Research Data/Images/name_of_image.jpg>
, or just<$img:name_of_image>
if it is in the binder. But if we get<$img:>
then we know something isnāt right with this chapter elementās custom metadata. -
As noted in the section below this, on how to use width and height, the āebookā setting is useless outside of ebooks (ePub). The units of measurement are given in this section. However in general I wouldnāt recommend stipulating a size here, and instead striving to have the images sized the way they should be from the start. Graphic design programs will do the complicated math for you, of figuring out how many points are in an inch, depending upon the desired DPI of the image. Brute forcing that with the placeholder will likely produce suboptimal DPI.
Demo
Iāve attached a sample project that demonstrates two different working methods.
custom_image_headings.zip (194.8 KB)
Demo notes...
- In the first group, āAutomatic Sequentialā, if you click through those three chapters youāll see nothing is entered in the āImageā custom metadata field, over in the inspector on the right. Weāll be looking for image names based on a sequence, or automatic numbering, instead.
- The second group, when clicking through each of the three, will list one of the graphics in the corkboard by name in this āImageā field.
- Also note the Section Type is different between the two groups. Weāll use those to assign different test Layouts that work as described above.
- In Compile:
- Double-click on the āImage Headingsā compile Format in the left sidebar to edit.
- In Section Layouts youāll find the two basic setups, with the important stuff being done in the Title Options: Title Prefix field.
- For the automatic image numbering method, weāve named the images in our folder according to the convention that will be used here, so that the compiler produces āchapter_image-1ā, āchapter_image-2ā and so on.
- The custom image layout is using the exact same method you are using.
Give that a test compile. You should find all six images come out as expected.
Okay, on your demo version, where it says āinclude in compileā section type. both have different section types. and mine is only chapter heading. I tried to change that to ācustom imageā after editing the āsection typesā and adding ācustom imageā but that did not change anything after compiling. I removed the width and height from the prefix of the compile.
I donāt understand this. Am I supposed to put this in the ācompileā to test this? or somewhere else? i tried typing \<$img:<$custom:Image>>
in the compile prefix and iām still not getting anything in placement of the chapter header image.
Itās an example rather than a solution. I donāt know enough about what you are doing to make something that would work automatically. It almost sounds like you just changed the name of your Section Type expecting that to work, but thatās just a name. Feel free to go on using āChapter Headingā if thatās what you had, it makes no difference though. What matters is whether you have a custom metadata field called āImageā, and have the title prefix set up to use it (that part, it sounds like you have set up right).
i tried typing
\<$img:<$custom:Image>>
in the compile prefix and iām still not getting anything in placement of the chapter header image.
Well no, that would specifically not create an image, but thatās the point of the exercise. It would print the text so you can see what is going on with it. Maybe the path is wrong, maybe there is no path at allā¦
I would suggest making an example like this, of what youāre trying to do, and posting it so we can take a look and see why it isnāt workingāeither that or weād need a lot more information to go on, because you said you arenāt getting anything, when if you did what I described you should at least be getting text. Something is way off if you arenāt getting anything.
Okay, I copied and pasted the first chapter to a new doc. added my photo to a folder in the doc to do the metadata stuff. and after compiling i am getting the same issue where the āheadingā is still blank. How do i share the example?
Upload the Project or a zip-file/backup at the bottom-right of the editor in this forum. The icon is a harddrive with an arrow pointing upā¦
Yes, the Back Up āø Back Up To...
menu command is the easiest way to make a zipped copy of an open project. You can then drag and drop that .zip you made into the composition window when typing a response here, or use the little hard drive button as AntoniDol described.