I was afraid you'd say something like that. I'll just add LaTex to the list
of languages I need to learn--right behind R, Python, Javascript, XML, ...
I'll come up for air in a few years and get back to you :)

But in all seriousness, thanks Julien for taking the time to write LaTex
code that gives the appropriate formatting. I think the next step would be
to add code that would end the bold font after not only a full stop ".", but
also after an exclamation point "!", colon ":", semi-colon ";" or question
mark "?". 

I haven't gotten beyond the tutorial and user's manual yet, so I don't know
when I'll have the expertise to take this any further. Indeed, I decided to
try lyx to make my life easier so that I could spend *less* work time trying
to format my MS-Word documents and more time doing analysis, reading, and
writing. 

Nevertheless, I have little doubt that trying to figure out how to write
LaTex code will be a lot more fun (or at least a lot less exasperating) than
trying to point-and-click my way to a properly formatted MS-Word document.
If I figure something out I will post it here. But I'm also crossing my
fingers that some enterprising soul with LaTex and lyx expertise will beat
me to it (hint, hint).

Joel



 

-----Original Message-----
From: lyx-users@lists.lyx.org [mailto:lyx-us...@lists.lyx.org] On Behalf Of
Julien Rioux
Sent: Friday, January 07, 2011 2:55 PM
To: lyx-users@lists.lyx.org
Subject: Re: Is there a lyx style that bolds only the first sentence of a
paragraph?

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


Reply via email to