Title property not working after upgrading to version 21.1

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Title property not working after upgrading to version 21.1

Post by shanweizhong » Wed May 29, 2019 7:51 am

In my Oxygen Author 21, I used the following CSS code to style my PDF document title on the cover page, and it worked fine.

Code: Select all

*[class~="front-page/front-page-title"] {
    display: block;
    text-align: center;
    margin-top: 34%;
    font-size: 2.6em;
    font-weight: bold;
    line-height: 105%;
}
However, after upgrading to version 21.1, I found the "margin-top" property stops working and the title goes up to the top of the page and overlaps with the company logo in the background.

Any idea how to fix that?

Dan
Posts: 408
Joined: Mon Feb 03, 2003 10:56 am

Re: Title property not working after upgrading to version 21.1

Post by Dan » Wed May 29, 2019 10:17 am

The margins of the first block in the page are now discarded. This is desirable, to make the sections titles align properly in the page when they are at the beginning. The front-page-title is not the first block in the page, there are others with no content. Those are losing the top margin.

A workaround is to increase the value of the margin-top, like:

Code: Select all

*[class~="front-page/front-page-title"] {
    display: block;
    text-align: center;
    margin-top: 3in;
    font-size: 2.6em;
    font-weight: bold;
    line-height: 105%;
}
Many regards,
Dan

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Thu May 30, 2019 1:36 am

Thanks Dan. I tried that but it did not work. I also tried to set the "margin-top" property of "front-page/front-page-title" and "bookmap/booktitle" and they did not work either.

My ditamap file is as follows:

Code: Select all

<bookmap>
    <booktitle>
        <mainbooktitle>
            <ph keyref="prod_name"/> <ph keyref="cur_ver" audience="external"/><ph keyref="cur_internal_ver" audience="internal"/> Client Release Notes <ph audience="internal">(Internal)</ph>
        </mainbooktitle>
    </booktitle>
    ...
</bookmap>    
I also inspected the generated HTML file and found the properties actually work there.

Maybe there are some other properties I should set?

Cheers,
Michael

chrispitude
Posts: 53
Joined: Thu May 02, 2019 2:32 pm

Re: Title property not working after upgrading to version 21.1

Post by chrispitude » Thu May 30, 2019 3:06 pm

The margin behavior change that Dan mentions is a result of this discussion:

"How do I suppress margin-top/margin-bottom at the top/bottom of the content bounding box?"
topic20016.html

As Dan says, this is needed for body content that flows across multiple pages without "vertically indenting" different elements away from the page content bounding box. This is something that industrial page-layout programs (like FrameMaker) do, and it is a desirable change for PDF Chemistry.

If I can find time later today, I'll see if I can reproduce this and find an alternate method for you to position your book title.

Dan
Posts: 408
Joined: Mon Feb 03, 2003 10:56 am

Re: Title property not working after upgrading to version 21.1

Post by Dan » Fri May 31, 2019 12:35 pm

Hello,

I think one workaround is to use the padding-top property instead of margin. The margin is discarded, but the padding not.

Many regards,
Dan

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Tue Jun 04, 2019 1:05 am

Dan wrote:
Fri May 31, 2019 12:35 pm
Hello,

I think one workaround is to use the padding-top property instead of margin. The margin is discarded, but the padding not.

Many regards,
Dan
Thanks so much, Dan. The padding-top property really worked! :-)

Cheers,
Michael

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Tue Jun 04, 2019 1:06 am

chrispitude wrote:
Thu May 30, 2019 3:06 pm
The margin behavior change that Dan mentions is a result of this discussion:

"How do I suppress margin-top/margin-bottom at the top/bottom of the content bounding box?"
topic20016.html

As Dan says, this is needed for body content that flows across multiple pages without "vertically indenting" different elements away from the page content bounding box. This is something that industrial page-layout programs (like FrameMaker) do, and it is a desirable change for PDF Chemistry.

If I can find time later today, I'll see if I can reproduce this and find an alternate method for you to position your book title.
I see. Thanks for the background. My problem was solved with Dan's workaround.

