Skip to content

Commit

Permalink
fix: make latex scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
xushengs committed Mar 15, 2024
1 parent 8c1de40 commit 82cd4a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,25 @@ This is inline latex: $f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x}$
This is block level latex:
$$
c = \\pm\\sqrt{a^2 + b^2}
c = \pm\sqrt{a^2 + b^2}
$$
This is inline latex with displayMode: $$f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x}$$
To calculate the area of an equilateral triangle using trigonometric functions, one can consider using the length of the side and the height. The relationship between the height and the side length of an equilateral triangle is:
The relationship between the height and the side length of an equilateral triangle is:
\[ \text{Height} = \frac{\sqrt{3}}{2} \times \text{Side Length} \]
\[ \text{X} = \frac{1}{2} \times \text{Y} \times \text{Z} = \frac{1}{2} \times 9 \times \frac{\sqrt{3}}{2} \times 9 = \frac{81\sqrt{3}}{4} \]
The Taylor series is a mathematical formula that represents a function, which is differentiable near a point, as an infinite series of the values of its derivatives at that point. In simple terms, the Taylor series can be used to approximate the values of various complex functions. The basic form of the Taylor series is:
The basic form of the Taylor series is:
\[f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3 + \cdots\]
where \(f(x)\) is the function to be expanded, \(a\) is the expansion point, \(f'(a)\), \(f''(a)\), \(f'''(a)\), etc., are the first, second, third, and so on derivatives of the function at point \(a\), and \(n!\) denotes the factorial of \(n\).
In particular, when \(a=0\), this expansion is called the Maclaurin series.
The Taylor series has wide applications in various fields such as mathematics, physics, engineering, etc., for solving differential equations, approximating function values, and applications in theoretical physics, among others.
""";

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/latex_element_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LatexElementBuilder extends MarkdownElementBuilder {
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
clipBehavior: Clip.antiAlias,
child: SelectableMath.tex(
child: Math.tex(
text,
textStyle: textStyle,
mathStyle: mathStyle,
Expand Down

0 comments on commit 82cd4a8

Please sign in to comment.