Compare commits

...

3 Commits

Author SHA1 Message Date
Nicolas 98d40a21f6 test/example outputs updated 2025-05-04 14:36:50 +02:00
Nicolas d2193c2526 tests updated for linked HTML references 2025-05-04 14:35:57 +02:00
Nicolas 0d5c5c727c referencing issue fixed 2025-05-04 14:35:25 +02:00
9 changed files with 671 additions and 88 deletions

View File

@ -298,13 +298,13 @@ class DocumentWriter():
self._item_index: dict[str, int] = {} self._item_index: dict[str, int] = {}
self._fig_scale: float = 1 self._fig_scale: float = 1
def _add_item(self, ref_id: str, ref_type: str, caption_prefix: str) -> str: def _add_item(self, ref_id: str, ref_type: str, caption_prefix: str) -> tuple[str, str]:
current_index = self._item_count.get(ref_type, 0) + 1 current_index = self._item_count.get(ref_type, 0) + 1
if not ref_id: if not ref_id:
ref_id = str(current_index) ref_id = f"auto{current_index}"
self._item_index[f"{ref_type}:{ref_id}"] = current_index self._item_index[f"{ref_type}:{ref_id}"] = current_index
self._item_count[ref_type] = current_index self._item_count[ref_type] = current_index
return caption_prefix.format(current_index) return caption_prefix.format(current_index), latex.normalize_label_text(f"{ref_type}:{ref_id}")
def _equation_embedding_reescaping(self, text: str) -> str: def _equation_embedding_reescaping(self, text: str) -> str:
""" """
@ -333,9 +333,8 @@ class DocumentWriter():
parts = latex_label.split(':') parts = latex_label.split(':')
ref_type = parts[0] ref_type = parts[0]
ref_id = parts[1] ref_id = parts[1]
caption = self._add_item(ref_id, ref_type, '({})') caption, reference = self._add_item(ref_id, ref_type, '({})')
return (f'\n<latex type="block" ref_type="{ref_type}"' return (f'\n<latex type="block" reference="{reference}" caption="{caption}">{content}</latex>\n')
f' ref_id="{ref_id}" caption="{caption}">{content}</latex>\n')
else: else:
return f'\n<latex type="block">{content}</latex>\n' return f'\n<latex type="block">{content}</latex>\n'
@ -349,12 +348,12 @@ class DocumentWriter():
return inline_pattern.sub(inline_repl, result) return inline_pattern.sub(inline_repl, result)
def _get_equation_html(self, latex_equation: str, caption: str, full_ref_str: str, block: bool = False) -> str: def _get_equation_html(self, latex_equation: str, caption: str, reference: str, block: bool = False) -> str:
fig = latex_to_figure(latex_equation) fig = latex_to_figure(latex_equation)
if block: if block:
fig_str = figure_to_string(fig, self._figure_format, base64=self._base64_svgs) fig_str = figure_to_string(fig, self._figure_format, base64=self._base64_svgs)
ret = ('<div class="equation-container" ' ret = ('<div class="equation-container" '
f'id="{full_ref_str}">' f'id="pyld-ref-{reference}">'
f'<div class="equation">{fig_str}</div>' f'<div class="equation">{fig_str}</div>'
f'<div class="equation-number">{caption}</div></div>') f'<div class="equation-number">{caption}</div></div>')
else: else:
@ -372,7 +371,7 @@ class DocumentWriter():
self.modified_html = StringIO() self.modified_html = StringIO()
self.in_latex: bool = False self.in_latex: bool = False
self.eq_caption: str = '' self.eq_caption: str = ''
self.full_ref_str: str = '' self.reference: str = ''
self.block: bool = False self.block: bool = False
self.dw = document_writer self.dw = document_writer
@ -383,8 +382,7 @@ class DocumentWriter():
self.in_latex = True self.in_latex = True
attr_dict = {k: v if v else '' for k, v in attrs} attr_dict = {k: v if v else '' for k, v in attrs}
self.eq_caption = attr_dict.get('caption', '') self.eq_caption = attr_dict.get('caption', '')
self.full_ref_str = latex.normalize_label_text( self.reference = attr_dict.get('reference', '')
f"pyld-ref-{attr_dict.get('ref_type', '')}:{attr_dict.get('ref_id', '')}")
self.block = attr_dict.get('type') == 'block' self.block = attr_dict.get('type') == 'block'
elif not self.in_latex: elif not self.in_latex:
tag_text = self.get_starttag_text() tag_text = self.get_starttag_text()
@ -394,7 +392,7 @@ class DocumentWriter():
def handle_data(self, data: str) -> None: def handle_data(self, data: str) -> None:
if self.in_latex: if self.in_latex:
self.modified_html.write( self.modified_html.write(
self.dw._get_equation_html(data, self.eq_caption, self.full_ref_str, self.block)) self.dw._get_equation_html(data, self.eq_caption, self.reference, self.block))
else: else:
self.modified_html.write(data) self.modified_html.write(data)
@ -434,20 +432,19 @@ class DocumentWriter():
""" """
def render_to_html() -> str: def render_to_html() -> str:
caption_prefix = self._add_item(ref_id, ref_type, prefix_pattern) caption_prefix, reference = self._add_item(ref_id, ref_type, prefix_pattern)
full_ref_str = latex.normalize_label_text(f"pyld-ref-{ref_type}:{ref_id}") return '<div id="pyld-ref-%s" class="figure">%s%s</div>' % (
return '<div id="%s" class="figure">%s%s</div>' % ( reference,
full_ref_str,
figure_to_string(fig, self._figure_format, base64=self._base64_svgs, scale=self._fig_scale), figure_to_string(fig, self._figure_format, base64=self._base64_svgs, scale=self._fig_scale),
'<br>' + caption_prefix + escape_html(caption) if caption else '') '<br>' + caption_prefix + escape_html(caption) if caption else '')
def render_to_latex() -> str: def render_to_latex() -> str:
self._add_item(ref_id, ref_type, prefix_pattern) _, reference = self._add_item(ref_id, ref_type, prefix_pattern)
return '\\begin{figure}%s\n%s\n\\caption{%s}\n%s\\end{figure}' % ( return '\\begin{figure}%s\n%s\n\\caption{%s}\n%s\\end{figure}' % (
'\n\\centering' if centered else '', '\n\\centering' if centered else '',
figure_to_string(fig, 'pgf', self._font_family, scale=self._fig_scale), figure_to_string(fig, 'pgf', self._font_family, scale=self._fig_scale),
latex.escape_text(caption), latex.escape_text(caption),
'\\label{%s}\n' % latex.normalize_label_text(ref_type + ':' + ref_id) if ref_id else '') '\\label{%s}\n' % latex.normalize_label_text(reference) if ref_id else '')
self._doc.append([render_to_html, render_to_latex]) self._doc.append([render_to_html, render_to_latex])
@ -471,25 +468,23 @@ class DocumentWriter():
assert isinstance(styler, Styler), 'Jinja2 package is required for rendering tables' assert isinstance(styler, Styler), 'Jinja2 package is required for rendering tables'
def render_to_html() -> str: def render_to_html() -> str:
full_ref_str = latex.normalize_label_text(f"pyld-ref-{ref_type}:{ref_id}") caption_prefix, reference = self._add_item(ref_id, ref_type, prefix_pattern)
caption_prefix = self._add_item(ref_id, ref_type, prefix_pattern)
html_string = styler.to_html(table_uuid=ref_id, caption=caption_prefix + escape_html(caption)) html_string = styler.to_html(table_uuid=ref_id, caption=caption_prefix + escape_html(caption))
return f'<div id="{full_ref_str}">' + re.sub(r'<style.*?>.*?</style>', '', html_string, flags=re.DOTALL) + '</div>' return f'<div id="pyld-ref-{reference}">' + re.sub(r'<style.*?>.*?</style>', '', html_string, flags=re.DOTALL) + '</div>'
def render_to_latex() -> str: def render_to_latex() -> str:
self._add_item(ref_id, ref_type, prefix_pattern) _, reference = self._add_item(ref_id, ref_type, prefix_pattern)
ref_label = latex.normalize_label_text(ref_type + ':' + ref_id)
if self._table_renderer == 'pandas': if self._table_renderer == 'pandas':
return styler.to_latex( return styler.to_latex(
label=ref_label, label=reference,
hrules=True, hrules=True,
convert_css=True, convert_css=True,
siunitx=True, siunitx=True,
caption=latex.escape_text(caption), caption=latex.escape_text(caption),
position_float='centering' if centered else None) position_float='centering' if centered else None)
else: else:
return latex.render_pandas_styler_table(styler, caption, ref_label, centered) return latex.render_pandas_styler_table(styler, caption, reference, centered)
self._doc.append([render_to_html, render_to_latex]) self._doc.append([render_to_html, render_to_latex])
@ -588,13 +583,12 @@ class DocumentWriter():
""" """
def render_to_html() -> str: def render_to_html() -> str:
caption = self._add_item(ref_id, ref_type, '({})') caption, reference = self._add_item(ref_id, ref_type, '({})')
full_ref_str = latex.normalize_label_text(f"pyld-ref-{ref_type}:{ref_id}") return self._get_equation_html(latex_equation, caption, reference, block=True)
return self._get_equation_html(latex_equation, caption, full_ref_str)
def render_to_latex() -> str: def render_to_latex() -> str:
self._add_item(ref_id, ref_type, '') _, reference = self._add_item(ref_id, ref_type, '')
return latex.get_equation_code(latex_equation, ref_type, ref_id) return latex.get_equation_code(latex_equation, reference, block=True)
self._doc.append([render_to_html, render_to_latex]) self._doc.append([render_to_html, render_to_latex])

View File

@ -82,19 +82,18 @@ def escape_text(text: str) -> str:
return ''.join(ret) return ''.join(ret)
def get_equation_code(equation: str, ref_id: str, ref_type: str, block: bool = False) -> str: def get_equation_code(equation: str, reference: str | None, block: bool = False) -> str:
""" """
Converts an equation string to LaTeX code. Converts an equation string to LaTeX code.
Args: Args:
equation: The LaTeX equation string. equation: The LaTeX equation string.
ref_id: The reference ID for the equation. reference: The reference type and ID for the equation separated by a ':'.
ref_type: The type of reference (e.g., 'eq', 'fig', etc.).
""" """
if block: if block:
if ref_id: if reference:
return '\\begin{equation}\\label{%s:%s}%s\\end{equation}' % ( return '\\begin{equation}\\label{%s}%s\\end{equation}' % (
normalize_label_text(ref_type), normalize_label_text(ref_id), equation) normalize_label_text(reference), equation)
else: else:
return '\\[%s\\]' % equation return '\\[%s\\]' % equation
else: else:
@ -239,9 +238,8 @@ def from_html(html_code: str) -> str:
def handle_data(self, data: str) -> None: def handle_data(self, data: str) -> None:
if self.equation_flag: if self.equation_flag:
block = self.attr_dict.get('type') == 'block' block = self.attr_dict.get('type') == 'block'
ref_id = self.attr_dict.get('ref_id', '') reference = self.attr_dict.get('reference')
ref_type = self.attr_dict.get('ref_type', 'eq') self.latex_code.append(get_equation_code(data, reference, block))
self.latex_code.append(get_equation_code(data, ref_id, ref_type, block))
elif data.strip(): elif data.strip():
self.latex_code.append(escape_text(data)) self.latex_code.append(escape_text(data))

