Chapter Header Images for Print

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.)

1 Like

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.

2 Likes

Iā€™m going to try this right now and see if it works! <3 :crossed_fingers: that you solved my issue

Again, this is not a file name. It will not work. Whatever source you got it from was incorrect.

1 Like

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?

1 Like

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.

3 Likes

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.

1 Like

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ā€¦

1 Like

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.

1 Like