Forum How do I...?

align right in headers and footers

dgroskind
I am having a problem getting text in a footer to align against the right margin in the @bottom-right box. The text appears as expected in the box but it is aligned left.

I've checked the examples and there doesn't seem to be anything special formating required to get text to align to the right. When I place a page number in the @bottom-right box, it aligns to the right as expected without any special formatting.

Here is the code I'm using to place the text with the pubdate class in the footer.

@page :right {
    @bottom-left {
        content: flow(issue1);
        vertical-align:top;
        }
    @bottom-right {
        vertical-align:top;
        content: flow(footer2);
        }
    }



.pubdate {
    font-size:8pt;
    flow: static(footer2);
    }


I am using Prince 5.1 on linux. Any help would be appreciated.
mikeday
It may be necessary to add "text-align: right" to the .pubdate, as when it is flowed to the footer it will not inherit the (implicit) text alignment of the @bottom-right margin box.
dgroskind
Thanks. That works. The problem is that the same text is used in the right and left pages on different sides of the page. Adding text-align:right to the tag means that it will align right on a left page when it should align left.

The problem appears to be with using flow(). There doesn't appear to be a similar problem using content from the document using string() or counter(). If I specifiy an XML tag like <pubdate> instead of p class="pubdate" I still have the same problem using flow() but not using string().

A workaround would be to have the text appear twice with different tags: p class='pubdate_left' and p class='pubdate_right'

Does this behavior rise to the status of a bug? The docs say that "all margin properties of a non-normal flow element will be ignored." Shouldn't the align properties be ignored also?

On a related note, trying to add text to the content when using flow() doesn't appear to work. For example

 content: "Date:" flow(thedate); 


Nothing appears in the footer when the text "Date:" is present.
mikeday
Thanks. That works. The problem is that the same text is used in the right and left pages on different sides of the page. Adding text-align:right to the tag means that it will align right on a left page when it should align left.

You can also use "inside" or "outside" with text-align, to create duplex layouts with text aligned to the inside or outside of the current page.

On a related note, trying to add text to the content when using flow() doesn't appear to work.

flow() replaces the entire margin box, and cannot be combined with other things. If you just want to capture some text from the document, you can always try using named strings, which can be combined with other things. (See Copying text content from the document).