Why can't we use tables in introductions chapter (before Chapter 1)?

Whenever I tried to put a table in introduction (before chapter 1), the table always displayed in Chapter 1 instead. Why is that?

Here’s a portion of my .SFM file if it helps.

\id EXO
\toc1 Keluaran
\toc2 Keluaran
\toc3 Kel

\imt Keluaran

\is1 Fakta
\tr \tc1 Statistik\tc2 40 pasal, 1213 ayat, 32.692 kata
\tr \tc1 Penulis\tc2 Musa
\tr \tc1 Tema\tc2 Penebusan; Penebusan melalui darah.
\tr \tc1 Waktu\tc2 Sekitar 1445-1405 SM
\tr \tc1 Tempat\tc2 Mesir, Laut Merah*, Gunung Sinai
\tr \tc1 Kata Kunci\tc2 Paskah.
\tr \tc1 Kristus Di Alkitab\tc2 Dia adalah Anak Domba Paskah
\ie

\c 1

\ms Keluaran

\s1 Latar Belakang
\m Keluaran melanjutkan kisah yang dimulaikan dalam Kejadian. Judul kitab ini diambil dari kata Yunani _exodos_ (judul yang dipakai di Septuaginta, yaitu PL dalam bahasa Yunani) yang artinya "keluaran" atau "keberangkatan." Kata ini menunjuk kepada pembebasan bangsa Israel secara luar biasa dari perhambaan di Mesir oleh Allah dan keberangkatan mereka dari negeri itu sebagai umat Allah.

Here’s some screenshots:

Good illustration of your issue with both code and screenshots. Well done!

USFM has a set of rules. Only certain markers can go before the chapter one \c 1. Tables \tr are not one of them. Most start with i.

You could use \io and wrap the second part in \ior text...\ior*.
You could then try and float that right and put a width on it.

span.ior {
    font-style: italic;
    float: right;
    width: 70%;
}

Also modify the \io CSS

div.io {
    padding-left: 4%;
    clear: both;
}

And the SFM

\io Statistik\ior 40 pasal, 1213 ayat, 32.692 kata\ior*
\io Penulis\ior Musa                                 \ior*
\io  Tema\ior Penebusan; Penebusan melalui darah.\ior*
\io  Waktu\ior Sekitar 1445-1405 SM\ior*
\io  Tempat\ior Mesir, Laut Merah*, Gunung Sinai\ior*
\io  Kata Kunci\ior Paskah.\ior*
\io  Kristus Di Alkitab\ior Dia adalah Anak Domba Paskah\ior*

image

Need to test on small screens though.

If you put markers starting with i after the chapter one marker then you also get strange things happening like missing last chapters.

1 Like

Hi, Ian @mcquayi.
I’ve tried your solution and it worked! Thank you so much! But, I modified quite a few things to suit my need. So I want to share what I did.

Inspired by your solution, basically I modified \io to sort of act like \tr, and I used custom markers \itc1...\itc1* and \itc2...\itc2* to act like \tc1 and \tc2 respectively.

Here’s the modified CSS:

div.io {
    padding-left: 4%;
    clear: both;
}

span.itc1 {
    float: left;
    font-size: 90%;
    font-weight: bold;
    padding-bottom: 5px;
    padding-right: 5px;
    padding-top: 5px;
    text-align: left;
    vertical-align: top;
    width: 28%;
}

span.itc2 {
    border-bottom: 1px solid lightgrey;
    float: right;
    font-size: 100%;
    font-style: italic;
    font-weight: normal;
    padding-bottom: 5px;
    padding-right: 5px;
    padding-top: 5px;
    text-align: left;
    vertical-align: top;
    width: 68%;
}

And here’s the SFM:

\imt Keluaran

\is1 Fakta
\io \itc1 Statistik\itc1*\itc2 40 pasal, 1213 ayat, 32.692 kata\itc2*
\io \itc1 Penulis\itc1*\itc2 Musa\itc2*
\io \itc1 Tema\itc1*\itc2 Penebusan; Penebusan melalui darah.\itc2*
\io \itc1 Waktu\itc1*\itc2 Sekitar 1445-1405 SM\itc2*
\io \itc1 Tempat\itc1*\itc2 Mesir, Laut Merah*, Gunung Sinai\itc2*
\io \itc1 Kata Kunci\itc1*\itc2 Paskah.\itc2*
\io \itc1 Kristus Di Alkitab\itc1*\itc2 Dia adalah Anak Domba Paskah\itc2*
\ie

The result is awesome!

However, as you might already guessed, there’s a caveat here. I noticed that if you set the font size too large, the text will begin to overlap. And since I haven’t test it on small screens like you suggested, there might be problems there too.

2 Likes

Well done.

I have never had any luck setting width to a span before in a conventional HTML setting.

Glad it inspired you and you worked out your own solution.

I second the need for tables in introductions to be supported.
Can this be made a feature request?

USFM doesn’t have tables listed under the Introduction section, but there is still a need for tables in certain cases. This is also supported in print.

