[Solved] Looking for a Description List style

Discuss the word processor

[Solved] Looking for a Description List style

Postby rudolfo » Wed Apr 02, 2008 3:31 pm

I need something like a description list (LaTeX and HTML have it), but OOo
has only bulleted and numbered list. Are there any plans to add something
like that in the coming releases?

Currently I am using a work-around: A paragraph with no indent for the
first line and a single tab stop with the same length as the left indent:

Code: Select all   Expand viewCollapse view
The item  TAB  explanation follows here and might span over
               several lines


I still want the item to be stand out in bold, so I have to manually
apply a character style to the part before the TAB.

I had to apply this to an existing plain text document (actually it was a
MS Word document, but its styles were screwed up totally, so I decided
to export it to plain text and start from scratch in OOo using copy and
paste from the plain text file), hence I got tired of selecting and clicking
Ctrl-B quite soon and planned to use a macro for this purpose.

But the search&replace part in the macro did not work for me.
(See 3947 [Solved] Negative regular expression search for TAB)

Maybe a solution with a two column table might be okay as well, but
I personally don't like tables if they are not used for table data
and in that special case the behaviour for longer items might be not
what I want:

I prefer to let the long item overlap into the descriptive text instead
of increasing the indent (aka width of the first column).

Any ideas?
Last edited by rudolfo on Thu Apr 03, 2008 12:12 am, edited 1 time in total.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Looking for a Description List style

Postby Hagar Delest » Wed Apr 02, 2008 3:44 pm

You can ask for new features (see [Tutorial] Reporting bugs) but this is rather specific.

For new items, you should create an AutoText based on an existing item, then, insert one by just typing the shortcut and hit F3 but to apply the formatting on existing items, that's another story I guess.

OOo works with paragraphs so it should be rather difficult to have a paragraph with different settings.
LO 6.4.6 on Xubuntu 20.04 and Windows 10.
User avatar
Hagar Delest
Moderator
 
Posts: 29078
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Looking for a Description List style

Postby acknak » Wed Apr 02, 2008 4:15 pm

Are you asking how to do this, or are you asking for a style or other automation to support this?

You can certainly create this kind of formatting with Writer, but you can't "automate" it in any way.

As for doing the conversion, I tried that with the sample document as well. Here's an efficient method:
1) Find and Replace > Search for: ^([:alpha:]|[ ])+\t, Find All
That will select the beginning of paragraphs that have a tab (including the tab).
Now, with the F&R dialog still open,
2) Search for: ^([:alpha:]|[ ])+, Options > Current selection only, Find All
Now you have effectively de-selected the tab.
3) Apply character formatting to the "dictionary terms". I defined a custom character style called "_D_Term".

The actual indenting is just a simple hanging indent paragraph style; I used a custom style for that also, "_D_List_Item".

PS: Sorry, I'm used to calling it a "Dictionary list"--just force of habit, "Description list" works as well.
Attachments
Dict_List.odt
Dictionary list sample
(10.76 KiB) Downloaded 220 times
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Looking for a Description List style

Postby foxcole » Wed Apr 02, 2008 5:33 pm

I simply use a borderless table for this, and I have it in an AutoText item. Very easy to use, very easy to control. I see no reason to complicate things by trying to fit everything into a paragraph style! ;) 8-)

The other advantage is that I can use two different paragraph styles for the term column and the definition column. That way, if I want to change the appearance of the terms, for example to put it in boldface or a different font, I can make one change in that paragraph style to reformat the entire list.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
foxcole
Volunteer
 
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Looking for a Description List style

Postby Hagar Delest » Wed Apr 02, 2008 6:19 pm

rudolfo wrote:Maybe a solution with a two column table might be okay as well, but
I personally don't like tables if they are not used for table data
and in that special case the behaviour for longer items might be not
what I want:

I prefer to let the long item overlap into the descriptive text instead
of increasing the indent (aka width of the first column).

And if the longer items span on 2 lines, is it OK?
NB: I agree the table is the best solution IMHO.
LO 6.4.6 on Xubuntu 20.04 and Windows 10.
User avatar
Hagar Delest
Moderator
 
Posts: 29078
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Looking for a Description List style

Postby acknak » Wed Apr 02, 2008 6:59 pm

I also prefer to use a table, but the OP specifically said he did not want the term (left-hand item) to wrap, that it should instead just extend into the descriptive paragraph (right-hand item). I know that is one commonly supported style, so that's what I addressed.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Looking for a Description List style

Postby rudolfo » Wed Apr 02, 2008 9:15 pm

Thanks for your input.

I gave it a go with the table suggestion and added it to acknak's demo file.
I see the advantage of giving the first column it's own style, but i really don't
like the fact that it would do a line break for longer terms.

Looking at both methods I tried to merge them based on a
standard paragraph with indent and a frame anchored to the paragraph (or
precisely on the left of the paragraph). The frame uses automatic column
width to handle longer terms and has a minimum width that equals the indent
of the paragraph. But for the long terms I needed to define a
spacing on the right side of the frame. And this spacing is applied to the
frame not to its contents. So even in those cases where the term is shorter
than the minimum width of the frame, this additional space will be applied,
causing a irritating indent of the first line.

Additional paragraphs do destroy the concept completely. In most cases I would
have only one paragraph for the description part and would rather use a
manual line break (Shift-Enter) instead of starting a new paragraph.

