---------- Forwarded message ---------- Date: Thu, 4 Oct 2007 12:31:57 -0400 From: Steve Litt <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: Use cases for charstyles (Was: *not* everything is an inset!)
On Wednesday 03 October 2007 18:20, you wrote:
Hi Steve, There's a discussion going on among the developers that's related to character styles. I wonder if you could give us some use cases of character styles... How would you use them?
Hi Christian, For instance, in my "Troubleshooting Techniques of the Successful Technologists" book, I use a character styles (created with Dekl Tsur's color workaround -- real character styles didn't exist in 2001) to make specific phrases stand out -- specifically, each of the ten steps of the Universal Troubleshooting Process. I believe they were both slanted and large and maybe bold. In my newest book, "Learn Vim Tonight", I have a character style I apply to "ex", when it represents an editor as opposed to a command (I use my code char style when it's a command). My character style applies a funky, loosy goosy typeface. In the case of my ex character style, one could argue that it should really be a LaTeX command. Yeah, if my document were written in LaTeX that would be true, but in LyX you want to see the word ex in its proper font in both the LyX and PDF environments. Likewise, one could argue that I should just use a monofont for words like "enscript" or "ls" or "/etc/sysconfig", but that argument, which I've heard as long as I've been on the list (2001 I think), is contrary to all styles based documentation, and spits in the face of WYSIWYM.
Will a character style always cover a single word?
I could forsee cases where it would cover only part of a word. Also, in every other authoring product a character style can be applied to any number of adjacent characters, regardless of existance of spaces or punctuation, so I'd imagine LyX should follow that policy.
Multiple words?
Yes, I've used it many times where it covered a phrase comprising multiple words. It must be able to cover multiple words or my books will break :-(
Can character styles overlap?
That's a discussion I'll leave for the developers, other than saying I've had cases where I wanted to apply two different character styles to one piece of text, and have it "do the right thing", always assuming I defined the character styles right. For instance, if code style is monofont and names style is bold, combining them would make bold monofont. Once that ability is given, however, I don't care which of these is done: <namestyle>This is a name<codestyle>both name and code</namestyle>this is code</codestyle> or this <namestyle>This is a name</namestyle><namestyle><codestyle>both name and code</codestyle></namestyle><codestyle>this is code</codestyle> If you're doing XML, I'd assume only the latter is legal, but in the PDF (and probably in the LyX screen) they look identical. Another use of character styles that I feel must be preserved is the ability to take text typed into LyX, and use it in a command -- usually to set a variable. I do that a lot. Once again, I want to thank the developers for putting in character styles. Doing so made LyX useable in the long term, instead of something to do a couple books before going to docbook or OpenOffice (eeuuuu) or some other technology. Before LyX character styles existed, you wouldn't believe the hoops I'd jump through just to do stuff I'd taken for granted in WordPerfect in the 1980's. As far as I'm concerned, the way character styles work in 1.4.2 works very well for me. Please feel free to continue using me as a sounding board. LyX is a vital part of my business. Thanks Steve Steve Litt Author: Universal Troubleshooting Process books and courseware http://www.troubleshooters.com/