Categories
general

Scrivener stuff, 2026 edition

 

I write my books with Scrivener. I have since 2011. It has a daunting learning curve, and I feel like I used 10% of the features on my first book with it, and slowly gained maybe 2% per book. I’ve previously written posts here and here on tips and tricks. I’m not trying to make this a “make big money self-publishing your books!” blog, but I have a need to write this stuff down so I don’t forget it and can find it later. So, here’s another crop of answers for you. Caveat emptor: there are probably better or more preferred ways of doing this. I just beat things until they work.

OK, here we go, in no particular order.

Show the number of files in a folder in the binder

View > Outline > Show subdocument counts in binder. (There is also a View > Outline option at the top of the View menu, which is confusing.)

Show where the current scriv is in the binder

Navigate > Reveal in Binder. Or Cmd-Opt-R. Memorize that; I use it 50,000 times a day.

Exporting keywords

  1. Create a blank text document.
  2. Open the keywords (Project > Show Project Keywords, or Cmd-Shift-K)
  3. Click the first one; shift-click the last one.
  4. Drag them into the blank text document. This exports a comma-delimited text list of the keywords

Adding your own icons

  1. Go to https://www.iconsdb.com and download a 32x32px PNG.
  2. Right-click an item in the binder,
  3. Change Icon > Manage Custom Icons, and add your PNG. Note the name in the menu will be the name from the PNG, so rename the PNG accordingly.

WordPress import

  • You can drag HTML files into the Research section of Scrivener, but not Draft.
  • After they are dragged in, they are uneditable web archives. Go to Document > Convert > Web Page to Text
  • There was a wp2epub plugin that would also do html, but it’s broken in new WordPress versions, hasn’t been updated in 167 years.
  • Tried WP2Static for this… it was slow so I stopped
  • There was an XSL for this see https://www.literatureandlatte.com/forum/viewtopic.php?f=19&t=34656&p=223492#p223492 but it no longer works, I get errors.
  • This is horrible but you could export WordPress to Jekyll…
  • Another option: https://wordpress.org/plugins/aspose-doc-exporter/ – couldn’t get this to work
  • wp2static – crashes
  • I might have to do this again soon, so stay tuned.

The delete comment bug

If you add a comment to some text, then remove the comment and edit the text, the hyperlink text comes back, but with no attached comment

Workaround: highlight the text, delete the comment, cut the text, then Paste and Match Style it back.

Background image

Scrivener 3 – change the background image in compose mode: Project > Project Settings > Background Images (this moved since 2)

Searches and collections

You can turn on and off viewing collections with View > Hide Collections and View > Show Collections. Normally I turn them off because it drives me nuts to have them there and waste space in the binder.

But, here’s how you use them.

  1. Do a search on the project, Cmd-Shift-F
  2. Search on something fun, like do a search on a keyword or a status
  3. Click the magnifying glass to the left of the search term again. Scroll all the way to the bottom and select Save Search as Collection.

Now, that search is going to be in the Collection part of the binder. It’s also going to be dynamic. So for example, if you have a keyword for a character (or whatever) and you save a search as a collection, that collection will enable you to quickly pull up that list of documents.

Numbering problems

This is confusing, bear with me.

Let’s say you have a book that’s three acts and a hundred scenes in each act. You want each act to have a title page, and then each scene is its own deal.

Then let’s say you want number the scenes, like with a number at the top of each one. What’s going to happen is the title page is 1, and your first scene is numbered 2, and you probably want it to start at 1, right?

  1. File > Compile
  2. Select a Format in the left column (or create a new one).
  3. In the right column, set all of the scrivs to a section type. For this example, I’m using Chapter Heading and Scene, plus Front Matter for stuff that’s not part of the book itself.
  4. Click Assign Section Layouts. Select Scene.
  5. (Tip: if you do this 19 times in a row because you keep changing this, it will always open at the first section type. You’re inevitably not editing the first section type. You open it, you’re in the first type, and it doesn’t look right, and you’re sure this stupid program burned you again. It’s because you’re in the wrong section type. Always click the right one first. This is annoying that it doesn’t persist your selection, but here we are.)
  6. Pick a layout for the Scene. Hover over it and click the pencil in the upper right to edit it. Then click Edit <whatever> Layout.
  7. If you’re using a number and a title, click Title Options and in Title Prefix, put <$n:scene>. Don’t put <$n> or it will increment when the title pages are incremented.
  8. If you want only a number, don’t do that. Go to Prefix, and in the Section prefix, put <$n:scene> and center it or whatever you need to do.