Our tables are more than just 2 columns. They get pushed over to Chapter 1, but anything after the table (introduction elements) are left off.

image image image

Source text:

...
\tr \tc1 Nero (54-68) \tc2 Antonius Feliks, (52-60) Porcius Festus, (60-62) \tc3 \tc4 Herodes Agrippa II (53-93), seun van Agrippa I\tc5 Herodes Agrippa II (53-93), seun van Agrippa I\tc5
\tr \tc1 Vespasianus (69-79) \tc2 \tc3 \tc4 \tc5 \tc5
\tr \tc1 Titus (79-81) \tc2 \tc3 \tc4 \tc5 \tc5
\tr \tc1 Domitianus (81-96)\tc2 \tc3 \tc4 \tc5 \tc5
\tr \tc1 Nerva (96-98)\tc2 \tc3 \tc4 \tc5 \tc5
\tr \tc1 Trajanus (98-117)\tc2 \tc3 \tc4 \tc5 \tc5
\tr \tc1 Hadrianus (117-138)\tc2 \tc3 \tc4 \tc5 \tc5
\ib
\im \bk Lukas\bk* kan soos volg ingedeel word:\io1 1:1-4 Die proloog
\io1 1:5 – 2:52 Die geboorte van Johannes; geboorte en kinderjare van Jesus
\io1 3:1 – 4:13 Die voorbereiding vir Jesus se taak
\io1 4:14 – 9:50 Jesus se werk in Galilea
\io1 9:51 – 19:28 Jesus op reis na Jerusalem\io1 19:29 – 21:38 Gebeure by die •tempel
\io1 22:1 – 23:56 Die laaste dae in Jerusalem; verhoor en lyding van Jesus
\io1 24:1-53 Opwekking van Jesus en hemelvaart
\ie
\c 1
\s1 Proloog\f + \fk Proloog: \ft In sy proloog of voorwoord (\+xt Luk 1:1-4\+xt*) gebruik Lukas ...

We did move things around in print so the table would not split over 2 pages in Luke, so I can at least move the table after the \io content with a regex.

Note: USFM also does not make provision for a 6th column!

FYI the regex changes I used are (very specific):

Move tables to end of intros ((?:\\tr \\th1 Koninkryk van Juda|\\tr \\th1 Keiser)[^\r\n]+\s+(?:\\tr [^\r\n]+\s+)+)((?:\\i[^\r\n]+\s)+) \2\1

There were 2 tables that needed moving starting with the line

\tr \th1 Koninkryk van Juda

or

\tr \th1 Keiser

Hi Odysius, I read few of your topics and they helped me a great deal. Thank!

Can you explain how did you made \io to act as \tr? I tried the same bur the result is not very good:

I created two new custom styles in SAB for \itc1 and 2. I added a background too.

Hope I was clear in my explanation and you are around to respond!
Samuil

It would help if you copied in your CSS for: div.io, span.itc1 and span.itc2

1 Like

Yeah, that’s right I will paste them below. I decided to use your method @mcquayi (with \io …\ior …\ior* and it worked just fine (thanks for the hint) at the beginning, then I changed something in the style and again the same overlap appeared. I realized that the width needs adjustment. When I “pushed” \ior to width: 88%; the overlap got fixed. I guess it is the same issue with my attempts to use table for the table of contents. Did not try to fix it though

Here is the CSS for the example i gave above:
span.itc1 {
background-color: AnnotationItemBackgroundColor;
float: center;
font-size: 120%;
font-weight: bold;
padding-left: 10px;
padding-bottom: 10px;
padding-right: 10px;
padding-top: 20px;
text-align: center;
vertical-align: bottom;
width: 0%;
and
span.itc2 {
border-bottom: 1px solid lightgrey;
background-color: AnnotationItemBackgroundColor;
float: right;
font-size: 100%;
font-style: normal;
font-weight: normal;
padding-bottom: 5px;
padding-right: 5px;
padding-top: 5px;
text-align: left;
vertical-align: middle;
width: 85%;
}

(buy the way I just tried again that I showed on Jul 3 and the same example with \itc markets did not show up in the app at all)

For your \itc1 you have float:center, but CSS does not define a value center. It is left, right or none.

Size seems to be an issue here too.
By using \io as the paragraph type you have an indent. Is that really needed. Either change the marker or change the indent style on \io (assuming that has no other usages).

1 Like

Thanks for the advice about \itc1. I will fix it.

I guess the \io marker just “came” with the indent. I think I didn’t change the style of that one, and in fact in the style settings I don’t see value for the indent:
div.io {
padding-left: 0;
font-weight: bold;
clear: both;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 0;
font-size: 110%;
text-align: left;
}

The default CSS for div.io is this:

div.io {
    padding-left: 4%;
}

So I think your introductory outline is changed.

In the next version of Scripture App Builder, USFM tables (\tr, \tc, etc.) are supported in the introduction.

4 Likes