LatexOutput
LaTeX output widget for displaying mathematical notation.
Examples
Basic Usage
This example runs a form with a single page containing the widget
Example Code
from abstra.forms import LatexOutput, run
# Create a page with the widget
example_page = [
LatexOutput(r"\(ax^2 + bx + c = 0\)"),
]
# Run the form
result = run([example_page])
# Print the result
print(result)
With Text
LatexOutput can be used to display LaTeX math equations and text.
Example Code
from abstra.forms import LatexOutput, run
# Create a page with the widget
example_page = [
LatexOutput(
r"""When \(a \\ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$"""
),
]
# Run the form
result = run([example_page])
# Print the result
print(result)
Parameters
Name | Description | Type | Default |
---|---|---|---|
text (required) | The LaTeX content to display. | str | None |
full_width | Whether the content should take up the full width of its container. | bool | False |