Browse Source

Template improvements

master
Dirk Alders 2 months ago
parent
commit
d24a1280fc
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      templates/tex/macros.tex
  2. 1
    1
      templates/tex/requirement_specification.tex

+ 1
- 1
templates/tex/macros.tex View File

1
 {%- macro requirement_filter(text) -%}{{ text.replace('<', '$<$').replace('>', '$>$').replace('_', '\\_') }}
1
 {%- macro requirement_filter(text) -%}{{ text.replace('<', '$<$').replace('>', '$>$').replace('_', '\\_') }}
2
 {%- endmacro -%}
2
 {%- endmacro -%}
3
-{%- 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('#', '\\#')}}
3
+{%- 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('#', '\\#')}}
4
 {%- endmacro -%}
4
 {%- endmacro -%}
5
 
5
 
6
 {%- macro color_by_level(level) -%}{% if level <= 10 %}black{% else %}{% if level <= 20 %}green{% else %}{% if level <= 30 %}orange{% else %}red{% endif %}{% endif %}{% endif %}
6
 {%- macro color_by_level(level) -%}{% if level <= 10 %}black{% else %}{% if level <= 20 %}green{% else %}{% if level <= 30 %}orange{% else %}red{% endif %}{% endif %}{% endif %}

+ 1
- 1
templates/tex/requirement_specification.tex View File

9
 		{%- if item.system_type_uid == '_4-K5EHYYEem_kd-7nxt1sg' %}
9
 		{%- if item.system_type_uid == '_4-K5EHYYEem_kd-7nxt1sg' %}
10
 			\section{ {{macros.latex_filter(item.Heading)}} }
10
 			\section{ {{macros.latex_filter(item.Heading)}} }
11
 		{%- elif item.system_type_uid == '_MR7eNHYYEem_kd-7nxt1sg' %}
11
 		{%- elif item.system_type_uid == '_MR7eNHYYEem_kd-7nxt1sg' %}
12
-			\subsection{\xspace{}{{ item.ID }}: {{ item.Heading }} }
12
+			\subsection{\xspace{}{{ item.ID }}: {{ macros.latex_filter(item.Heading) }} }
13
 			{%- if 'Description' in item and item.Description != '' %}
13
 			{%- if 'Description' in item and item.Description != '' %}
14
 				{{ item.Description }}
14
 				{{ item.Description }}
15
 			 	{%- if 'ReasonForImplementation' in item and item.ReasonForImplementation != '' or 'Fitcriterion' in item and item.Fitcriterion != ''%}
15
 			 	{%- if 'ReasonForImplementation' in item and item.ReasonForImplementation != '' or 'Fitcriterion' in item and item.Fitcriterion != ''%}

Loading…
Cancel
Save