But frankly from all 3 methods this one with the frames takes the most time
to get it done and I am not sure, if you could really speed up, if you store it
in a autotext.
Attachments
Dict_Table.odt
List, Table and Frame
(12.91 KiB) Downloaded 209 times
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Looking for a Description List style

Postby foxcole » Wed Apr 02, 2008 10:58 pm

rudolfo wrote:I gave it a go with the table suggestion and added it to acknak's demo file.
I see the advantage of giving the first column it's own style, but i really don't
like the fact that it would do a line break for longer terms.

I've never used such a narrow column for terms as you have in your example, and I use a small hanging indent for wrapped terms in the rare cases they would require it. Flush left wrapping is not good. But anyway, that's beside the point, I now understand. Not sure why I overlooked that in your first post.

rudolfo wrote:The frame uses automatic column
width to handle longer terms and has a minimum width that equals the indent
of the paragraph. But for the long terms I needed to define a
spacing on the right side of the frame. And this spacing is applied to the
frame not to its contents. So even in those cases where the term is shorter
than the minimum width of the frame, this additional space will be applied,
causing a irritating indent of the first line.

I was able to fix the slight indent of the first entry by adjusting the frame borders. I selected the box frame and a line style of "None" which activated the "spacing to contents" adjustments. Those reduced the extra space to the right of the term paragraph. No more indent of the first line, as you can see in the attached.

rudolfo wrote:Additional paragraphs do destroy the concept completely. In most cases I would
have only one paragraph for the description part and would rather use a
manual line break (Shift-Enter) instead of starting a new paragraph.

For the second paragraph of that entry, one option might be to just insert a tab on the first line. The paragraph style is already set up for that. Another option might be to insert a fresh autotext frame and just not type anything in it. If the frame has no borders or has invisible borders, its presence will not be noticed by the reader. (Of course, these may depend on the publisher's requirements... but I don't believe they're any worse or any better than two soft line breaks.) Just some possible alternatives.

rudolfo wrote:But frankly from all 3 methods this one with the frames takes the most time
to get it done and I am not sure, if you could really speed up, if you store it
in a autotext.

Evidently it's not possible to store a frame plus a paragraph together as autotext. You can autotext the frame and simply apply the paragraph style you want. If you have the styles all set up in your template or default template, I don't see how this would take any more time than any other option...

[Edited... forgot to attach the sample.]
Attachments
Dict_Frames.odt
(11.01 KiB) Downloaded 191 times
Last edited by foxcole on Wed Apr 02, 2008 11:14 pm, edited 1 time in total.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
foxcole
Volunteer
 
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Looking for a Description List style

Postby Hagar Delest » Wed Apr 02, 2008 11:04 pm

foxcole wrote:Evidently it's not possible to store a frame plus a paragraph together as autotext. You can autotext the frame and simply apply the paragraph style you want.

Have you tried? I can't make a single frame to be an autotext but if it's with a paragraph, it works fine.
LO 6.4.6 on Xubuntu 20.04 and Windows 10.
User avatar
Hagar Delest
Moderator
 
Posts: 29078
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Looking for a Description List style

Postby foxcole » Wed Apr 02, 2008 11:13 pm

Hagar de l'Est wrote:
foxcole wrote:Evidently it's not possible to store a frame plus a paragraph together as autotext. You can autotext the frame and simply apply the paragraph style you want.

Have you tried? I can't make a single frame to be an autotext but if it's with a paragraph, it works fine.

Yes, I have tried, I tried just before I wrote that comment. Didn't work. The autotext would contain either the frame or the paragraph, but I could not combine them. How exactly did you set up yours? I must have done something different.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
foxcole
Volunteer
 
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Looking for a Description List style

Postby Hagar Delest » Wed Apr 02, 2008 11:16 pm

Well, my frame is anchored to the paragraph if it can help.
LO 6.4.6 on Xubuntu 20.04 and Windows 10.
User avatar
Hagar Delest
Moderator
 
Posts: 29078
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Looking for a Description List style

Postby rudolfo » Thu Apr 03, 2008 12:07 am

foxcole wrote:I was able to fix the slight indent of the first entry by adjusting the frame borders. I selected the box frame and a line style of "None" which activated the "spacing to contents" adjustments. Those reduced the extra space to the right of the term paragraph. No more indent of the first line, as you can see in the attached.


Hm, I opened your file and did not see a difference in the settings
for the borders between your frame and my "Frame-based_Term" frame
style. "Spacing to contents" is de-activated in both cases.

But I see that the minimum width of the frame has changed from its
default (as specified by the style) of 1 inch to 23.40 mm.
I guess these are the footprints that are left behind by the "spacing to contents"
operation.

It seems like I would have to do this "resizing" for all those frames with a content
that is less then the standard size of 1 inch.

Still, I see now the pros and cons for each solution and I know that I did not
oversee a predefined style for this purpose and that there are some areas
where OOo cannot replace LaTeX. I will mark this issue as solved, anyway.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Looking for a Description List style

Postby foxcole » Thu Apr 03, 2008 3:25 pm

rudolfo wrote:oversee a predefined style for this purpose and that there are some areas
where OOo cannot replace LaTeX.

OOo was never designed nor intended to replace LaTeX. Neither was Word or any other word processor. Word processors do what they were designed to do: create content. LaTeX and desktop publishing products are designed for typesetting and layout. The two tasks are different and require different techniques and processing capabilities. A carpenter doesn't drive everything with a hammer.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
User avatar
foxcole
Volunteer
 
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota


Return to Writer

Who is online

Users browsing this forum: No registered users and 16 guests