metanorma / mnconvert

Metanorma converter
2 stars 1 forks source link

STS -> MN: Remove `^)^` and `^) ^` from table footnotes #60

Closed manuelfuenmayor closed 3 years ago

manuelfuenmayor commented 3 years ago

In relation to https://github.com/metanorma/metanorma-bsi/issues/30

Text ^)^ and ^) ^ are causing bad rendering in table footnotes.

From bs-8500-1-2015-A2-2019:

...
4+| **__Corrosion induced by carbonation (XC classes)__**
footnote:[The moisture condition relates to that in the concrete cover to reinforcement
or other embedded metal but, in many cases, conditions in the concrete cover can be
taken as being that of the surrounding environment. This might not be the case if there
is a barrier between the concrete and its environment (see <<sec_A.3>>).]^)^

...

|XC2 2+|Wet, rarely dry |Reinforced and prestressed concrete surfaces permanently in
contact with soil not containing chlorides 
footnote:[add:[]Soil may be classed as not containing chlorides if the chloride level is
not greater than 275 mg/l. Higher limits might be applicable; seek specialist advice.add:[]]^)^

...

Rendering sample: issue5-generated

Intelligent2013 commented 3 years ago

Fixed: image

manuelfuenmayor commented 3 years ago

@Intelligent2013 there are further unwanted strings adjacent to footnote's markup: **^)^, **^)^**, **^)^****%**

For example:

22+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes)
is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a
secondary factor. Compressive strength is included as an indirect control on these parameters.]**^)^,
maximum w/c ratio and minimum cement or combination content for normal‑weight concrete**
footnote:[Also applies to heavyweight concrete. For lightweight concrete the maximum w/c ratio and
minimum cement or combination content applies, but the compressive strength class needs to be changed
to a lightweight compressive strength class (see <<sec_A.4.2>>, Note, BS EN 206:2013add:[]+A1:2016add:[],
Table 13 and BS 8500‑2:2015+add:[]A2:2019add:[], Table 12) on the basis of equal cylinder strength
if designing to BS EN add:[]1992-1-1 and BS EN 1992-1-2.add:[]]**^)^ with 20 mm maximum
aggregate size** footnote:[For adjustments to cement or combination content for different
maximum size of aggregate, see <<tab_A.7>>.]**^)^**

Also, there is a ^)^ at the end of a bibliography reference:

* [[[ref_38,3]]] THE CONCRETE SOCIETY. _Plain formed concrete finishes_. Technical Report 52. Camberley: The Concrete
Society, 1999. footnote:[Available from The Concrete Bookshop, 4 Meadows Business Park,
Station Approach, Blackwater, Camberley, Surrey GU17 9AB, UK.
Tel: 01276 607140.
Website: <http://www.concretebookshop.com[http://www.concretebookshop.com]>
[last viewed 28 April 2015].]^)^

(Sorry I didn't notice before.)

Intelligent2013 commented 3 years ago

Fixed.

manuelfuenmayor commented 3 years ago

@Intelligent2013 unfortunately there are still instances where footnotes are malformed.

Markup 1:

[[tab_A.5]]
.Durability footnote:[Where appropriate, account should be taken of the recommendations to resist freeze‑thaw damage (see <<sec_A.4.3>>, <<tab_A.9>>), aggressive chemicals (see <<sec_A.4.5>>, <<tab_A.12>>) and abrasion (no guidance provided).] recommendations for reinforced or prestressed elements with an intended working life of at least 100 years
[cols="671,502,503,200,602,200,502,200,401,301,401,301,401,301,401,301,401,301,401,301,401,301,401,904,401",options="header,footer",width=1050px]
|===
| **Nominal cover** footnote:[Expressed as the minimum cover to reinforcement plus an allowance in design for deviation, Δc, e.g. to allow for workmanship. Check the appropriate design code to see whether it is recommended that the minimum cover to prestressing steel is adjusted by a factor Δc~dur,γ~.] *mm*
22+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.]**^)^, maximum w/c ratio and minimum cement or combination content for normal‑weight concrete** footnote:[Also applies to heavyweight concrete. For lightweight concrete the maximum w/c ratio and minimum cement or combination content applies, but the compressive strength class needs to be changed to a lightweight compressive strength class (see <<sec_A.4.2>>, Note, BS EN 206:2013add:[]+A1:2016add:[], Table 13 and BS 8500‑2:2015+add:[]A2:2019add:[], Table 12) on the basis of equal cylinder strength if designing to BS EN add:[]1992-1-1 and BS EN 1992-1-2.add:[]]**^)^ with 20 mm maximum aggregate size** footnote:[For adjustments to cement or combination content for different maximum size of aggregate, see <<tab_A.7>>.]**^)^**

