mirror of
https://github.com/rendercv/rendercv.git
synced 2026-10-23 20:58:59 -04:00
renderer: allow users to make bold or italic text normal (#45)
This commit is contained in:
1 parent
846725814a
commit
d956fe8d84
1 file changed
+16
@@ -180,6 +180,22 @@ class LaTeXFile(TemplatedFile):
|
||||
section_title,
|
||||
is_first_entry,
|
||||
)
|
||||
|
||||
# If there is nested \textbf, \textit, or \underline commands, replace the inner
|
||||
# ones with \textnormal:
|
||||
|
||||
# Find all the nested commands:
|
||||
nested_commands = re.findall(r"\\textbf{.*?(\\textbf{.*?})", result)
|
||||
nested_commands += re.findall(r"\\textit{.*?(\\textit{.*?})", result)
|
||||
nested_commands += re.findall(r"\\underline{.*?(\\underline{.*?})", result)
|
||||
|
||||
# Replace the inner commands with \textnormal:
|
||||
for nested_command in nested_commands:
|
||||
new_command = nested_command.replace("textbf", "textnormal")
|
||||
new_command = new_command.replace("textit", "textnormal")
|
||||
new_command = new_command.replace("underline", "textnormal")
|
||||
result = result.replace(nested_command, new_command)
|
||||
|
||||
return result
|
||||
|
||||
def get_latex_code(self):
|
||||
|
||||
Reference in new issue
Block a user