Skip to content
Snippets Groups Projects
Commit 70da8615 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

switch tex_excape with split_len for converting value to latex

parent 393dfd06
No related branches found
No related tags found
1 merge request!876Fix: Break line properly into latex when next line starts with `_`
...@@ -513,10 +513,6 @@ def make_par_table(parms): ...@@ -513,10 +513,6 @@ def make_par_table(parms):
line = '' line = ''
for i in range(0, len(seq), length): for i in range(0, len(seq), length):
sub_line = seq[i:i + length] sub_line = seq[i:i + length]
# Ensure proper line break if the
# start of the new line begins with `_`
if sub_line[0] == '_' and line[-1] == "-":
line += '\\'
line += sub_line.replace('/', '/\-') line += sub_line.replace('/', '/\-')
if not any(c in lbc for c in sub_line): if not any(c in lbc for c in sub_line):
line += '\-' line += '\-'
...@@ -532,10 +528,11 @@ def make_par_table(parms): ...@@ -532,10 +528,11 @@ def make_par_table(parms):
len_parms[0] = max_len[0] len_parms[0] = max_len[0]
name = split_len(name, max_len[0]) name = split_len(name, max_len[0])
value = tex_escape(str(p.value)) value = str(p.value)
if len(value) > max_len[1]: if len(value) > max_len[1]:
len_parms[1] = max_len[1] len_parms[1] = max_len[1]
value = split_len(value, max_len[1]) value = split_len(value, max_len[1])
value = tex_escape(value)
if issubclass(p.type, str): if issubclass(p.type, str):
value = "``{}''".format(value) value = "``{}''".format(value)
comment = tex_escape(str(p.comment)[1:]) comment = tex_escape(str(p.comment)[1:])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment