create hidden text, similar to Microsoft Word

Is there an ability to create Hidden Text, similar to Microsoft Word?

I’ll explain my aim so that, even if Scrivener does not, you can suggest how I might proceed. Otherwise I’ll have to write my book in Microsoft Word.

With my forthcoming very-complex book, I aim to create a shortened simplified version, somewhat like the book’s skeleton with minimum pared-back flesh.

With Microsoft Word, I can write the entire complex book, and set the complex portions in hidden text, such that simplified booklet is visible when I hide the complex portions.

The context is that the more complex book is for management and academics, while the simplified version is for … well, simpler people.

Can Scrivener do anything like that? If not, is Uncle Keith willing to add that feature? Or do I have to go back to the Dark Side?

Absolutely, at least in intent and capability of output—I’d say Scrivener is even superior to Word on this account (if I understand the limitations in how you describe it), since Scrivener’s system is algorithmic instead of binary (hidden vs. not). What you hide can be a complex multi-factor search result through keywords and so on. You can do interesting stuff like only compiling out sections that are marked as needing rewrites.

But to get back to the basics :slight_smile: You can test this theory really easily. Just make a blank project, add three things to it, and use labels to colour two blue and one pink. Now load up Compile, click on the Contents pane, and add a filter at the bottom to exclude pink items. Now enable and disable the filter. That’s how easy it is to have two editions embedded in one tree.

Scrivener’s own user manual project, which you can download from our support page would be a practical example of how you can do that with three intertwined text trees. The user manual is written once, for both Windows and Macintosh. They use a shared pool of text, which means any improvements, rewrites and fixes generally fix both at once. However, as you can imagine there are many divergent areas. The Mac version is a lot older, for one, so that means there are a lot of chapters and sections in the manual that don’t appear in the Windows version. There are cases where that happens in inverse as well. The Windows version does some things that produce chapters you won’t find in the Mac manual. So I have three streams of text that need to be blended two different ways: neutral (always there) and the two platform specific types.

The concept is simple, you just switch the label type that is being excluded. In the example, you could add a fourth unlabelled item, go back to compile, and experiment switching the exclusion from pink to blue. That’s all that is going on here, just on a much larger scale in the user manual. :slight_smile:

Within the text itself, I also mark out phrases that should only appear in one or the other. The entire manual is peppered with those, because every keyboard shortcut is different, and often menu labels and such are different as well. You may not need that level of exclusion, but I figured I’d point it out in case you do.

Now, a caveat with that project specifically is that it uses MultiMarkdown for the actual text construction. Structurally, though, at the project and compile settings level, you can see most of the important concepts behind this idea:

  • Have some piece of meta-data you can easily sort between advanced and simple sections of the book. This can be a keyword, whatever. I used label because you can tint the icon with that and it makes it really obvious which portions of the book are Mac or Win specific.
  • In the Contents compile option pane, enable the filter setting and exclude out all of the items not pertaining to the compile target. They will be selectively removed from the Contents list visually, you can preview the results in the main table above.

As for excluding phrases, if you need that, I would not recommend what you see in the Scrivener manual. It’s a somewhat outdated technique for MultiMarkdown. Differently coloured annotations won’t help you out much unless you are using something like Pandoc or MultiMarkdown. Then what you compile is actually a sort of script, and you can cause it to do simple logic transforms. In other words, the document I compile, in conjunction with its stylesheet, knows how to omit Mac phrases from a Windows target and vice versa.

Without that, you could probably cook up something using Replacements. The Scapple manual will have more interesting ideas in that regard. One could for example, invent a fake syntax like <simple>this phrase only appears in the simplified version</simple>, and just cause it to vanish with a Replacement that converts it to empty. In the case where that does print, the preset’s replacement would instead just strip the tags and replace the whole range with the stuff in between the invented codes. It’s pretty straight forward, just like search and replace, but without damaging the original copy, it only happens to the compiled output. Again, check the Replacements for the Scapple project for ideas.

As for working this way, compile aside, I think it’s pretty useful within the writing area, too. You can for example filter out items with that label using search, and read through sections without them to see the “simple” view. You can’t actually directly hide elements within the Binder, but using collections and searches you can effectively do so.

And yet another Ioa post to add to my list of Scrivener bookmarks…

Hi Amber

Thanks for your awesome post. This labelling feature is what I need.

Can you fast-track me by pointing to where in the Scrivener Manual I can go through the basics of what labels are, and how to apply them? I searched through the Manual, but the word label is used throughout the Manual, and couldn’t seem to find where the basics are explained. I tried to fiddle with Scrivener itself, but couldn’t figure it out.

Also, is there any way to apply labels aside from using colors? I’m not enthused with the prospect of every sentence of my manuscript having to a different color. It would be a distraction, and a departure from the normal writing experience of black text on white screen, where ordinarily only important things are colored.

Oh no, labels are colours you would assign to the section itself, not the text. The text looks like every other piece in the work. You’re just tagging that section with a colour. So anything you write into that section would be omitted from the simple version, for example.

Labels are visualised as coloured swatches or pins on the corkboard, can be shown in the outliner, and through the View/Use Label Color In/ sub-menu, a variety of interface components, such as the binder icon (as shown in the user manual), binder background row, etc.

To set the label for an item, view it in the editor, and then click the Inspector button in the toolbar, the blue ‘i’ on the right side. You should see the label control in the middle. You can set up the labels for your project from this control.

Hi Amber

After experimentation, I can apply labels to sections, and exclude these during Compilation.

However, I’m still not sure on the practical steps needed to exclude parts of paragraphs.

In your initial message, from your words “Within the text itself, I also mark out phrases” onwards, can you describe how that is done? and refer me to relevant parts of the User Manual? How do you mark our phrases? What then? Which menus are used to mark out phrases?

Also, as a suggestion for future versions of Scrivener, it’d be nice to be able to apply these filters in the Full-Screen composition mode. e.g. in my simple and complex book paradigm, it would be great to be able to see the simple-book in Full-Screen mode. Right now, the only way I can view the simple-book is to compile, and read the compiled document.

You can already view non-linear items together in a Scrivenings session. At the very least you can just Cmd-click on some sections and they will show up in the editor (which you can then take to Composition if you prefer). Sorting by significant columns in Outliner mode is another good way to select a block of related items.

A slightly more industrial use would be in conjunction with Project Search, or even as saved searches, using collection tabs. There is a lot of depth there in this area of Scrivener, I couldn’t explain it all in a paragraph—suffice to say it is a non-linear editor at heart. Focussing on just a portion of the work and omitting other parts of it is second nature to the software. Just gradually learning the tool will probably help you incrementally as you go on.

Once you apply the understanding that a Scrivener book (or whatever) is really a bunch of little pieces, and knowing that these pieces can be viewed together in isolation from one another, and in combination with each other, means you can do all kinds of interesting things, like filtering out everything with a certain label, using Project Search and then using those search results to form a Scrivenings session.

Before answering all of that, do you need a three-way system such as used in the manuals? If all you need is a binary on/off switch for some text, then there is no reason to emulate the Scapple user manual. It will be far more elaborate than the solution needs to be. That’s because Scrivener’s compiler already has a way of marking text that can be excluded, using inline annotations (18.1 in the user manual). Just highlight the text that should be removed, and mark it as an inline annotation.

When it comes time to compile you can choose to leave them in or have them removed, in the Footnote & Comments compile pane. You’ll want to export them as inline, no enclosing marks, and probably have them coloured black in the text editor so they don’t look red on output. :slight_smile:

The reason the user manual is much more complicated is that Scrivener’s inline annotation toggle is all in or all out. I can’t say, just show pink ones, or just show ones with starting with “MAC:”. But I can do all of that with programming. So most of the user manual production really happens long after I’ve compiled.

If you are interested in learning that method, again, I recommend using the Scapple project as an example to learn from. I would point you to the info file at the top of the Binder, that should have enough to get you started in several lines of research, or if you already know what that stuff is, then you may be pleased to know that Scrivener supports it.

In my simple-book/complex-book paradigm, you have already shown me how to hide/reveal whole paragraphs by treating each paragraph as a section that can be labelled. Now, I just need to know how to hide certain portions within paragraphs. In the example below, the part which follows the slash marks // are the complex part that are to be hidden from the simple-version:


e.g.
Governments need to invest more in public transport such as metro train networks.// Fine examples of such extensive train and subway networks are found in London, Paris, Berlin, Tokyo and New York.


Hence, in the simple-book, I’d want to hide the portion after the // marks. I can’t do that by labeling sections since the two sentences are in the same section.

For my simple/complex versions of my book, I don’t think I need anything beyond the above.

In the method that you will describe, will I use the method together with labeling of sections? or will it be used as an alternative method of hiding the complex-book portions?

Okay, yes, then I agree you don’t need the complex solution here, just one that lets you toggle some text on and off.

The two methods work together. One handles section level omissions, the other handles phrase level omissions. I wouldn’t suggest trying to use either to handle the other’s role. You maybe could, but it would be awfully messy.

