How do you use Keywords and Search features?

Hello. Someone probably asked the same thing before, but I could not find any relevant references on this forum after a few searches, so I am writing to ask this basic question. I read the manual, but was not exactly sure how to use the keywords function, probably because of the difference in expectation / intuition as to how to use this “keywords” tool.

For example, I opened up the ‘Interactive Tutorial’ project, and typed “keyword” in the ‘Search’ box. Nothing appears in the search result, despite of the fact that I see the word “keyword” used at several locations in the tutorial document.

Also, I was expecting that “keywords” would work like book indexing on the back of a book (I found out that Scrivener won’t work this way in this forum, after purchasing the upgrade to 2.0.)

Could someone explain how the ‘keywords’ and ‘search’ functions work in Scrivener, like trying to explain it to a beginner? Is there any tutorial video on this topic? It is not very intuitive to me. Thank you in advance.

Most likely the search criteria was set to search in just the Title or some other area that never mentions the word “keyword”. Click the little magnifying glass in the search tool and check to make sure it’s set to “All”. While you are there, note you can set the search criteria to “Keywords”, use that search mode to only search for keywords (which might otherwise appear as words in your project).

Right, of course, in Scrivener there aren’t any page numbers with which to construct a list of page hits like in a normal index. So where an index entry in a technical book might list a half dozen pages in which that particular term is addressed, in Scrivener the analogous method is to open the Keywords HUD (in the Window menu, for now, but this will be moving to the Project menu in the future). You can think of the HUD as being your “index”. Each term in use by the project is listed, and to see which “pages” (really, Binder documents) are associated with that keyword entry, select it and click the Search button. This uses the Project Search tool from above, but it sets the search criteria to Keywords for you, so you don’t get false positives.

While it isn’t a list of page numbers, a list of documents is pretty much the same thing once you boil it all down to usage—and like an index, keywords are something you have to specifically set up, that is rather the advantage of them. Rather than returning every single instance of the word “Lens” in the book (which of course you can do if you want), you get only those special cases you’ve curated yourself.

So in fact you aren’t too far off the mark. While there isn’t an “index” feature in Scrivener, Keywords are indexes in all but implementation details.

Thank you very much, Amber, for explaining things very carefully in detail. I now see very clearly how the functions work! (It is strange that I couldn’t figure this out on my own… I see the logic of the function now.)

Is there a way to make Scrivener create index pages like ones on the back of a technical book, by adjusting some parameters from the ‘Compile…’ command, after page numbers are set? Does Scrivener accept any scripting for the modification? I am thinking of using Scrivener to write a technical book (a tutorial book for computer programming in a certain language,) and indexed command list would be very useful for a reader. (I saw an example of technical books written by using Scrivener on the website.)

(I am also looking for a command to create a text box within a page, to highlight source codes in the book. I should search the manual and the forum before asking anything about this here, but would appreciate any quick pointers on how to go about this task.)
–> I think I might be able to use the ‘Table’ function for this, and color its background (without the border line.)

Again, thank you very much for your support.

I’d say there are two answers to that. First: if you are at all familiar or comfortable with LaTeX, then you can take advantage of Scrivener’s MultiMarkdown->LaTeX workflow, which of course can readily handle all of the pieces of a book that a technical manual requires. You’ll need to do a little tweaking to get index entries as the MMD syntax does not support it out of the box, but that’s not hard to do. Same goes for call-outs and other special case typesetting. The technique I use in the manual for the tip boxes just uses Scrivener’s inline annotations to mark out box contents, and I’ve got the scripting back-end set up to intercept those and convert them to the necessary LaTeX structure.

Second: if you are going the word processor route, then you’ll need to just handle this in the same way that most do, using Scrivener to write the content and another tool or more to do the final production typesetting. Scrivener isn’t a typesetter or a layout engine. It’s focus is on the hard work you have to put in before all of that is necessary to address. So what most people do is insert little markers that they can search for later in your desktop publishing program or word processor.

I can think of some ways you could kind of make an index, but honestly it would be way more trouble than it is worth. Might as well just use the right software for the job rather than apply inflexible and difficult to use hacks.

But in short: you’ll most likely find, as most others have, that if you try and use Scrivener as a publishing engine, you’ll be running into a lot of roadblocks. It’s just not designed for finishing, just as a word processor isn’t really designed for creating a 100,000 word document with ease.

Dear Amber,

Thank you very much for your support.

I have used LaTeX a little, but am not an expert (yet.) I will learn how LaTeX workflows would work on Scrivener for the purpose. Would you recommend any references on MMD for a biginner? Thank you.
(Well, I see many topics under the MMD forum. I’ll look into those first.)

Run some searches for Replacements in the MMD forum for some good tricks for inserting LaTeX code into the compile. MMD lets you do that if you wrap the syntax in an HTML comment, so what you can do is something like setting up a Replacement that looks for “^@$^” and replaces it with “$@”. The $@ token, when used in a Replacement, lets you grab anything in between the two terminator markers in the first field. So in this case, a word wrapped in caret symbols, like ^so^, will be matched by the compiler. The replacement field specifies that the value of the token be placed twice, once inside the \index code and the second after it so that it remains visible in the final print, like “\index{so}so”.

That’s just one trick that will keep your source document clean looking and easy to type in.

Otherwise, learning MMD itself is pretty easy. I’d go over the basic Markdown itself from Gruber’s web site, Scrivener’s documentation in the manual, and download Fletcher’s MMD documentation. With Scrivener you don’t have to worry about much of the technical details as it will handle all of the integration for you. Normally you’d have to produce a text file with MMD in it, run a command in the shell and pipe the output to a .tex file. With Scrivener all you have to do is select the “MultiMarkdown->LaTeX” compile format and you’ll get a .tex file a few seconds later.