Skip to content

Conversation

@Deadpikle
Copy link
Collaborator

@Deadpikle Deadpikle commented Nov 12, 2025

Adjust these numbers (see commit) to get the desired font size for references, then merge this commit. You don't have to stick with what I used. But use this PR to know where to change that information.

EDIT: Will have a solution for intro font sizes "soon".

Part of #683

Adjust these numbers to get the desired font size for references, then merge this commit.
@bountonw
Copy link
Owner

@Deadpikle Changing the \fontsize within the mbox of the \egw tags changes both the fontsize of the book reference and the numbers. I think the box is the right size already (0.8em). The issue is that the English font is larger than the number font, or assuming they are the same font, they are of different sizes or something. This is a very minor problem. It is only an ascetic issue. But through out the book, when there is English, it is slightly larger than its neighboring Lao or numbered text. So it sticks out. It becomes a distraction.

@Deadpikle
Copy link
Collaborator Author

@Deadpikle Changing the \fontsize within the mbox of the \egw tags changes both the fontsize of the book reference and the numbers. I think the box is the right size already (0.8em). The issue is that the English font is larger than the number font, or assuming they are the same font, they are of different sizes or something. This is a very minor problem. It is only an ascetic issue. But through out the book, when there is English, it is slightly larger than its neighboring Lao or numbered text. So it sticks out. It becomes a distraction.

They are the same font. Same sort of deal on m.egwritings.org. See preview of this font on Google Fonts:

Screenshot 2025-11-12 at 4 16 22 PM

Couple different solutions for references:

  1. Use a different font where digits and text are the same size.
  2. Add the following code and adjust Scale value acordingly:

docclass.tex:

\usepackage{fontspec}
...
\newfontfamily\refdigits{Libertinus Serif}[Scale=1.1]

md_spacing_punctuation_to_tex.py:

  • convert_egw_references change end to return re.sub(egw_pattern, r'\\egw{\1\\nbsp{}{\\refdigits \2}}', text)
  • Add the following code to convert_ascii_spaces_to_spacecmd_with_protections:
# 3b) {\refdigits ...} for slightly scaled english numbers
add_spans_from_pattern(r"\{\\refdigits [0-9.]*\}")

This gives you something like this:

Screenshot 2025-11-12 at 4 44 38 PM

You can also fix some of the other English references in this rather bruteforce way:

docclass.tex:

\usepackage{fontspec}
...
`\newfontfamily\smallerscale{Libertinus Serif}[Scale=0.9]`

md_spacing_punctuation_to_tex.py:

  • Add the following function:
def convert_text_references(text: str) -> str:
    arr = ["TKJV", "TH1940", "TNCV", "NTV", "THSV", "THA-ER", "LCV", "KV", "TH1971", "LO1972", "version", "Adventist"]
    for x in arr:
        paraX = "(" + x + ")"
        if (paraX in text):
            text = text.replace(paraX, "{\\smallerscale " + paraX + "}")
        else:
            text = text.replace(x, "{\\smallerscale " + x + "}")
    return text
  • Call said function after converting EGW refs in process_all_spacing_and_punctuationtext = convert_text_references(text)
  • Protect the spans like before: add_spans_from_pattern(r"\{\\smallerscale [0-9A-z]*\}")

Gives you something like this, which looks nice:
Screenshot 2025-11-12 at 5 03 56 PM

Keep in mind that this may or may not adjust spacing and line breaks as it is a font size change.

You could do something similar for English Bible refs. You would simply need to add the additional words to the array to get them converted...or similar.

I'll go ahead and commit the above code so you can see it, but I'm not committed to it. I don't like the idea of a hardcoded English word list. But it's fast, easy, and not complicated, which at this point in the game is what is neeed.

@Deadpikle Deadpikle force-pushed the fix/reference-font-size branch from d35a0e4 to 7efd534 Compare November 12, 2025 08:11
@Deadpikle
Copy link
Collaborator Author

Uhhhh apparently I just force pushed somehow, which was not my intention...sorry. Will message you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants