I want to have inline code snippets in my InDesign document. Similar to how StackExchange does it, like this
. So the gray background is perfect. Basically I just want to highlight certain text. But I can't figure out how to highlight text or have certain text within a text frame have a different background.
I know I can anchor a text frame inline within a text frame. But then I have to size it just right, which is a real pain when I'm constantly changing the text too.
UPDATE: is there really no way to highlight text in InDesign? Seems crazy. By the way, I'm using the latest InDesign CS5.5.
Answer
You can make a table from the top menu Table > Insert table
into the text frame with settings:
Body rows: 1
Columns 1
Header rows: 0
Footer rows: 0
After that just paste you text inside that table and you can style the table all you want.
and table options can be found from the top menu Table > Table options
or Table > Cell options
It's not perfect, but it should do it. I don't know if CS4 or CS5 have better solutions for this.
The not perfect part is that if you make the mistake of resizing the table manually, the minimum height changes into the manually set height. ( Not a big problem though. )
Edit:
In that case you might want to either use Character styles (or Paragraph styles)
Both can be found from the top menu: Window > Styles >
- Make a new Character style, select some text and go to that character styles settings by double clicking it.
- Then in the settings either use Underline or strike trough.
- Give similar to the following settings: The idea is to make a line that covers the area of the text and then offset it to the right position. ( Underline and Strike through are both set behind the text so this makes a background for the text. )
This also isn't perfect because if you change for example the font-size.. you will have to get back to the Underline settings to re-set the underline.
No comments:
Post a Comment