I’ve attach an example project with some explanation in the Document Notes pane.

Hi Amber

When you say you’ve “attached” something for me, is that by email to me, or attached to the post on the forum? I didn’t receive any attachments.

I don’t know enough about Scrivener to take what you’re written and run with it. I’m searching for baby-step instructions on how to mark out phrases to turn on and off in the complex and simple versions of my book.

Here’s the quick-and-dirty way to use inline annotations to optionally hide text during compile.

Highlight one piece of ‘complex’ text that needs to be optionally hidden.
Go to Format->Inline Annotation (or use the keyboard shortcut; it’ll be worth learning that if you have a lot of this text).
Now that the text is highlighted in red as well as it having a bubble outline, right-click (or ctrl-click) on the annotation to bring up a contextual menu. Select Text Color->Black (assuming you don’t want that text to stand out in the compiled document. Otherwise, choose whatever color you want it to be). Now that color will be used for new annotations throughout your document and in the compiled output.

In the compile window, go to the Footnotes & Comments section.
If you want to strip out the annotated text, then check “Remove inline annotations”.
If you want to keep that text, then leave that check-box un-checked, and also remove the [ ] characters from the “Inline annotation enclosing markers” text boxes.

And here is the attachment I failed to attach earlier. :wink: This is a simple .scriv project. Just unzip it somewhere convenient, and double-click to load.

It demonstrates what Robert described. It has a working example along with the two difference compile results.
using_annotations_as_filters.zip (67.2 KB)

I was pondering this last night, and one thing about the solution bothers me. Will the annotations marked as black be explicitly black (as opposed to having a default text color)? If read as an epub/kindle book on a tablet that can reverse the colors of text & background, this could cause the annotations to be impossible to read in that mode.

<An alternative to using annotations then, would be to surround your complex text with some kind of brackets.> In the Replacements section of compile, having it search for:
<.+?>
… with the “Regex” checkmark enabled, and replace with nothing would eliminate the complex text.
To enable the complex text, you could just strip away the brackets by putting the following into the Replace column (Regex enabled):
[<>]
and nothing in the With column.

You’d probably want to create two saved presets, one for the “easy” and one for the complex versions of your document using each of these replacements as appropriate, but probably not until you’ve settled on the rest of your compile settings first.

Amber, when using the Inline Annotation method, can the annotated portions be hidden in the Full Screen Composition mode? The reason is that I’d like to read the simple-book in an editable mode.


Robert, using the Inline Annotation method, I turned off the colors as you described, or rather set the colors to be black. Then I compiled it into amazon Kindle .mobi format, and it seemed to read fine in Kindle with all the text in black color. So that approach seems to meet my needs.

p/s I spoke too soon. I had problems compiling the Inline Annotation to Microsoft Word format. The problem was that the Inline Annotated text, when compiled into Word format, appeared as the numeral 1 in square brackets. i.e. instead of text, there appeared this … [1]

Amber, any comments on the problem of compiling Inline Annotations to Microsoft Word format?

I had no problems when compiling to PDF.

That’s a good point, if the target will eventually be digital instead of print then one may need to strip colours out of the text after compiling.

No, and there likely never will be on account of technical limitations. The text engine we use has no architecture for allowing portions of text to be hidden safely. In my own experience however, this has never really got in my way. I don’t use the technique heavily enough for it to be difficult to read a text two different ways in my head when encountering a special range.

That is thanks to in part the material (most of these are just keyboard shortcut alternations, so that’s no big deal), but it is also a deliberate choice. If I encounter a section that would require a thick mess of exclusions then I don’t even bother with annotations. I just duplicate the section and write two different versions into parallel binder items with alternating labels. Just select the right tool for the job when you need it and you should be okay.

Did you copy the settings that I provided in the same project? That was set up to produce a copy that would work well in Word. It compiles to RTF and inline annotations are printed inline without enclosing markers.

Hi Amber, am I correct to assume that the settings are those found in the Preferences of the Scrivener file you attached? If so, what settings? My background is that I viewed all the online video tutorials at the time, but this thread has taken me into an area of Scrivener that’s out of the basic comfort zone.

On the same compile settings location where you can include or exclude inline annotations, there should be a pair of text boxes with the brackets in them. Remove the brackets from those text boxes (described in my instructions above), and they won’t appear around your annotations anymore.

My main concern wasn’t when your reader was using black text on a white/neutral background, but when the app was set to “night-time mode”, or similar that turns the background black and the text white/some light color. If you have that kind of mode on any of your e-readers, you may find that the annotations remain black when the text is turned a light color.