Start numbering at 0

We get it, you studied computer science.

Use a placeholder <$n-1> instead of <$n>. Or <$n:scene-1>. Internally the counter is still 1, 2, 3 etc. But when you display it, you are subtracting one so it’s 0, 1, 2, etc. (It doesn’t actually modify the value of the counter. It just displays it one lower.)

Yes, Scrivener doesn’t call them variables. They’re called placeholders. If you’re searching their manual, it’s called a placeholder, not a variable. I’ll use the words placeholder and variable once again so this actually shows up in search, like it doesn’t in their manual. Placeholder=variable.

How many comments are in my document?

grep -r "Comment ID" my-book-file.scriv/Files/Data | wc -l

Let me know if any of these are helpful or blatantly wrong. Like I said, I don’t always know what I’m doing, but I’m sure I’ll need to know the same exact thing later.

Categories
general

Diego, Zuzu, SSL, WordPress

I went to show someone my web site yesterday, and the SSL certificate expired a month ago. (And every modern web broswer freaks out about that, and prints warnings and blocks everything and acts like I’m scraping credit cars and stealing identities, even though there’s nothing here that could do anything involving any PII whatsoever.) That shows how on top of things I have been here. I haven’t even thought about the blog in months. I mean, it’s mid-March and I don’t even think it’s 2026 yet. I’ve completely lost the thread on time. Anyway.

Diego
Zuzu

First big news is that we adopted two cats last month: Diego and Zuzu. They are brother and sister, from the same litter. But Diego is like twice as big. He’s all muscle, incredibly strong and fast, constantly moving. Zuzu is tiny, all fluff, and absolutely beautiful. Diego was pretty outgoing from the start, and has bonded more to Sarah, sleeping on the bed every night and following her around. Zuzu has been extremely skittish, hiding in the closet and always running away, but she’s slowly made progress. Diego is very protective of her, and they play well together, despite the size difference. It’s been great to have companions again, even if they’re tearing the house apart at 2am every night.

I have to admit there is a slight bittersweet feeling if comparing them to Squeak and Loca. They were both very cuddly, especially in their old age. And Loca was my soul cat, and would spend all day and night with me. I can’t even pick up Zuzu right now, and Diego is not a cuddler. Maybe that will change as they get older, but thinking about the years with Loca and the reality that she’s gone is still painful.

* * *

Speaking of pain, I had to renew that SSL certificate, and a two-second job turned into like five hours of hurt. There’s this big schism between bncert and certbot and I think I started with bncert last year, then tried to get certbot going, and it completely screwed my site. Lots of panic, tons of floundering, and I could not get it to work. I eventually got the HTTPS stuff going and the permalinks were screwed up. Any configuration of the .htaccess made it worse. I don’t know what I did, but I eventually beat it enough to get it back to operational. But I will forget all of this, and in six months when the cert expires and the auto-renew script fails, I will screw it up again. (Note to self if you find this in August: don’t start chasing certbot; you used bncert.)

Anyway, if you find broken anything here, let me know.

* * *

Nothing else. Giant release at work, which I won’t talk about here, but that was 100% of my bandwidth for a while. Trip booked for first week and a half of April, but I still need to flesh out what I’m doing. It’s not to any current war zone, but who knows how much that will change in the next month.

I’m currently heads down with Atmospheres 2. Every month since like a year ago, I said I would wrap it up in a month. I think I’m close to that, or at least I want to get a feature-complete draft by the time I leave on April 2. It’s getting there, but it’s over 500 pages now, so it’s a slow process. I think I started this book in 2014, so I really need to end it. Also, I have published 19 books, and I don’t want the 20th to be some dumb compilation zine thing, so I really need to keep on this until it’s done.

Nothing else. Everything else. I’ll try to remember I have a blog before the summer is over or whatever.