wordinator icon indicating copy to clipboard operation
wordinator copied to clipboard

Suppressing the outer-body page

Open gkholman opened this issue 1 year ago • 3 comments

I am creating two pages in page-number-format-20230226.zip.

There is one page in each of two sections:

<?xml version="1.0" encoding="UTF-8"?>
<wp:document xmlns:wp="urn:ns:wordinator:simplewpml">
  <wp:body>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
...
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p><wp:run>This is the first page numbered in Roman lower-case</wp:run></wp:p>
      </wp:body>
    </wp:section>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
...
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p><wp:run>This is the first page numbered in decimal</wp:run></wp:p>
      </wp:body>
    </wp:section>
  </wp:body>
</wp:document>

My end result is three pages long. I'm assuming the page is from the "outer" body as opposed to the section bodies.

Is there a way to suppress the outer-body page? All of my pages are in sections.

gkholman avatar Feb 26 '23 17:02 gkholman

This is a duplicate of: https://github.com/drmacro/wordinator/issues/68

Though I am confused about the reference to the "last paragraph" in the guidance given.

gkholman avatar Feb 26 '23 17:02 gkholman

Sorry, I'm re-opening this because I'm not getting anywhere. This is my latest attempt, where I have only two pages, but both paragraphs are on the first page numbered in decimal, and the second page is blank and numbered in Roman.

page-count-20230226.zip

<?xml version="1.0" encoding="UTF-8"?>
<wp:document xmlns:wp="urn:ns:wordinator:simplewpml">
  <wp:page-sequence-properties>
    <wp:page-number-properties start="1" format="lowerRoman"/>
    <wp:headers-and-footers>
      <wp:header>
        <wp:p style="Normal">
          <wp:page-number-ref/>
        </wp:p>
      </wp:header>
    </wp:headers-and-footers>
    <wp:page-size orient="portrait" width="210mm" height="297mm"/>
  </wp:page-sequence-properties>
  <wp:body>
    <wp:p>
      <wp:run>This is the first page numbered in Roman lower-case</wp:run>
    </wp:p>
    <wp:section type="nextPage">
      <wp:page-sequence-properties>
        <wp:page-number-properties start="1" format="decimal"/>
        <wp:headers-and-footers>
          <wp:header>
            <wp:p style="Normal">
              <wp:page-number-ref/>
            </wp:p>
          </wp:header>
        </wp:headers-and-footers>
        <wp:page-size orient="portrait" width="210mm" height="297mm"/>
      </wp:page-sequence-properties>
      <wp:body>
        <wp:p>
          <wp:run>This is the first page numbered in decimal</wp:run>
        </wp:p>
      </wp:body>
    </wp:section>
  </wp:body>
</wp:document>

The "outer" body has only one paragraph before I start a new "next page" section, yet the second paragraph is on the same page.

What am I missing?

gkholman avatar Feb 26 '23 17:02 gkholman

When Eliot on #68 wrote

The solution is to put the section definition for the last section directly within the body, not within the last paragraph of the section.

he was referring to how to structure the OOXML output.

I just took the output that Wordinator produced and moved the <w:pPr> element from within the last paragraph to being directly within the body, and that solves the problem.

So the trick is to

  1. Figure out how to detect this situation,
  2. Somehow move the properties.

larsga avatar Mar 01 '23 15:03 larsga

I've incorporated the updates and test cases from Lars' https://github.com/drmacro/wordinator/pull/118 pull request.

ekimbernow avatar Aug 04 '24 21:08 ekimbernow

Great! Thank you. 👍

larsga avatar Aug 05 '24 07:08 larsga

Closing as done.

larsga avatar Aug 05 '24 07:08 larsga