Cheers,
Michael

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Thu Jun 06, 2019 7:01 am

Dan wrote:
Fri May 31, 2019 12:35 pm
Hello,

I think one workaround is to use the padding-top property instead of margin. The margin is discarded, but the padding not.

Many regards,
Dan
Hi Dan,

I'm not sure if it is a related issue, but I found that the "margin-bottom" property also stopped working for "note", as shown in the following style:

Code: Select all

*[class~="topic/note"] {
    border-top: 1px solid;
    border-bottom: 1px solid;
    margin-bottom: 1em;
}
As I added top and bottom borders to the note, I'm hoping to add some space below the bottom border. "padding-bottom" does not work in this case because it will add space above the bottom border.

Any idea how I can fix this?

Cheers,
Michael

Costin
Posts: 600
Joined: Mon Dec 05, 2011 6:04 pm

Re: Title property not working after upgrading to version 21.1

Post by Costin » Thu Jun 06, 2019 10:59 am

Hello,

I've tested and seems the margin-bottom property works as it should on the note.
I managed to add a generous bottom margin (10em) to the note and that was reflected correctly in the PDF, as you can see from the screenshot.
Image

However, if the note is positioned at the very bottom of the page, it is intended behavior to move the element following the note to the next page and in that case, if there is not enough space for the note's margin until the page break, it won't be reflected (like in the 2nd screenshot). In such cases, you should move the note to the next page.
Image

If you think you have a different situation, sending us a sample map with one topic and the customization CSS you are using, could help us investigate.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Mon Jun 10, 2019 7:25 am

Thanks Costin. My bad. I was looking at the notes embedded in bullets...

Cheers,
Michael

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Mon Jun 10, 2019 7:50 am

It seems to be weird. When <note> is embedded in <li>, the "margin-bottom" style stops working but the "border-top" and "border-bottom" styles keep working...

Cheers,
Michael

Dan
Posts: 408
Joined: Mon Feb 03, 2003 10:56 am

Re: Title property not working after upgrading to version 21.1

Post by Dan » Mon Jun 10, 2019 3:15 pm

Hello Michael,
We are preparing a nightly build of the publishing engine, with a new parameter that will allow you to control the discarding of the top/bottom margins for elements that are at the top or bottom of a page. Costin will give you more details when the build is ready.
Many regards,
Dan

Dan
Posts: 408
Joined: Mon Feb 03, 2003 10:56 am

Re: Title property not working after upgrading to version 21.1

Post by Dan » Tue Jun 11, 2019 1:53 pm

Hello Michael,

We have prepared a nightly build here:

http://mirror.oxygenxml.com/maven-night ... e-full.zip

Extract it to a folder, then configure oXygen to use it (Preferences/DITA/ DITA Open Toolkit/Custom).
Restart oXygen. In your transformation scenario parameters tab, a new parameter should be visible:

Code: Select all

drop.block.margins.at.page.boundary
Set its value to 'no', then run a test transformation.
This should restore the old block margin behavior.

Many regards,
Dan

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Wed Jun 12, 2019 6:06 am

Thanks so much for the help, Dan.

Costin
Posts: 600
Joined: Mon Dec 05, 2011 6:04 pm

Re: Title property not working after upgrading to version 21.1

Post by Costin » Wed Jun 12, 2019 4:51 pm

Hi shanweizhong,

If, for any reason, you don't want to use the publishing engine, but stick with using the official stable release from our website, there is a workaround I could think of.

You should use the outputclass attribute on the specific list items that contain notes and match your outputclass from CSS, like:
[*]in the source DITA file:

Code: Select all

<li outputclass="note_list_item">
                <note>That is a Note inside a list item</note>
            </li>
[*]in your customization CSS:

Code: Select all

*[class~="note_list_item"]{
    margin-bottom: 10em !important;
}
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

shanweizhong
Posts: 30
Joined: Mon Jul 10, 2017 2:18 am

Re: Title property not working after upgrading to version 21.1

Post by shanweizhong » Wed Jun 12, 2019 11:20 pm

Good suggestion. Thanks Costin.

Post Reply