renders: issue1_1-generated

Markup 2:

[[tab_A.16]]
.Summary of requirements for designated cement‑bound concrete
[cols="1959,1993,2147,3901",options="header,footer",width=618px]
|===
| *Concrete designation*
| **Min. strength class** footnote:[The characteristic compressive strength at 28 days of cylinders or cubes made in accordance with BS EN 13286‑51 and tested in accordance with BS EN 12390‑3.]**^)^**
| **Min. cement or combination content** footnote:[Aggregate grading for cement‑bound concrete as given BS 8500‑2:2015+add:[]A2:2019add:[], Table 8.]**^)^****%**
...

renders: issue1_2-generated

manuelfuenmayor commented 3 years ago

Question: In original PDF, tables A.4 and A.5 are shown in landscape mode. Is it possible for us to do so as well?

Intelligent2013 commented 3 years ago

@Intelligent2013 unfortunately there are still instances where footnotes are malformed.

@manuel489 please pull the latest commits. Specified issues were fixed in commit https://github.com/metanorma/mn-samples-bsi/commit/5a09514414dee11911cb9926f78dd829b476cc95

In original PDF, tables A.4 and A.5 are shown in landscape mode. Is it possible for us to do so as well?

Yes, it is possible. In the source STS XML, usual tables have width like width="613", but landscape oriented - width="1050". I'll do it.

<table-wrap id="tab_A.3" position="float">
    <label>Table A.3</label>
    <caption>
        <title>Typical reinforced concrete applications in buildings (intended working life at least 50 years) for designated concretes</title>
    </caption>
    <table width="613">
...
<table-wrap id="tab_A.4" position="float">
    <label>Table A.4</label>
    <caption>
        <title>Durability<xref ref-type="table-fn" rid="table-fn_A.4.1">
                <sup>A</sup>
            </xref>
            <sup>)</sup> recommendations for reinforced or prestressed elements with an intended working life of at least 50 years</title>
    </caption>
    <table width="1050">
Intelligent2013 commented 3 years ago

Landscape orientation based on table's width added: image

manuelfuenmayor commented 3 years ago

@Intelligent2013 please remember the issue of the footnote that can be seen in the image you shared above.

Intelligent2013 commented 3 years ago

This footnote processed ok:

[[tab_A.4]]
...
21+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.]**, maximum w/c ratio and minimum ...
<th colspan="21" valign="top" align="left">
    <strong>Compressive strength class</strong>
    <fn reference="B">
        <p id="_">Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.</p>
    </fn>
    <strong>, maximum w/c ratio and minimum 

But this isn't:

[[tab_A.5]]
...
22+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.]**, maximum w/c ratio and minimum ...
<th colspan="22" valign="top" align="left">
    <strong>Compressive strength class</strong> footnote:<strong>, maximum w/c ratio and minimum 

But I add space between ] and **, then processed ok also:

[[tab_A.5]]
...
22+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.] **, maximum w/c ratio and minimum 
<th colspan="22" valign="top" align="left">
    <strong>Compressive strength class</strong>
    <fn reference="B">
        <p id="_">Resistance to chloride ingress (XD and XS exposure classes) is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being a secondary factor. Compressive strength is included as an indirect control on these parameters.</p>
    </fn>
    <strong>, maximum w/c ratio and minimum 

Very strange. Will investigate...

manuelfuenmayor commented 3 years ago

This footnote processed ok:

@Intelligent2013, not so ok:

[[tab_A.5]]
...
22+| **Compressive strength class** footnote:[Resistance to chloride ingress (XD and XS exposure classes)
is mainly dependent upon the cement or combination type and the w/c ratio, with aggregate quality being
a secondary factor. Compressive strength is included as an indirect control on
these parameters.]**, maximum w/c ratio and minimum ...

This part:

... parameters.]**, maximum w/c ratio and minimum ...

Should be:

... parameters.], **maximum w/c ratio and minimum ...

It's a markup problem.

Intelligent2013 commented 3 years ago

@manuel489 in the source STS XML - comma inside the tag bold: <bold><sup>)</sup>, maximum w/c ratio And in PDF it's bold also: image

So I see only one solution - add space after footnote if next elements is bold, italic, etc. xslt updated.

manuelfuenmayor commented 3 years ago

@manuel489 in the source STS XML - comma inside the tag bold: <bold><sup>)</sup>, maximum w/c ratio And in PDF it's bold also: image

So I see only one solution - add space after footnote if next elements is bold, italic, etc. xslt updated.

Ah yes, I forgot to check the XML source. Ok!

manuelfuenmayor commented 3 years ago

Confirmed fixed. Thanks @Intelligent2013! Closing.