Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF: Automatic generation of the words "Draft {Guide/Standard/Recommended Practice} for" #95

Open
anermina opened this issue Jul 12, 2022 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@anermina
Copy link

Title is not generated properly in PDF when the following guideline from www.metanorma.org is followed:

Do not include the words "Draft {Guide/Standard/Recommended Practice} for", these words are supplied automatically by Metanorma.

Generated:
image

Original:
image

Generated HTML:
image

Ping @opoudjis : Should we have "IEEE" keyword automatically generated before the "Guide for", as in the original document?

@anermina anermina added the bug Something isn't working label Jul 12, 2022
@Intelligent2013
Copy link
Contributor

I see another issues:

  • no title, just 'IEEE Standard for'
  • instead of 'IEEE Standard for' should be 'IEEE Guide for'
  • dash after '1127' in 'IEEE Std 1127-'

image

@anermina
Copy link
Author

That is weird, maybe we used different gem versions (metanorma-ieee has been updated yesterday).

However, doctype atrribute is set to guide and "Guide" keyword is applied in HTML, so this still seems to be a PDF-related error.

@Intelligent2013
Copy link
Contributor

For standard's title xslt expects:

  • /bibdata/title[@language = 'intro' or @language = 'intro-en'] and/or
  • /bibdata/title[@language = 'main' or @language = 'main-en']

but currently xml contains:

<title language="en" format="text/plain">the Design, Construction, and Operation of Electric Power Substations for Community Acceptance and Environmental Compatibility</title>

so xslt should support both cases.

@Intelligent2013
Copy link
Contributor

