On 07/01/2011 1:30 PM, Joel Schwartz wrote:
Hello Lyx Users,I'd like to find a way to type paragraphs so that the first sentence of the paragraph is automatically in bold font and everything after the end of the first sentence is in "standard" style. I've typed the paragraphs in this email in this style so you can see what I'm trying to do. I searched through the user's guide and the keyboard shortcuts under Tools-->Preferences and didn't see any command or style that looked like it would do this. So for now I've been selecting the first sentence of each paragraph and typing Ctrl-B. Not only is this tedious, it is exactly the opposite of the lyx philosophy! What I'm hoping for is a way to type a keyboard command in the same way as for other styles (for example, "Alt-P 3" to get a subsection heading) and have the paragraph then be automatically formatted appropriately. Does anyone know if there is a way to create a style that bold's only the first sentence of a paragraph? Is there such a style already and I've just missed it? I'm a relatively new lyx user (and I know virtually nothing about LaTex) and would be grateful for any advice you can provide. Best Wishes, Joel
Learn how to do it in latex first. Then everything is possible with lyx.
In latex this sorts of work:
\d...@catchfullstop#1.#2\@gobble.{\textbf{#1.}#2}
\def\myboldparagraph#...@catchfullstop#1\@gobbl...@gobble.}
It defines a command \myboldparagraph{...} which catches the first full
stop (.) and puts that sentence in bold (the \textbf{#1.} part). What
follows (#2) is in normal font.
The next step is to learn about lyx layout and/or module files: How to introduce the above latex code into your document preamble, how to create a lyx paragraph style, and how to associate this paragraph style with the \myboldparagraph command. This you find in LyX's customization manual.
Good luck! -- Julien
bold-paragraph.pdf
Description: Adobe PDF document
bold-paragraph.tex
Description: TeX document
