Skip to content

Preserve algorithm emphasis when loading ulem - #343

Open
ywxy12138 wants to merge 1 commit into
BHOSC:masterfrom
ywxy12138:fix/preserve-algorithm-emphasis
Open

ywxy12138 wants to merge 1 commit into
BHOSC:masterfrom
ywxy12138:fix/preserve-algorithm-emphasis

Conversation

@ywxy12138

Copy link
Copy Markdown

Fixes #328.

Loading ulem without normalem replaces \emph with underlining. algorithm2e uses emphasis for its conditions, so while and if conditions become underlined instead of italic.

Load ulem with normalem to preserve emphasis. Explicit \uline commands and the template's cover helpers remain available. Add a regression document that rejects non-italic emphasis and includes the reported algorithm and three explicit underline examples.

Validation with Tectonic 0.17.0:

  • The package interaction example reproduces the unwanted underlines before the change. After the change, conditions are italic and the explicit underline has the same segment lengths. Both PDFs were rendered and inspected.
  • The class regression document fails its italic assertion against the original class and compiles successfully against the patched class. The resulting PDF shows italic conditions and all three explicit underlines.
  • The class comparison used the same temporary font substitutions in both copies: Liberation Serif for Times New Roman, Fandol Song/Hei/Kai for the four unavailable Chinese fonts, and fontset=fandol. No font settings are changed in this patch. This does not validate the required thesis fonts or the full sample theses.
  • git diff --check passes.

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.

Conditions in algorithm are underlined automatically using algorithm2e package and TeXLive 2022

1 participant