Problems including front matter elements in diglots

I am able to include our preface using this in the “local front matter” in PTXPrint:

\rem -------------------------------------------------------------------------
\periph Preface|id=“preface”
\rem -------------------------------------------------------------------------
\zgetperiph|preface*

In the INT book, I have the preface marked like this:

\periph Preface|id=“preface”

The preface I am getting in my PDFs is from the INT book of the secondary text. I would like it to be from the primary text, but I think my teammates will want both. How can I do that?

A related issue: When I make a change to the preface in Paratext and save it, then print in PTXPrint, it can take several tries before PTXPrint remembers to refresh its content for the Preface. If I load a different configuration and come back to the one I’m using, PTXPrint will pick up the new version of the Preface.

Also, I can’t get a \fig to work in the Preface at all.

One last one: my changes in PrintDraftChanges.txt are not being applied to the Preface, but they are in the books of the main body of the publication.

Thanks for any help you can give me on these issues.

John Nystrom

Dealing with your issues in what’s probably random order…

  • (guess) changes files: yes, they ought to be applied to INT… is INT listed as a book to include, or are you relying on PTXprint including it ‘behind the scenes’. I vaguely remember it might make a difference. (Or might give you duplication…)

  • \periph|preface\* ... \zgetperiph|preface\* EEK! . Please don’t define a preface that includes the preface.
    You’re welcome to use a line that says:
    \periph Preface
    without giving it an ID. That shouldn’t have any bad side effects, but what you listed says ‘I’m defining this thing called preface to be some text that includes this thing called preface’ which gets a bit circular. You probably don’t want that. I suppose you might get away with it if you’re careful to specify all the sides properly (see below), since I think there are 3 prefaces in a diglot - one for L (primary) one for R (secondary) and one for no-side-specified . But as written it’s going to give behaviour I don’t want to try predicting, and a minor change somewhere it might make it blow up in the face of one of your local translator friends in strange and ‘interesting’ ways.

  • (guess) Changes not taking effect… are you pressing save? Maybe the editor isn’t writing the file properly if you just hit print??

  • Which preface is preface. Hmm let me have a read of the code… Oh good, I wasn’t imaging it. In a diglot, the code should load and save \periph|id="preface" in a side-appropriate way, based upon the current / last setting. I’m guessing it thinks it’s on the secondary when its processing your FRT book. You should be able to access both (all three) like this:

\rem left preface
\zglot|L\*
\zgetperiph|preface\*

\rem right preface
\zglot|R\*
\zgetperiph|preface\*

\rem is there a 'no-sides preface'? It almost certainly won't work fully before 2.4.50.
\zglot|\*
\zgetperiph|preface\*

(where the \zglot |\* milestones do the font-switching you’d expect from a diglot column but without putting things into two columns. Switching to ‘no-side-selected’ is very experimental and may not do anything useful)

Alternatively, if you don’t need font-changes, you should be able to specify the side to zgetperiph like this:

\zgetperiph|id="preface" side="L"\*

Valid values of side are "L" (left/primary), "R" (right/secondary), "" (no-side-selected).
As far as I know none of these bits of code have been tested much, so please report any success / failure!

@David_Gardner

Thank you for your help with this. There are three issues. Maybe they are all related.

Issue 1. PTXPrint is only picking up changes to the Preface if I change what I’m printing, e.g. a different chapter or a different book. Changing books is the most reliable way to get it to refresh the Preface. If I keep printing the same book, it won’t pick up edits to the Preface.

Issue 2. The wrong preface is printing.

I have not been including the INT book in what I print. I’m relying on PTXPrint to get the preface from there.

I tried this:

\rem left preface
\periph Preface
\zglot|L*
\zgetperiph|preface*

I get the same results I got before: It’s printing the Preface from INT in T2, which is wrong. L = T1.

I tried this:

\rem right preface
\periph Preface
\zglot|R*
\zgetperiph|preface*

I got the same result as before. It’s still picking up the Preface from the INT in T2.

Since those didn’t work, I tried the other method you mentioned:

\periph Preface
\zgetperiph|id=“preface” side=“R”*

This made PTXPrint not print the Preface at all.

I tried the same with “L”

\periph Preface
\zgetperiph|id=“preface” side=“L”*

PTXPrint still prints no Preface.

So for now I am using this:

\rem right preface
\periph Preface
\zglot|L*
\zgetperiph|preface*

PTXPrint still prints my T2 Preface, no “L” = T1, as specified.

What I really want is the T1 Preface followed by the T2 Preface.

So this should work:

\rem left preface
\periph Preface
\zglot|L*
\zgetperiph|preface*

\rem right preface
\periph Preface
\zglot|R*
\zgetperiph|preface*

Currently, this prints two copies of the R (T2) Preface.

I tried adding this to the above:

\rem is there a ‘no-sides preface’? It almost certainly won’t work fully before 2.4.50.
\zglot|*
\zgetperiph|preface*

And now I get three copies.

If I leave out the L and R Prefaces and just include the “no sides preface”, I get the T2 preface.

Issue 3. Glossary words not marked in PDF properly

PTXPrint is not correctly marking my example of glossary word marking. It’s formatting them with a different font rather than applying the corner brackets I have chosen on the Body tab. The corner brackets are printing properly in the scripture text, but not in the Preface.

Basic Checks is giving me errors about the frtbak.sty but I don’t understand what’s wrong. Making the “\Marker w” section of frtbak.sty the same as it is in usfm.sty did not help. It is still complaining about three errors:

INT 1:0 #Invalid attribute: \w (frtbak.sty)

INT 1:0 #Citation Form (“gutpela na strongpela ston bilong karim haus|Gutpela ston tru”) is missing from Glossary: \w (frtbak.sty)

I think these first two are probably caused by this one:

INT 1:0 #“gutpela na strongpela ston bilong karim haus|Gutpela ston tru” contains unexpected non-wordforming characters [‘|’]: \w (frtbak.sty).

That non-wordforming character is the appropriate character to separate the form of the Biblical Term Rendering in the text from the citation form in the Glossary. I don’t know why this is a problem in the INT and it’s not a problem in the Bible text.

Thanks for any help you can give me on these things.

Issue 1.
I’ll point Mark/Martin at this thread. (they, of course, will ask for an archive, feel free to preempt!)

Issue 2.
Digging is clearly needed. Can I have an archive too?

Issue 3.
AFAIK, the UI takes the easy way out when formatting \w words and actually runs a regex on them to replace \w ... \w* with the corner brackets.
Option 1: wait for Mark/Martin to apply that regex to more sources of input.
Option 2: Work-around: If, you tell it to use the \w markup, and then you set up this:

\sethook{start}{w}{⌞}
\sethook{end}{w}{⌟}

Then TeX will do the insertion and you ought to have more consistency (whether that’s consistently right or wrong is a different issue!). Hopefully you don’t need to do any font trickery.

Totally hijacking the thread, I do the following bit of overkill for \add, which gives displayable corners like I have in my copy of NIV’84, but (a) they don’t get selected if someone is copying the text and (b) they ‘always work’ because they’re not from a font:

%draw corners:
\def\addmtlquteht{2pt}% height
\def\addmtlqutewd{1.5pt}% width
\def\addmtlqutelw{0.2pt}% linewidth.
\def\beginadd{\lower 1pt \hbox{\vrule width \addmtlqutelw height \addmtlquteht\vrule width \addmtlqutewd height \addmtlqutelw}\kern -1pt}
\def\endadd{\kern -1pt \lower 1pt \hbox{\vrule width \addmtlqutewd height \addmtlqutelw\vrule width \addmtlqutelw height \addmtlquteht}}

\sethook{start}{add}{\beginadd}
\sethook{end}{add}{\endadd}

Feel free to copy/paste/modify and use for your wordlist entries if you like the idea.

[original version]:
Thanks for the archive. It looks like I need to have a discussion with Mark and Martin about FRT handling in diglots. The python code is trying to handle \zgetperiph on its own, and not making a very good job of it.

[edit] Oops. having tried fighting it for a while in the middle of other things, I’ve just realised that the original FRT and INT books (either project) are not included in the archive. I’ll submit a bug report…

@David_Gardner I sent those books. I’m not using the FRT book at all, at least not on purpose.

@John_Nystrom My conclusion so far… until the python side of issue #795 is fixed, the only way to pull in both front matter elements is copy and paste. Sorry.