\cl in Paratext not showing correctly in SAB

Hi there. I am using \cl in Paratext to get the word ‘chapter’ to show before a chapter number. However, this doesn’t work in SAB (or the Paratext preview for that matter).

According to the USFM reference:
\cl Psalm
\c 1
Should show as
Psalm 1
(on one line)

But when we have:
\cl Chapter
\c 1
it shows as
Chapter
1
(Often with a heading in between!)

The USFM also says: If \cl is entered once before chapter 1 (\c 1) it represents the text for “chapter” to be used throughout the current book. However, there is no word “Chapter” before the following chapter numbers.

The \cl goes after the chapter \c 1 not before.

Let me know if that doesn’t fix it.

the \c is an organizational element and starts the chapter. Even though the label goes before the chapter number it is part of the chapter so goes after the \c.

It is like that with \s after a \c but the Section head appears before the dropcap chapter number.

You probably need to turn off drop cap chapter numbers.

Thanks, putting the \cl after (and not touching the dropcap settings) just made it so that there is no chapter number at all on chapter one in the app, just the word “chapter”, and chapter 2 and following just have their number.
How do I turn off drop cap chapter numbers?

Reading the documentation as opposed to skimming the documentation helps. I skimmed and did not read. Sorry.

For a generic label as you want the \cl goes before the \c as you had it.

In SAB got to Features
image

Change the Position of number to At the top of the page

This setting is project wide, so if you have two or more collections it will affect all collections.

Thanks - I changed the Position of number to At the top of the page. At least the heading is no longer in between “chapter” and “1”, but they are still on separate lines and there is no word “chapter” before any other chapter (2 and on).

Then I will investigate for that as a bug.

Work arounds:

  1. Add \cl after each \c and put in both the label and number
\c 2
\cl Chapter 2

You could use \cp but that will affect the Chapter menu too.

To add \cl Chapter 2 I’d use RegEx Pal under Paratext Tools > Advanced > RegEx Pal
With the following find and replace lines.

find=(\\c )(\d+)
replace=\1\2\n\\cl Chapter \2

RegEx Pal changes can be dangerous so be careful. The following is not dangerous so I’d recommend that.

  1. Make a custom style.
  • In Styles > Custom Styles tab
  • Click on Add style … button
  • In Style Name type: .c:before
  • In Description type: Add chapter label before chapter number
  • Choose the CSS tab in the lower part.
  • Add this text inside the curly braces:
content: 'Paragraph ';
  • Click OK
  • Make sure your setting is set to Position of number to At the top of the page
  • In the Text Styles tab go to div.c and double click that line.
  • Change the text-align setting to center.

This was tested by me. It works and is perhaps the easiest option.

Thanks!
We would prefer to have “Chapter” at each chapter, but the desire is not so strong that it’s worth changing the Paratext files to fix the app. So for now I’ll just leave it as is. I’ve also asked the question on the Paratext forum since \cl doesn’t show correctly in the preview or RTF export from paratext either.

FYI PT developer said it’s not meant to work in the PT preview/RTF, so it’s just something that needs fixing in SAB.
Thanks!

@Kathy_Dadd there is no need to change your Paratext file. In SAB you can add a change in the changes section. These changes are regular expressions so are very powerful.

You can add in this change to get what you want.

Your find will be:

\\c (\d+)

And replace is:

\\c $1\n\\cl Chapter $1

Worked on my test.

Thanks - that’s easy!!

I also did
Find: \cl Chapter
Replace:

To get rid of the “Chapter” on the line above chapter 1. I put this command first, and it seems to have worked fine.

Great.

This does not change your source files it adds changes to the source files as they are used by SAB.

Thanks, I saw that note in SAB. That’s great, because then I can update the source files and it will still work. So clever!!

Still, if the Paratext USFM specification says that putting \cl before chapter 1 should force a chapter label at the beginning of each chapter in the book, I think SAB should try to implement that. Yes, you can have some work-arounds with RegEx, but consider my case - an entire OT app. I can’t just search for chapter number and replace it with \cl, because I only want that to happen in Psalms, not in other books. And we followed the spec, so we only have \cl before chapter 1, expecting it to be implemented in all chapters of that book.

I’m not sure what Kathy was saying from the developers, but this \cl before chapter 1 works just fine in Paratext Print Draft to PDF.

Hey Jeff,

mcquayi said he would investigate it as a bug, the work-around was just a work-around for me in the mean-time.

Re Paratext, yes it works fine in the PDF, and that is apparently all it should do. It doesn’t work in preview or RTF export, but the Paratext developers said it’s not meant to.

@jeff_heath I agree that it should handle it as per USFM specs.

However not everything gets fixed. (Reality of program support.)

For your example of just Psalms needing \cl, then making a copy of Psalms from Paratext then running RegEx to add the \cl lines needed by SAB is not ideal but not too time consuming.

It argues a stronger case for Changes by book (and collection).

Hi,
any progress on this?
It looks like both versions,
\cl Chaptername
\c1
AND
\c1
\cl Chaptername 1
are currently not supported in SAB

and yes I strongly support the idea of having Changes by book and collection!