Ask Your Question
1

[Writer] Style that automatically bolds first sentence of a paragraph?

asked 2016-10-27 02:13:35 +0200

megaminxwin gravatar image

Hi,

I want to create a style in Writer that automatically bolds the first sentence of a paragraph, in order to create a definition. It'd look something like this:

Definition, n. This is a definition of a word. It is definition-y.

Is there any way to do this automatically via a style?

Thanks.

edit retag flag offensive close merge delete

Comments

I have a similar question here: https://ask.libreoffice.org/en/questi...

EasyTrieve gravatar imageEasyTrieve ( 2019-05-21 07:18:04 +0200 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2016-10-27 03:16:46 +0200

alvarezp gravatar image

updated 2016-10-27 03:19:42 +0200

I tried but didn't find a way.

Usually, for glossaries the best way is to use the List Contents and List Heading styles but this way the "definition" gets in a different paragraph than the "term". You want something more similar to a dictionary instead.

Under HTML I would try making a paragraph float, but this would be unpredictable. Besides LibreOffice doesn't have such functionality anyway; you would need to create a frame for each "term" manually, so this is a no-go.

I tried using "Drop caps" for whole words which lets you apply an arbitrary style, but the interface forces you to use 2 or more lines. If it let you do a 1-line drop cap, you could get the desired effect, except that for words with non-breaking hyphens only the first side of the word gets dropped.

Still, even though this can't be done automatically I recommend creating a Character Style named "Inline term" or the like, setting it to Bold and using it to manually mark your terms, so you can clear your Direct Formattings using Ctrl+M to the whole document without hurting the bold for your terms.

edit flag offensive delete link more
1

answered 2016-10-27 08:26:27 +0200

ajlittoz gravatar image

Unfortunately, there is no solution based purely on styles.

As @alvarezp suggested, you can play with style layers, but only 2 are available (with direct formatting as an extra layer, but it should be avoided):

  • paragraph style: applies formatting to the full paragraph, can be considered as a default for this paragraph
  • character style: overrides the formatting defined in the paragraph style

You then define some "definition" or "inline term" character style for your use case.

Although the Drop Caps idea seems appealing, I don't think it is a viable solution (indepently from the 2-line issue):

  • either a single word can be highlighted,
  • or you manually set the number of characters to highlight

and this setting is shared by all occurrences.

edit flag offensive delete link more
0

answered 2016-10-27 10:52:21 +0200

floris v gravatar image

You can't do that with styles, but you can use a trick to reduce the workload if you are building a glossary or something like that (it's no use for single definitions in the middle of your text):

Insert a two-column table, enter your list of definitions, select the left column and apply the character style Definition, then select the table, convert it to text. The boldface in the Definition character style will stick. If you use direct formatting to make the left column boldface, it will carry over to the entire text after conversion to plain text, at least that happened for me.

Use character styles, as alvarezp recommended, if you ever want to change the formatting for the items, all you have to do is change the character style settings instead of manually updating the formatting for all of your items.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-10-27 02:13:35 +0200

Seen: 492 times

Last updated: Oct 27 '16