diff --git a/templates/tex/macros.tex b/templates/tex/macros.tex index 58ef810..39ef123 100644 --- a/templates/tex/macros.tex +++ b/templates/tex/macros.tex @@ -1,6 +1,6 @@ {%- macro requirement_filter(text) -%}{{ text.replace('<', '$<$').replace('>', '$>$').replace('_', '\\_') }} {%- endmacro -%} -{%- macro latex_filter(text) -%}{{ requirement_filter(text.replace('"', '\'')).replace('/xc2/xb0', '$^\circ$').replace('/', '/\\allowbreak ').replace('&', '\\allowbreak \\&').replace('->', '$\\rightarrow$').replace('<-', '$\\leftarrow$').replace('=>', '$\\Rightarrow$').replace('<=', '$\\leq$').replace('>=', '$\\geq$').replace('{', '\{').replace('}', '\}').replace('#', '\\#')}} +{%- macro latex_filter(text) -%}{{ text.replace('\\', '/').replace('%', '\\%').replace('/xc2/xb0', '$^\circ$').replace('"', '\'').replace('/', '/\\allowbreak ').replace('&', '\\allowbreak \\&').replace('_', '\\_').replace('->', '$\\rightarrow$').replace('<-', '$\\leftarrow$').replace('=>', '$\\Rightarrow$').replace('<=', '$\\leq$').replace('>=', '$\\geq$').replace('<', '$<$').replace('>', '$>$').replace('{', '\{').replace('}', '\}').replace('#', '\\#')}} {%- endmacro -%} {%- macro color_by_level(level) -%}{% if level <= 10 %}black{% else %}{% if level <= 20 %}green{% else %}{% if level <= 30 %}orange{% else %}red{% endif %}{% endif %}{% endif %} diff --git a/templates/tex/requirement_specification.tex b/templates/tex/requirement_specification.tex index f753d42..77e090c 100644 --- a/templates/tex/requirement_specification.tex +++ b/templates/tex/requirement_specification.tex @@ -9,7 +9,7 @@ {%- if item.system_type_uid == '_4-K5EHYYEem_kd-7nxt1sg' %} \section{ {{macros.latex_filter(item.Heading)}} } {%- elif item.system_type_uid == '_MR7eNHYYEem_kd-7nxt1sg' %} - \subsection{\xspace{}{{ item.ID }}: {{ item.Heading }} } + \subsection{\xspace{}{{ item.ID }}: {{ macros.latex_filter(item.Heading) }} } {%- if 'Description' in item and item.Description != '' %} {{ item.Description }} {%- if 'ReasonForImplementation' in item and item.ReasonForImplementation != '' or 'Fitcriterion' in item and item.Fitcriterion != ''%}