Currently, IEEE xslt generate standard's number by concatenation:

  • IEEE Std
  • bibdata/docidentifier[@type = 'IEEE']
  • -
  • (bibdata/date[@type = 'published'],1,4)`

Just for information, no need to change Std to Gde in IEEE Std, see cover-page: https://www.amazon.com/1127-1998-Construction-Substations-Acceptance-Environmental/dp/0738101982

To do in xslt: get year from bibdata/copyright/from.

@Intelligent2013
Copy link
Contributor

In xslt, if the title starts with lower-cased letter, then no need to put line break after 'IEEE ... for'. Currently, it looks bad:
image

@anermina
Copy link
Author

anermina commented Jul 13, 2022

In xslt, if the title starts with lower-cased letter, then no need to put line break after 'IEEE ... for'. Currently, it looks bad:
image

I agree. However, I believe the title here is "Design, Construction (...)" without the article "the". As I am not aware of any automatic option for adding articles before the title, I encoded it in the source file to match the original document. Maybe it is acceptable to remove "the" and leave the current title presentation as-is? Ping @ronaldtse

@Intelligent2013
Copy link
Contributor

Another issue, no copyright holder at the footer:
image

Currently, xslt reads the values from bibdata/copyright/owner/organization/abbreviation, but it's missing in the xml. Additional field should be used in this case:

		<contributor>
			<role type="publisher"/>
			<organization>
				...
				<abbreviation>IEEE</abbreviation>
			</organization>
		</contributor>

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Jul 13, 2022
IEEE xslt updated for metanorma/metanorma-ieee#95 and metanorma/metan…
@anermina
Copy link
Author

@Intelligent2013
Copy link
Contributor

IEEE xslt updated in the branch (feature/xslt-update' (https://github.com/metanorma/metanorma-ieee/tree/feature/xslt-update)
Now PDF renders so:
image

@anermina
Copy link
Author

@Intelligent2013 society is encoded as "Power and Energy Society", but there should be an automatically added prefix "IEEE" in the generated PDF.

From metanorma.org:

society
The IEEE society responsible for the document. Do not include the "IEEE" prefix.

Could you please check this as well as the following paragraph for committee - "Developed" vs. "Sponsored" (I guess this is an inconsistency in the original document, but just to double-check)?

Original:
image

@ronaldtse
Copy link

For standard's title xslt expects:

  • /bibdata/title[@language = 'intro' or @language = 'intro-en'] and/or
  • /bibdata/title[@language = 'main' or @language = 'main-en']

but currently xml contains:

<title language="en" format="text/plain">the Design, Construction, and Operation of Electric Power Substations for Community Acceptance and Environmental Compatibility</title>

so xslt should support both cases.

@Intelligent2013 IEEE will not have intro-en and main-en anymore, it was an artefact from ISO inheritance. IEEE documents only have 1 title. Let's remove those. Thanks.

@ronaldtse
Copy link

@Intelligent2013 society is encoded as "Power and Energy Society", but there should be an automatically added prefix "IEEE" in the generated PDF.

If there are any prefixes, like "IEEE", should be supplied by Metanorma XML? I don't think these things should be encoded by the stylesheets.

@Intelligent2013
Copy link
Contributor

@ronaldtse the example from #7 contains "Developed by" on the cover pages:
image

but the document from this issue contains "Sponsored by":

image

Currently, 'Developed by' is hard-coded in the xslt.
I think we have to add one more document attribute for "Sponsored by". But are there another '... by' titles?

@Intelligent2013 IEEE will not have intro-en and main-en anymore, it was an artefact from ISO inheritance. IEEE documents only have 1 title. Let's remove those. Thanks.

@ronaldtse the example from #7 contains two part of title:
image

  • 'Local and Metropolitan Area Networks' and
  • 'Port-Based Network Access Control'

in the different font-sizes.

Is that one title or two? If one title, then we can't render it in different sizes.

If there are any prefixes, like "IEEE", should be supplied by Metanorma XML? I don't think these things should be encoded by the stylesheets.

@ronaldtse Metanorma xml contains

<society>Power and Energy Society</society>

@ronaldtse
Copy link

Is that one title or two? If one title, then we can't render it in different sizes.

We have clarified with IEEE that a document only has one title, we do not need to render different sizes. This is a special case.

Sponsored by vs Developed by

Can you help investigate ieee-stl to see their XML schema to determine what additional fields we need?

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Jul 14, 2022
@Intelligent2013
Copy link
Contributor

Can you help investigate ieee-stl to see their XML schema to determine what additional fields we need?

From ieee-stl:

<std-sponsor> Standard Sponsor

The groups such as the society, the association, or the Working Committee responsible for a standard. This is a text field, containing words such as “sponsored by” and the names of organizations, with the possibility that the names of a committee, society, secretariat, or institution may be tagged within the text

Remarks

There can be a hierarchy of sponsors, ranging from: the IEEE-SA Standards board at the top; the next level usually the society, committee of the society, or SCC (Standards Coordinating Committee) that is the parent of the Working Group; and finally the Working Group or Task Force (typically a subset of the Committee) that wrote the standard. More than one Committee may sponsor a standard.

The name of a Committee, for example, the “Petroleum and Chemical Committee”, should also be thought of as a topic for searching and added to the keywords or subject categories.

The element contains sub-elements:

    <committee> Standards Committee
    <institution> Institution Name
    <institution-id> Institution Identifier
    <secretariat> Secretariat For a Standard
    <society> Society For a Standard

The xml source for master-1-standard document:

<std-sponsor>Sponsor <committee>Substations Committee of the IEEE Power and Energy Society</committee>
</std-sponsor>

Cover page contains some different text (there isn't this text in the xml):
image
But 2nd page contains exactly text from xml (some text is bold-faced):
image

The xml source for master-2-standards document doesn't contain 'Sponsor' word:

<std-sponsor>
<committee>IEEE Standards Coordinating Committee on Test and Diagnosis for Electronic Systems (SCC20)</committee>
</std-sponsor>

Cover page:
image

2nd page contains 'Sponsor' (it's missing in xml, but presents in the xml for 'master-1-standard'):
image

So:

  • the text on the cover page and 2nd page is different
  • in the xml there isn't text for cover page
  • the element 'std-sponsor' may contain text like 'Sponsor'
  • the element 'std-sponsor' is complex, and may contain 'committee', 'institution', 'institution-id', 'secretariat', 'society':
<std-sponsor>Sponsored by the<break/>
   <committee>Power System Communications Committee</committee><break/>
   of the<break/>
   <society>IEEE Power &amp; Energy Society</society><break/>
   and the<break/>
  <committee>Standards Committee</committee><break/>
  of the<break/>
 <society>IEEE Communications Society</society>
</std-sponsor>
  • there is case when the element 'society' isn't using, for instance: <std-sponsor>Sponsor <committee>Substations Committee of the IEEE Power and Energy Society</committee></std-sponsor>, i.e. 'IEEE Power and Energy Society' inserted as the committee's part.

Regarding 'Developed by ', IEEE uses the element 'std-sponsor' also for this purpose.
Xml example for 2830-2021:

<std-sponsor>Developed by the 
  <committee>Standards Activities Board</committee> of the 
  <society>IEEE Computer Society</society>
</std-sponsor>

Cover page (no 2nd page in the draft):
image

So, we need fields for specifying:

  • 'developed' or 'sponsored' (I can't find another kind of '... by')
  • hierarchy for committee/institution/secretariat/society and relationships between them - 'of the', 'and the'.

@opoudjis
Copy link
Contributor

All I capture currently is:

<div><p>Developed by the</p>
  <p><b>{{ technical_committee }}</b></p>
<p>of the</p>
<p><b>IEEE {{ society }}</b></p>

where technical_committee is //bibdata/ext/editorialgroup/committee, and society is //bibdata/ext/editorialgroup/society. I have no representation of sponsor, and the difference between "developed" and "sponsor" is not one of wording, it is a difference between //bibdata/ext/editorialgroup/committee and //bibdata/ext/editorialgroup/sponsor (once I add it).

This will need to become a separate ticket for me to work through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants