Some of my posts on the blog are tagged with "wishlist", obviously because it explains some of my feature wishes for future versions of InDesign. One of the posts explains my wish for being able to mark up the same text with multiple character styles, and also explains some of the workarounds that could be used achieve it.

The need for tagging things with multiple character styles has for me not always just been to apply styling, but also for using the style as a "marker" for future reference. E.g. in a specific project I am currently planning, where we are preparing a huge launch of a new Bible translation with many different editions. Here we wan't to prepare the InDesign files for new different future editions as well, tagging all kinds of different text. E.g. "words of Jesus", "words of God", "names", "places" etc.

Digging into InDesign's different possibilities for marking up text - XML tags, character styles, color swatches, conditional text - only conditional text allow you to mark up the same text with more "tags" of the same kind.

For multiple index purposes, the best solution is "nesting" the indexes, by creating "level 1 topics" for each index, and adding the index references under them. Then by generating the index all the indexes will be generated, and you can just delete the ones you don't want in the edition.

Script for marking text with multiple character styles

To make an alternate solution for applying multiple character styles to the same text, other than nested styles, grep styles etc. as mentioned in the wishlist post, I have prepared a script to apply character style formatting to text with specific conditional text tags applied.

First of all, prepare your document with conditional text tags for the styles you want to apply, and for each tag create a character style with the same name.

Preparing the document for multiple character styles by creating conditional text tags and character style pairs.

Preparing the document for multiple character styles

Next you want to apply the conditional text tags to the text you want to format. In this case I have only prepared a "Red" style, and a "Small-caps" style. In addition to these I have made a "Italic" style, which is already applied to some text.

Notice especially the words "voluptatem" and "lacerfernam" that has the italic style already applied, and the word "accus" which is both marked up with the "Red" and "Small-caps" conditional text tag.

The only thing left is running the script, which will result in this:

Result after running the multiple character styles script.

Result after running the multiple character styles script

To explain what just happened - the script finds all text with the conditional text tags applied, in the order of the tags in the conditional text panel. Then the styling of the character style is applied, but the style itself is not applied - so basically the styling is added "locally" and will be removed if the style is later overridden.

Knowing the process can explain issues you might experience - if you make a style/tag pair called "Red" and one called "Yellow", in that order, the "Red" style formatting will applied first, and then the "Yellow", making the text yellow, and not red.

Running the script will not remove the tagging of the text, so if you "run it to soon" and override some styles, you can always run the script again to re-apply the local formatting.

I hope you find use of the script, at least until Adobe hopefully adds real support for multiple character styles!

The script

The JavaScript can be downloaded here: multiple_character_styles.jsx.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.

Based on the principles of my Creating and organising styles article, I have created an InDesign document with a bunch of predefined styles.

The styles are build quite logical and easy to modify.

The styles are build quite logical and easy to modify

The idea is for you to download and get a great head start for creating styles for a project, or simply just to use them for eg. a CV, brochure, newsletter etc.

The template is based on using an OpenType Serif/Sans-Serif mix, and in this case I have used FontFont's Meta Serif/Sans Pro, but can easily be changed to another pair of fonts.

Use the style for creating eg. CV's.

Use the style for creating eg. CV's

Support for multiple levels of bullet and numbered lists.

Support for multiple levels of bullet and numbered lists

Besides directly using or modifying the styles, exploring the file will give you some great ideas of how to achieve different things through paragraph and character styles.

The file contains the following features and more:

  • Semantically named paragraph and character styles
  • 3 subheading levels, with and without automatic numbering
  • Bullet and numbered lists in 2 levels
  • Paragraph with and without indents
  • Drop cap paragraph
  • Quote
  • Table style
  • Text box styles
  • Caption
  • Text formatting styles
  • Footnote layout

Styles for tables.

Styles for tables

The InDesign file contains table styles, character styles and paragraph styles. To import these in another document you need to use "Load All Text Styles..." from the paragraph style panel menu, and "Load Table and Cell Styles..." from the table panel menu.

Download a PDF to see the different styles or download the InDesign file to get started.

The file is made in Adobe InDesign CS4.

In my dream world, all received texts for books etc. is marked up using styles from e.g MS Word. In my real world, that is unfortunately rarely the case.

I have written this script to help in the situations where a long text is formatted quite consistently, different headings are perhaps marked with bold and in a bigger font size, quotations are italic etc.

Walkthrough

I have imported a text file in InDesign, but it is not marked up with styles correctly, and there would be no reason to reuse the current styles. So I will just delete all the imported styles, but preserve the formatting, so the style panels are all clean.

Text is imported and all styles are deleted.

Text is imported and all styles are deleted

Placing the cursor in the text flow somewhere will let the script know what story I want it to work with. Now, activating the script, it will automatically run through all paragraphs in the story, check how they differ from the Basic Paragraph style, and create new one's where needed.

In this case, the only differing thing is the oblique font style.

In this case, the only differing thing is the oblique font style

Each time it has created a new style, it will also check if that style will apply to the paragraph it is checking, ensuring that all the paragraphs with the same text formatting will end up having the same paragraph style.

Furthermore it will also check all text for any local formatting within the paragraphs, so bold text will get a character style, italic text, coloured text etc. Also these will be reused, so where its applicable the same style will be used.

An example of an automatically created paragraph and character style.

An example of an automatically created paragraph and character style

Where you go from the result of a lot of AutoStyles is up to you. I prefer to create new styles, then delete the AutoStyles one by one from the panel, replacing them with the new styles.

The script will unfortunately not do all the hard work for you, but is a great tool in cleaning up messy documents!

The script

The JavaScript can be downloaded here: auto_create_p_c_styles.jsx.

You can add it to your Scripts palette and run it from there. To do that, place the file inside the "~/Library/Preferences/Adobe InDesign/Version 6.0/Scripts/Scripts Panel" folder.

Note that depending on the length of your document, the script might take a while to run.

Known bugs:

  • If the first word of a paragraph is "locally formatted", the script will think that is the "general formatting" of the whole paragraph.

I usually keep all styling that differs from the paragraph styles I have created in character styles, making one for bold, italic, superscript ... text. But sometimes I wish I could apply more than one character style to the same text.

This wish probably originates from my background with HTML and CSS - being used to nest things within each others. When I look at a InDesign document, I see the same structure, character styles are inline objects inside the paragraph styles which are block objects.

Case 1: Superscript and italic text

In this case, I have a document with some text, some of the text are italic, and some of the text are superscript. I have created a character style for both, but suddenly I need to style a letter both italic and superscript. My only option: creating a new character style for this place alone.

Case 2: Coloured text

In this case my text is black, but different sentences are highlighted with a red text colour. Some of the text in one of the sentences are already italic - my only option: creating a new character style for this place alone.

Italicised text that is also marked red.

Italicised text that is also marked red

Some might call my crazy, but I never locally apply any formatting. I don't, because I don't want to risk anything loosing its formatting later in the process, if accidently overrides are cleared.

I thought of some different workarounds, like applying my red character style to the sentence, and then using Nested Style, Nested Line Styles, Drop Caps or GREP Style to apply the italic style to some text, and it actually worked in the different arrangements I tried.

Applying GREP style to text already marked with a character style.

Applying GREP style to text already marked with a character style

After testing a bit it turns out that you can do this as much as you like, applying unlimited amounts (only tested up to 10) of different character styles to the same text, using the 4 different types of nested styles available in InDesign. There is a hierarchy though, Nested Line Styles > Nested Styles > Drop Caps > GREP Style. Applying multiple GREP styles, they are prioritised after position in the GREP Style section, lowest with highest priority.

This is the only workaround I have been able to figure out, and honestly, it doesn't really solve anything, does it? It is a fun feature, and probably can be useful in some cases, but not specifically in the two I mentioned.

So please Adobe, make it possible to apply multiple character styles?