[Tutorial] Work-around for a Two lines heading

Forum rules
No question in this forum please
For any question related to a topic, create a new thread in the relevant section.

[Tutorial] Work-around for a Two lines heading

Postby RGB » Tue Dec 04, 2007 12:43 pm

The document presented here provides a way to mimic a two lines heading that looks like this:

Chapter 1.
Title

Text

The procedure used allows you to have well formatted table of contents and cross-references.
The document includes a macro and a new toolbar that simplifies the use of this “work-around”, and a detailed explanation of how it works.

IMPORTANT
(I just have seen this little problem right now, so this warning is not included on the document, sorry :oops: )
You can use the navigator to move chapters without problems unless you are moving the first or last chapter.
If you use the navigator, you will only see the Heading 1 paragraphs, so if you move a chapter from there, it will be moved not with its FakeChapter paragraph but with the one from the following chapter.
Because of the structure of the document this is not a problem at all unless you are moving the first or the last chapter from the document.
After all, this is a work-around, it cannot be perfect...
Attachments
TwoLineHeadings.odt
Model document for a two lines heading template
(16.31 KiB) Downloaded 1038 times
Last edited by Hagar Delest on Wed Mar 26, 2008 10:38 pm, edited 1 time in total.
Reason: changed 'Example' to 'Tutorial' in title.
There are two types of people: the ones that believe that there are two types of people and the ones that not.

openSUSE with KDE SC / AOO
User avatar
RGB
Volunteer
 
Posts: 1452
Joined: Mon Oct 08, 2007 1:34 am

Re: [Tutorial] Work-around for a Two lines heading

Postby Hagar Delest » Tue May 06, 2008 5:20 pm

Some improvements have been implemented, the new code can be found here: [Writer] Work-around for a Two lines heading.
AOO 4.1.4 on Xubuntu 17.10, (Artful Aardvark) and 4.1.3 on Windows 7 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 27655
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Tutorial] Work-around for a Two lines heading

Postby RGB » Mon Oct 27, 2008 10:43 pm

For the last month, I was working on old documents and didn't notice a new (and really cool!) feature on OOo 3: In Tools -> Outline numbering -> Position tab you can choose a number/text separator! This mean that you can use, for example, a Tab stop!
The problem is that old documents created on prior versions of OOo will not give you the selection (I reported this here), you can only see it on new documents.
The meaning of all this?: if you use the document attached here (that was created on OOo 2.3, I think), it will work without problems, BUT if you try to recreate this (or use the enhanced Hagar's macro) on a NEW document, you will face problems if the "tab stop" is selected in "Numbering followed by": you will have two tab stops one after the other!
The procedure must be updated to consider this new OOo 3 feature.
There are two types of people: the ones that believe that there are two types of people and the ones that not.

openSUSE with KDE SC / AOO
User avatar
RGB
Volunteer
 
Posts: 1452
Joined: Mon Oct 08, 2007 1:34 am

Re: [Tutorial] Work-around for a Two lines heading

Postby Hagar Delest » Tue Oct 28, 2008 12:03 am

I've adapted the code of the macro, it should be fine now for 3.0 and needs a small edit for 2.# compatibility. But the problem remains for old documents edited in 3.0 I guess.
AOO 4.1.4 on Xubuntu 17.10, (Artful Aardvark) and 4.1.3 on Windows 7 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 27655
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Tutorial] Work-around for a Two lines heading

Postby RGB » Tue Oct 28, 2008 4:11 pm

Thanks, Hagar, for fixing the problem. I think there will be a lot of trouble with this (and other) new features: the issue linked above was closed as "wontfix" with the following comment:
This is unfortunately true. The new and the old numbering position concepts are
not compatible to each other. Thus you cannot add tab characters to list created
in OO 2.x or even convert them.
This is not fixable, sorry for this.

:roll:
That means I need to rewrote all my templates... :evil:
There are two types of people: the ones that believe that there are two types of people and the ones that not.

openSUSE with KDE SC / AOO
User avatar
RGB
Volunteer
 
Posts: 1452
Joined: Mon Oct 08, 2007 1:34 am

Re: [Tutorial] Work-around for a Two lines heading

Postby acknak » Tue Oct 28, 2008 5:41 pm

Has anyone seen a description or rationale for the changes in list formatting that were made in ODF 1.2? I must say that this seems like a lot of hassle for very little payoff. The new setup seems to be an improvement, but a very small one, at a high price (broken compatibility).
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22685
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Tutorial] Work-around for a Two lines heading

Postby RGB » Mon May 10, 2010 12:54 am

Strange are the mechanisms of though: trying to solve another problem and almost two years after the "tab stop as numbering separator" was introduced on OOo, I found a way so simply to build the two lines heading that I cannot believe it took me so long to see it... o well...
Tools -> Outline numbering -> Position tab -> "Numbering followed by": tab stop -> "at": your text area width (for example, if you use an A4 page with default margins, the text area width will be 17 cm).
That's all.
In fact, Tab stops will be ignored by the TOC.
And if you want the chapter number to have a larger (or smaller) font than the chapter text, just select a corresponding character style on the Numbering tab.
Reeeeeeally simple.
There are two types of people: the ones that believe that there are two types of people and the ones that not.

openSUSE with KDE SC / AOO
User avatar
RGB
Volunteer
 
Posts: 1452
Joined: Mon Oct 08, 2007 1:34 am

Re: [Tutorial] Work-around for a Two lines heading

Postby acknak » Mon May 10, 2010 1:12 am

Ahh, so the full-page-width tab stop forces the heading text to the next line.

Very nice!
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22685
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Tutorial] Work-around for a Two lines heading

Postby Hagar Delest » Thu Aug 05, 2010 6:51 pm

RGB wrote:Tools -> Outline numbering -> Position tab -> "Numbering followed by": tab stop -> "at":

If you don't see this option, it may be because you're working with an old document or a document made from an old template, still using the former outline numbering management.
In such case, see that topic: 3.x new outline numbering compatibility with old docs.
AOO 4.1.4 on Xubuntu 17.10, (Artful Aardvark) and 4.1.3 on Windows 7 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 27655
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Tutorial] Work-around for a Two lines heading

Postby acknak » Mon Sep 13, 2010 6:49 am

Odd. The wide tab stop idea works great for a tab between the numbering and the title, but not for a tab within the title. A tab in the paragraph text ends up on a line by itself, causing the title to look double-spaced.

Have I missed something obvious? Any ideas why it works this way?

PS: Is it ok to discuss this here, or should this be a separate thread?
Attachments
Writer_wide_tab_problem.odt
(9.55 KiB) Downloaded 442 times
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22685
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Tutorial] Work-around for a Two lines heading

Postby RoryOF » Mon Sep 13, 2010 9:48 am

Work-around for the work-around: select the tab character down to the start of the next line (Edgar...) and right click for format character. I selected 0.1 pt, but it defaulted to 2 pt. Result is nearly what you wanted.

 Edit: The Tab character is wrapping to the next line, but the logic is that it shouldn't; only what is after the tab should wrap. Perhaps putting an microspace just before the text might achieve the correct effect? Haven't time to try this now. 
Apache OpenOffice 4.1.4 on Xubuntu 16.04.03 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 25498
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Tutorial] Work-around for a Two lines heading

Postby acknak » Mon Sep 13, 2010 2:15 pm

Nice! I should have thought of shrinking the tab height.

Perhaps putting an microspace just before the text...

Works perfectly with a zero-width space (U+200B) or a zero-width non-joiner (U+200C). I had tried a regular space before (or after) the tab, but it didn't help. I never thought of trying the zero-width characters.

Great help, RoryOF; thanks!

I think I'll leave this here; someone else may need the workaround in this context.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22685
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3


Return to Writer

Who is online

Users browsing this forum: No registered users and 1 guest