Re: [gcpm] custom pages and page lists

Håkon Wium Lie <howcome@opera.com> wrote on 2008/08/21 23:59:53
> Also sprach MURAKAMI Shinyu:
> 
>  > I'd like to change the meaning of the 'auto' value:
>  > 
>  > If the named page list contains 'auto' value, the next element with 
>  > "page: auto" doesn't establish a new page sequence.
> 
> I agree that the "auto" value in a names page list can be used as a
> flag. However, I don't like that a value in place changes the meaning
> of a value in another place. How about this definition:
> 
>   an 'auto' value at the end of a named page list means that the page
>   sequence will continue until replaced by another page sequence or reset
>   with the 'normal' keyword.

Sounds good.

> 
>  > e.g.,
>  >     table { page: rotated auto }
>  > 
>  >     <table>...</table>
>  >     <p>This text is rendered on a rotated page.</p>
>  > 
>  > If the named page list has no 'auto' value, the next element with 
>  > "page: auto" ends the current page sequence and starts a new page
>  > sequence.
> 
> This is an excerpt from UC4. I suggest solving the use case this way: 
> 
> UC4:
> 
>   <div>
>     <table>...</table>
>     <table>...</table>
>     <p>This text is rendered on a 'narrow' page</p>
>   </div>
> 
>   @page narrow { size: 9cm 18cm }
>   @page rotated { size: landscape }
>   div { page: narrow }
>   table { page: rotated auto }
>   table + table { page: rotated }
> 
> That is, by omitting the "auto" value on the last element, the page
> sequence will end the current page sequence and will revert back to
> what is set on the "div" element.


I agree the selector technique will solve this issue.
I think the following code is better:

  div { page: narrow }
  table { page: rotated auto }
  table + *:not(table) { page: normal }

This works with modified versions of UC4:

  <div>
    <table>...</table>
    <p>This text should be rendered on a 'narrow' page.</p>
  </div>
  <div>
    <p>The following three tables should be renderd on 
       the same 'rotated' page if they fit.</p>
    <table>...</table>
    <table>...</table>
    <table>...</table>
    <p>This text is rendered on a 'narrow' page.</p>
    <p>This text is rendered on the same 'narrow' page.</p>
  </div>

Here, the 'normal' keyword resets the the current page sequence 
and reverts back to what is set on the ancestor element.
(maybe another keyword needed: 'reset' for reset and revert back,
'normal' for always normal page)


-- 
Shinyu Murakami
http://www.antennahouse.com
http://www.antenna.co.jp/AHF/

Received on Thursday, 21 August 2008 17:16:33 UTC