0 votes

In my ptxprint-mods.tex file, I want to do some specific adjustments around punctuation. Here is the adjustment around colons:

\catcode`\:=\active \def:{\unskip\kern0.25em\char`\:{}} % colon

Unfortunately this messes up the inclusion of PDF files, like a PDF with title and credit pages. I get this at the top of my output:

image

Can someone help me figure out how I can get both of those? Thanks.

PTXprint by (1.3k points)
reshown

3 Answers

0 votes

Just FYI - I tried putting the PDF file to include in the PrintDraft folder, but it still uses a full path (with a colon).

by (1.3k points)
0 votes

I have a temporary word-around. I comment out the .tex line above (with “%”), then add the following into my PrintDraftChanges.txt file:

'(?<!\\ft) *:( |\n)' > '\u202f:\1' # Place non-breaking thin space before colon

In my particular case, I didn’t want to replace the space after the \ft marker (as it makes it not work anymore), so I put in a little negative look-behind there. And the colon can actual occur at the end of the line, so I have to look for either a space or a newline after the colon.

This works because I’m adding a little more context into the search string, so it avoids changing the colon in the PDF file path.

I would prefer to find another solution, if possible, since I don’t have nearly as much control with \u202f as I do with the \kern command in the .tex file. But this at least gives me a rough approximation, to move forward in my typesetting.

by (1.3k points)

Remember the changes only apply on the USFM files, so you don’t have to worry about encountering PDF filenames in there.

You can regain your control by using pretty much any code you want and then in your ptxprint-mods.tex you can do things like:

\def\mycolonkern{\unskip\kern0.25em}
\catcode"202F=\active \def^^^^202f{\mycolonkern}

Note the careful use of uppercase hex codes in the catcode statement and lowercase hex codes in the def. Gets me every time! Anyway, now you have some million characters you can use for all kinds of craziness :slight_smile:

0 votes

Rather than making colon active, can XeTeX’s \interchartoks help here? I’ve only read about it, never used it, but it seems like it ought to work.

by (294 points)
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
For where two or three gather in my name, there am I with them.
Matthew 18:20
2,628 questions
5,370 answers
5,045 comments
1,420 users