We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1dc5504 commit 2c9cb5fCopy full SHA for 2c9cb5f
utils/compare_results.py
@@ -16,12 +16,12 @@ def parse_bool(value):
16
17
def colorize_delta(text, delta):
18
"""Wrap delta text in green (positive) or red (negative) using LaTeX color syntax for GitHub markdown."""
19
- # Escape special LaTeX characters in the text
+ # Replace % with \% and wrap in \text{} to handle special chars in LaTeX math mode
20
escaped = text.replace("%", "\\%")
21
if delta > 0:
22
- return f"$\\color{{green}}\\textsf{{{escaped}}}$"
+ return f"$\\color{{green}}\\text{{{escaped}}}$"
23
elif delta < 0:
24
- return f"$\\color{{red}}\\textsf{{{escaped}}}$"
+ return f"$\\color{{red}}\\text{{{escaped}}}$"
25
return text
26
27
0 commit comments