View File

@ -222,8 +222,8 @@ z
</g> </g>
</svg> </svg>
</span>, can expressed as </span>, can expressed as
shown in equation 1. shown in equation <a href="#pyld-ref-eq:lambda-mixture">1</a>.
<div class="equation-container"><div class="equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="100.888782pt" height="43.88076pt" viewBox="0 0 100.888782 43.88076" xmlns="http://www.w3.org/2000/svg" version="1.1"> <div class="equation-container" id="pyld-ref-eq:lambda-mixture"><div class="equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="100.888782pt" height="43.88076pt" viewBox="0 0 100.888782 43.88076" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs> <defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
@ -1000,8 +1000,8 @@ z
</g> </g>
</g> </g>
</svg> </svg>
</span> is given by the relation shown in equation 2. </span> is given by the relation shown in equation <a href="#pyld-ref-eq:interaction-parameter">2</a>.
<div class="equation-container"><div class="equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="221.766721pt" height="26.13pt" viewBox="0 0 221.766721 26.13" xmlns="http://www.w3.org/2000/svg" version="1.1"> <div class="equation-container" id="pyld-ref-eq:interaction-parameter"><div class="equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="221.766721pt" height="26.13pt" viewBox="0 0 221.766721 26.13" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs> <defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
@ -1607,9 +1607,9 @@ z
</g> </g>
</svg> </svg>
</span>, respectively. </span>, respectively.
Molar masses and thermal conductivity of the pure substances are listed in table 1. Molar masses and thermal conductivity of the pure substances are listed in table <a href="#pyld-ref-table:gas-probs">1</a>.
The structure of this expression illustrates the nonlinear dependence of the interaction term on The structure of this expression illustrates the nonlinear dependence of the interaction term on
both the molar mass ratio and the square root of the conductivity ratio of the involved species.</p> both the molar mass ratio and the square root of the conductivity ratio of the involved species.</p><div id="pyld-ref-table:gas-probs">
<table id="T_gas_probs"> <table id="T_gas_probs">
<caption>Table 1: Properties of some gases</caption> <caption>Table 1: Properties of some gases</caption>
<thead> <thead>
@ -1657,7 +1657,7 @@ both the molar mass ratio and the square root of the conductivity ratio of the i
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>This formulation acknowledges that the transport properties of a gas mixture are not a simple </div><p>This formulation acknowledges that the transport properties of a gas mixture are not a simple
linear combination of the individual conductivities. Rather, they are governed by intermolecular linear combination of the individual conductivities. Rather, they are governed by intermolecular
interactions, which affect the energy exchange and diffusion behavior of each component. These interactions, which affect the energy exchange and diffusion behavior of each component. These
interactions are particularly significant at elevated pressures or in cases where the gas components interactions are particularly significant at elevated pressures or in cases where the gas components
@ -1666,7 +1666,7 @@ exhibit widely differing molecular masses or transport properties.</p>
dominate the behavior of the mixture, while higher-order (three-body or more) interactions are dominate the behavior of the mixture, while higher-order (three-body or more) interactions are
neglected. It also presumes that the gases approximate ideal behavior, although in practical neglected. It also presumes that the gases approximate ideal behavior, although in practical
applications, moderate deviations from ideality are tolerated without significant loss of accuracy. applications, moderate deviations from ideality are tolerated without significant loss of accuracy.
In figure 1 the resulting thermal conductivity of an H2/CO2-mixture is shown.</p><div class="figure"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="460.8pt" height="345.6pt" viewBox="0 0 460.8 345.6" xmlns="http://www.w3.org/2000/svg" version="1.1"> In figure <a href="#pyld-ref-fig:mixture">1</a> the resulting thermal conductivity of an H2/CO2-mixture is shown.</p><div id="pyld-ref-fig:mixture" class="figure"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="460.8pt" height="345.6pt" viewBox="0 0 460.8 345.6" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs> <defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
@ -1693,12 +1693,12 @@ z
<g id="xtick_1"> <g id="xtick_1">
<g id="line2d_1"> <g id="line2d_1">
<defs> <defs>
<path id="mb008c18593" d="M 0 0 <path id="mf4a3ad7913" d="M 0 0
L 0 3.5 L 0 3.5
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#mb008c18593" x="73.832727" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="73.832727" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_1"> <g id="text_1">
@ -1734,7 +1734,7 @@ z
<g id="xtick_2"> <g id="xtick_2">
<g id="line2d_2"> <g id="line2d_2">
<g> <g>
<use xlink:href="#mb008c18593" x="138.763636" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="138.763636" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_2"> <g id="text_2">
@ -1774,7 +1774,7 @@ z
<g id="xtick_3"> <g id="xtick_3">
<g id="line2d_3"> <g id="line2d_3">
<g> <g>
<use xlink:href="#mb008c18593" x="203.694545" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="203.694545" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_3"> <g id="text_3">
@ -1809,7 +1809,7 @@ z
<g id="xtick_4"> <g id="xtick_4">
<g id="line2d_4"> <g id="line2d_4">
<g> <g>
<use xlink:href="#mb008c18593" x="268.625455" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="268.625455" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_4"> <g id="text_4">
@ -1855,7 +1855,7 @@ z
<g id="xtick_5"> <g id="xtick_5">
<g id="line2d_5"> <g id="line2d_5">
<g> <g>
<use xlink:href="#mb008c18593" x="333.556364" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="333.556364" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_5"> <g id="text_5">
@ -1910,7 +1910,7 @@ z
<g id="xtick_6"> <g id="xtick_6">
<g id="line2d_6"> <g id="line2d_6">
<g> <g>
<use xlink:href="#mb008c18593" x="398.487273" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mf4a3ad7913" x="398.487273" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_6"> <g id="text_6">
@ -2244,12 +2244,12 @@ z
<g id="ytick_1"> <g id="ytick_1">
<g id="line2d_7"> <g id="line2d_7">
<defs> <defs>
<path id="mf9eb644810" d="M 0 0 <path id="m81bb8c222c" d="M 0 0
L -3.5 0 L -3.5 0
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="283.089415" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="283.089415" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_8"> <g id="text_8">
@ -2300,7 +2300,7 @@ z
<g id="ytick_2"> <g id="ytick_2">
<g id="line2d_8"> <g id="line2d_8">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="246.188866" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="246.188866" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_9"> <g id="text_9">
@ -2317,7 +2317,7 @@ z
<g id="ytick_3"> <g id="ytick_3">
<g id="line2d_9"> <g id="line2d_9">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="209.288317" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="209.288317" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_10"> <g id="text_10">
@ -2346,7 +2346,7 @@ z
<g id="ytick_4"> <g id="ytick_4">
<g id="line2d_10"> <g id="line2d_10">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="172.387768" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="172.387768" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_11"> <g id="text_11">
@ -2363,7 +2363,7 @@ z
<g id="ytick_5"> <g id="ytick_5">
<g id="line2d_11"> <g id="line2d_11">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="135.487219" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="135.487219" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_12"> <g id="text_12">
@ -2380,7 +2380,7 @@ z
<g id="ytick_6"> <g id="ytick_6">
<g id="line2d_12"> <g id="line2d_12">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="98.58667" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="98.58667" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_13"> <g id="text_13">
@ -2397,7 +2397,7 @@ z
<g id="ytick_7"> <g id="ytick_7">
<g id="line2d_13"> <g id="line2d_13">
<g> <g>
<use xlink:href="#mf9eb644810" x="57.6" y="61.686121" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m81bb8c222c" x="57.6" y="61.686121" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_14"> <g id="text_14">
@ -2764,7 +2764,7 @@ L 388.649256 158.516825
L 391.928595 134.536585 L 391.928595 134.536585
L 395.207934 101.572135 L 395.207934 101.572135
L 398.487273 53.568 L 398.487273 53.568
" clip-path="url(#p0dca0ea72d)" style="fill: none; stroke: #000000; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pda44b66cf6)" style="fill: none; stroke: #000000; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="patch_3"> <g id="patch_3">
<path d="M 57.6 307.584 <path d="M 57.6 307.584
@ -2789,7 +2789,7 @@ L 414.72 41.472
</g> </g>
</g> </g>
<defs> <defs>
<clipPath id="p0dca0ea72d"> <clipPath id="pda44b66cf6">
<rect x="57.6" y="41.472" width="357.12" height="266.112"/> <rect x="57.6" y="41.472" width="357.12" height="266.112"/>
</clipPath> </clipPath>
</defs> </defs>

View File

@ -198,7 +198,7 @@
</table> </table>
<hr></hr> <hr></hr>
<h1>Equations</h1> <h1>Equations</h1>
<p>This line represents a reference to the equation 1.</p><span class="inline-equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="102.120397pt" height="34.4322pt" viewBox="0 0 102.120397 34.4322" xmlns="http://www.w3.org/2000/svg" version="1.1"> <p>This line represents a reference to the equation <a href="#pyld-ref-eq:test1">1</a>.</p><div class="equation-container" id="pyld-ref-eq:test1"><div class="equation"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="102.120397pt" height="34.4322pt" viewBox="0 0 102.120397 34.4322" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs> <defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
@ -474,7 +474,7 @@ z
</g> </g>
</g> </g>
</svg> </svg>
</span><div class="figure"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="460.8pt" height="345.6pt" viewBox="0 0 460.8 345.6" xmlns="http://www.w3.org/2000/svg" version="1.1"> </div><div class="equation-number">(1)</div></div><div id="pyld-ref-fig:auto1" class="figure"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="460.8pt" height="345.6pt" viewBox="0 0 460.8 345.6" xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs> <defs>
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style> <style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
@ -503,7 +503,7 @@ L 142.181053 307.584
L 142.181053 206.208 L 142.181053 206.208
L 73.832727 206.208 L 73.832727 206.208
z z
" clip-path="url(#p8886bfdb0f)" style="fill: #d62728"/> " clip-path="url(#p28ed524191)" style="fill: #d62728"/>
</g> </g>
<g id="patch_4"> <g id="patch_4">
<path d="M 159.268134 307.584 <path d="M 159.268134 307.584
@ -511,7 +511,7 @@ L 227.616459 307.584
L 227.616459 54.144 L 227.616459 54.144
L 159.268134 54.144 L 159.268134 54.144
z z
" clip-path="url(#p8886bfdb0f)" style="fill: #1f77b4"/> " clip-path="url(#p28ed524191)" style="fill: #1f77b4"/>
</g> </g>
<g id="patch_5"> <g id="patch_5">
<path d="M 244.703541 307.584 <path d="M 244.703541 307.584
@ -519,7 +519,7 @@ L 313.051866 307.584
L 313.051866 231.552 L 313.051866 231.552
L 244.703541 231.552 L 244.703541 231.552
z z
" clip-path="url(#p8886bfdb0f)" style="fill: #d62728"/> " clip-path="url(#p28ed524191)" style="fill: #d62728"/>
</g> </g>
<g id="patch_6"> <g id="patch_6">
<path d="M 330.138947 307.584 <path d="M 330.138947 307.584
@ -527,18 +527,18 @@ L 398.487273 307.584
L 398.487273 168.192 L 398.487273 168.192
L 330.138947 168.192 L 330.138947 168.192
z z
" clip-path="url(#p8886bfdb0f)" style="fill: #ff7f0e"/> " clip-path="url(#p28ed524191)" style="fill: #ff7f0e"/>
</g> </g>
<g id="matplotlib.axis_1"> <g id="matplotlib.axis_1">
<g id="xtick_1"> <g id="xtick_1">
<g id="line2d_1"> <g id="line2d_1">
<defs> <defs>
<path id="m5bc4660a75" d="M 0 0 <path id="m4b433885f0" d="M 0 0
L 0 3.5 L 0 3.5
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m5bc4660a75" x="108.00689" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m4b433885f0" x="108.00689" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_1"> <g id="text_1">
@ -648,7 +648,7 @@ z
<g id="xtick_2"> <g id="xtick_2">
<g id="line2d_2"> <g id="line2d_2">
<g> <g>
<use xlink:href="#m5bc4660a75" x="193.442297" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m4b433885f0" x="193.442297" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_2"> <g id="text_2">
@ -753,7 +753,7 @@ z
<g id="xtick_3"> <g id="xtick_3">
<g id="line2d_3"> <g id="line2d_3">
<g> <g>
<use xlink:href="#m5bc4660a75" x="278.877703" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m4b433885f0" x="278.877703" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_3"> <g id="text_3">
@ -813,7 +813,7 @@ z
<g id="xtick_4"> <g id="xtick_4">
<g id="line2d_4"> <g id="line2d_4">
<g> <g>
<use xlink:href="#m5bc4660a75" x="364.31311" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m4b433885f0" x="364.31311" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_4"> <g id="text_4">
@ -909,12 +909,12 @@ z
<g id="ytick_1"> <g id="ytick_1">
<g id="line2d_5"> <g id="line2d_5">
<defs> <defs>
<path id="mb5327dd54d" d="M 0 0 <path id="m9bfc9845c8" d="M 0 0
L -3.5 0 L -3.5 0
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="307.584" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="307.584" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_5"> <g id="text_5">
@ -950,7 +950,7 @@ z
<g id="ytick_2"> <g id="ytick_2">
<g id="line2d_6"> <g id="line2d_6">
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="256.896" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="256.896" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_6"> <g id="text_6">
@ -990,7 +990,7 @@ z
<g id="ytick_3"> <g id="ytick_3">
<g id="line2d_7"> <g id="line2d_7">
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="206.208" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="206.208" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_7"> <g id="text_7">
@ -1025,7 +1025,7 @@ z
<g id="ytick_4"> <g id="ytick_4">
<g id="line2d_8"> <g id="line2d_8">
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="155.52" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="155.52" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_8"> <g id="text_8">
@ -1071,7 +1071,7 @@ z
<g id="ytick_5"> <g id="ytick_5">
<g id="line2d_9"> <g id="line2d_9">
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="104.832" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="104.832" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_9"> <g id="text_9">
@ -1126,7 +1126,7 @@ z
<g id="ytick_6"> <g id="ytick_6">
<g id="line2d_10"> <g id="line2d_10">
<g> <g>
<use xlink:href="#mb5327dd54d" x="57.6" y="54.144" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#m9bfc9845c8" x="57.6" y="54.144" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_10"> <g id="text_10">
@ -1457,12 +1457,12 @@ z
</g> </g>
</g> </g>
<defs> <defs>
<clipPath id="p8886bfdb0f"> <clipPath id="p28ed524191">
<rect x="57.6" y="41.472" width="357.12" height="266.112"/> <rect x="57.6" y="41.472" width="357.12" height="266.112"/>
</clipPath> </clipPath>
</defs> </defs>
</svg> </svg>
<br>Figure 1: Bar chart with individual bar colors</div> <br>Figure 1: Bar chart with individual bar colors</div><div id="pyld-ref-table:example1">
<table id="T_example1"> <table id="T_example1">
<caption>Table 1: This is a example table</caption> <caption>Table 1: This is a example table</caption>
<thead> <thead>
@ -1524,6 +1524,6 @@ z
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</body> </body>

View File

@ -0,0 +1,589 @@
\section{Special characters}
{\"o} {\"a} {\"u} {\"O} {\"A} {\"U} {\ss} @ $\Delta$
$\pi$ $\approx$ $\pm$ $\Delta$ $\Sigma$
{\pounds} {\yen} \$
{\OE}
\section{Link}
This is a hyperlink: \href{https://www.nonan.net}{nonan.net}
\section{Table}
\begin{tabular}{rll}\toprule
Anz. & Typ & Beschreibung \\
\midrule
12 & BK9050 & Buskoppler \\
2 & KL1104 & 4 Digitaleing{\"a}nge \\
2 & KL2404 & 4 Digitalausg{\"a}nge (0,5 A) \\
3 & KL2424 & 4 Digitalausg{\"a}nge (2 A) \\
2 & KL4004 & 4 Analogausg{\"a}nge \\
1 & KL4002 & 2 Analogausg{\"a}nge \\
22 & KL9188 & Potenzialverteilungsklemme \\
1 & KL9100 & Potenzialeinspeiseklemme \\
3 & KL3054 & 4 Analogeing{\"a}nge \\
5 & KL3214 & PT100 4 Temperatureing{\"a}nge (3-Leiter) \\
3 & KL3202 & PT100 2 Temperatureing{\"a}nge (3-Leiter) \\
1 & KL2404 & 4 Digitalausg{\"a}nge \\
2 & KL9010 & Endklemme \\
\bottomrule
\end{tabular}
\noindent\rule[0.5ex]{\linewidth}{1pt}
\section{Equations}
This line represents a reference to the equation \ref{eq:test1}.
\begin{equation}\label{eq:test1}y = a + b * \sum_{i=0}^{\infty} a_i x^i\end{equation}\begin{figure}
\centering
\begingroup%
\makeatletter%
\begin{pgfpicture}%
\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{6.400000in}{4.800000in}}%
\pgfusepath{use as bounding box, clip}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,1.000000,1.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{1.000000,1.000000,1.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{6.400000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{6.400000in}{4.800000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{4.800000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,1.000000,1.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.760000in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}%
\pgfpathlineto{\pgfqpoint{0.800000in}{4.224000in}}%
\pgfpathlineto{\pgfqpoint{0.800000in}{0.528000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.800000in}{0.528000in}}{\pgfqpoint{4.960000in}{3.696000in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{0.839216,0.152941,0.156863}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{1.025455in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{1.974737in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{1.974737in}{1.936000in}}%
\pgfpathlineto{\pgfqpoint{1.025455in}{1.936000in}}%
\pgfpathlineto{\pgfqpoint{1.025455in}{0.528000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.800000in}{0.528000in}}{\pgfqpoint{4.960000in}{3.696000in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{0.121569,0.466667,0.705882}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{2.212057in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{3.161340in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{3.161340in}{4.048000in}}%
\pgfpathlineto{\pgfqpoint{2.212057in}{4.048000in}}%
\pgfpathlineto{\pgfqpoint{2.212057in}{0.528000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.800000in}{0.528000in}}{\pgfqpoint{4.960000in}{3.696000in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{0.839216,0.152941,0.156863}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{3.398660in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{4.347943in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{4.347943in}{1.584000in}}%
\pgfpathlineto{\pgfqpoint{3.398660in}{1.584000in}}%
\pgfpathlineto{\pgfqpoint{3.398660in}{0.528000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfpathrectangle{\pgfqpoint{0.800000in}{0.528000in}}{\pgfqpoint{4.960000in}{3.696000in}}%
\pgfusepath{clip}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,0.498039,0.054902}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{4.585263in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.534545in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.534545in}{2.464000in}}%
\pgfpathlineto{\pgfqpoint{4.585263in}{2.464000in}}%
\pgfpathlineto{\pgfqpoint{4.585263in}{0.528000in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{1.500096in}{0.528000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=1.500096in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}apple}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{2.686699in}{0.528000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=2.686699in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}blueberry}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{3.873301in}{0.528000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=3.873301in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}cherry}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{0.000000in}{-0.048611in}}{\pgfqpoint{0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{0.000000in}{-0.048611in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{5.059904in}{0.528000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=5.059904in,y=0.430778in,,top]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}orange}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{0.528000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.614412in, y=0.475238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}0}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{1.232000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.526047in, y=1.179238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}20}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{1.936000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.526047in, y=1.883238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}40}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{2.640000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.526047in, y=2.587238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}60}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{3.344000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.526047in, y=3.291238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}80}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetroundjoin%
\definecolor{currentfill}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfsys@defobject{currentmarker}{\pgfqpoint{-0.048611in}{0.000000in}}{\pgfqpoint{-0.000000in}{0.000000in}}{%
\pgfpathmoveto{\pgfqpoint{-0.000000in}{0.000000in}}%
\pgfpathlineto{\pgfqpoint{-0.048611in}{0.000000in}}%
\pgfusepath{stroke,fill}%
}%
\begin{pgfscope}%
\pgfsys@transformshift{0.800000in}{4.048000in}%
\pgfsys@useobject{currentmarker}{}%
\end{pgfscope}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.437682in, y=3.995238in, left, base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}100}}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=0.382126in,y=2.376000in,,bottom,rotate=90.000000]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}fruit supply}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetrectcap%
\pgfsetmiterjoin%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{0.800000in}{4.224000in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetrectcap%
\pgfsetmiterjoin%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{5.760000in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetrectcap%
\pgfsetmiterjoin%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{0.800000in}{0.528000in}}%
\pgfpathlineto{\pgfqpoint{5.760000in}{0.528000in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetrectcap%
\pgfsetmiterjoin%
\pgfsetlinewidth{0.803000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{0.800000in}{4.224000in}}%
\pgfpathlineto{\pgfqpoint{5.760000in}{4.224000in}}%
\pgfusepath{stroke}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=3.280000in,y=4.307333in,,base]{\color{textcolor}{\sffamily\fontsize{12.000000}{14.400000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}Fruit supply by kind and color}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,1.000000,1.000000}%
\pgfsetfillcolor{currentfill}%
\pgfsetfillopacity{0.800000}%
\pgfsetlinewidth{1.003750pt}%
\definecolor{currentstroke}{rgb}{0.800000,0.800000,0.800000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.800000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{4.729510in}{3.297460in}}%
\pgfpathlineto{\pgfqpoint{5.662778in}{3.297460in}}%
\pgfpathquadraticcurveto{\pgfqpoint{5.690556in}{3.297460in}}{\pgfqpoint{5.690556in}{3.325238in}}%
\pgfpathlineto{\pgfqpoint{5.690556in}{4.126778in}}%
\pgfpathquadraticcurveto{\pgfqpoint{5.690556in}{4.154556in}}{\pgfqpoint{5.662778in}{4.154556in}}%
\pgfpathlineto{\pgfqpoint{4.729510in}{4.154556in}}%
\pgfpathquadraticcurveto{\pgfqpoint{4.701732in}{4.154556in}}{\pgfqpoint{4.701732in}{4.126778in}}%
\pgfpathlineto{\pgfqpoint{4.701732in}{3.325238in}}%
\pgfpathquadraticcurveto{\pgfqpoint{4.701732in}{3.297460in}}{\pgfqpoint{4.729510in}{3.297460in}}%
\pgfpathlineto{\pgfqpoint{4.729510in}{3.297460in}}%
\pgfpathclose%
\pgfusepath{stroke,fill}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=4.849091in,y=3.993477in,left,base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}Fruit color}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{0.839216,0.152941,0.156863}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{4.757287in}{3.789620in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.789620in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.886842in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.886842in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.789620in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=5.146176in,y=3.789620in,left,base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}red}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{0.121569,0.466667,0.705882}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{4.757287in}{3.585762in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.585762in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.682985in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.682985in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.585762in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=5.146176in,y=3.585762in,left,base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}blue}}%
\end{pgfscope}%
\begin{pgfscope}%
\pgfsetbuttcap%
\pgfsetmiterjoin%
\definecolor{currentfill}{rgb}{1.000000,0.498039,0.054902}%
\pgfsetfillcolor{currentfill}%
\pgfsetlinewidth{0.000000pt}%
\definecolor{currentstroke}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{currentstroke}%
\pgfsetstrokeopacity{0.000000}%
\pgfsetdash{}{0pt}%
\pgfpathmoveto{\pgfqpoint{4.757287in}{3.381905in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.381905in}}%
\pgfpathlineto{\pgfqpoint{5.035065in}{3.479127in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.479127in}}%
\pgfpathlineto{\pgfqpoint{4.757287in}{3.381905in}}%
\pgfpathclose%
\pgfusepath{fill}%
\end{pgfscope}%
\begin{pgfscope}%
\definecolor{textcolor}{rgb}{0.000000,0.000000,0.000000}%
\pgfsetstrokecolor{textcolor}%
\pgfsetfillcolor{textcolor}%
\pgftext[x=5.146176in,y=3.381905in,left,base]{\color{textcolor}{\sffamily\fontsize{10.000000}{12.000000}\selectfont\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}\catcode`\%=\active\def%{\%}orange}}%
\end{pgfscope}%
\end{pgfpicture}%
\makeatother%
\endgroup%
\caption{Bar chart with individual bar colors}
\end{figure}\begin{table}
\centering
\caption{This is a example table}
\label{table:example1}
\begin{tabular}{lSSSSSS}
\toprule
\text{Row1} & \text{Row2} & \text{Row3} & \text{Row4} & \text{Row5} & \text{Row6} & \text{Row7} \\
\midrule
Line1 & 120 & 12 g/km & 5 stars & 3.500000 & 1850 kg & 600 Nm \\
Line2 & 95 km/h & {\textgreater} 150 g/km & 4 stars & 7.800000 & 1500 kg & 250 Nm \\
Line3 & 110 & 110 g/km & 5 stars & 8.500000 & 1400 kg & 280 Nm \\
Line4 & 105 km/h & 1140 g/km & 4.5 stars & 6.900000 & 1600 kg & 320 Nm \\
Line5 & 130 & 13.05 g/km & 5 stars & 4.200000 & 1700 kg & 450 Nm \\
\bottomrule
\end{tabular}
\end{table}

Binary file not shown.

Binary file not shown.

View File

@ -23,7 +23,7 @@ def test_latex_embedding2():
<latex>j</latex> on the transport properties of component <latex>i</latex>. <latex>j</latex> on the transport properties of component <latex>i</latex>.
The interaction parameter <latex>\Phi_{ij}</latex> is given by the relation shown in @eq:ExampleFormula2. The interaction parameter <latex>\Phi_{ij}</latex> is given by the relation shown in @eq:ExampleFormula2.
<latex type="block" ref_type="eq" ref_id="ExampleFormula2" caption="(1)">\Phi_{ij} = \frac{1}{\sqrt{8}} \left(1 + \frac{M_i}{M_j} \right)^{-1/2} \left[ 1 + \left( \frac{\lambda_i}{\lambda_j} \right)^{1/2} \left( \frac{M_j}{M_i} \right)^{1/4} \right]^2</latex> <latex type="block" reference="eq:ExampleFormula2" caption="(1)">\Phi_{ij} = \frac{1}{\sqrt{8}} \left(1 + \frac{M_i}{M_j} \right)^{-1/2} \left[ 1 + \left( \frac{\lambda_i}{\lambda_j} \right)^{1/2} \left( \frac{M_j}{M_i} \right)^{1/4} \right]^2</latex>
""") """)
dummy = pyladoc.DocumentWriter() dummy = pyladoc.DocumentWriter()
@ -45,7 +45,7 @@ def test_latex_embedding():
expected_output = pyladoc._normalize_text_indent(r""" expected_output = pyladoc._normalize_text_indent(r"""
# Test # Test
<latex type="block" ref_type="eq" ref_id="ExampleFormula2" caption="(1)">\Phi_{ij} = \frac{1}{\sqrt{8}}</latex> <latex type="block" reference="eq:ExampleFormula2" caption="(1)">\Phi_{ij} = \frac{1}{\sqrt{8}}</latex>
This <latex>i</latex> is inline LaTeX. This <latex>i</latex> is inline LaTeX.
""") """)

View File

@ -98,7 +98,9 @@ def test_html_render():
def test_latex_render(): def test_latex_render():
doc = make_document() doc = make_document()
# print(doc.to_latex()) if WRITE_RESULT_FILES:
with open('tests/out/test_html_render2.tex', 'w', encoding='utf-8') as f:
f.write(doc.to_latex())
assert doc.to_pdf('tests/out/test_latex_render2.pdf', font_family='serif') assert doc.to_pdf('tests/out/test_latex_render2.pdf', font_family='serif')