Skip to content

Commit

Permalink
Add initial math mode re-wrapping tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cdesaintguilhem committed Dec 12, 2024
1 parent f2df0b4 commit 5b9ddd8
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ fn test_short() {
//"quiver.sty",
//"readme.tex",
"rewrap.tex",
"rewrap-math.tex",
//"sections.tex",
// "short_document.tex",
//"tikz_network.sty",
Expand Down
51 changes: 51 additions & 0 deletions tests/source/rewrap-math.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
\documentclass{article}

\begin{document}

Multi-line math mode should indent but not re-wrap
\(
1 + 2 + (
3 + 4
+ 5 + 7 )
+ 8 + 9
\)

\[
1 + 2 + (
3 + 4
+ 5 + 7 )
+ 8 + 9
\]

Many environments should also indent but not re-wrap
\begin{equation}
x + y
= \sum z_i
\end{equation}

\begin{equation*}
x + y
= \sum z_i
\end{equation*}

\begin{align}
x & y \\
z & \cdot
\end{align}

\begin{align*}
x & y \\
z & \cdot
\end{align*}

\begin{tabular}{cc}
x & y \\
z & \cdot
\end{tabular}

\begin{tabular*}{cc}
x & y \\
z & \cdot
\end{tabular*}

\end{document}
51 changes: 51 additions & 0 deletions tests/target/rewrap-math.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
\documentclass{article}

\begin{document}

Multi-line math mode should indent but not re-wrap
\(
1 + 2 + (
3 + 4
+ 5 + 7 )
+ 8 + 9
\)

\[
1 + 2 + (
3 + 4
+ 5 + 7 )
+ 8 + 9
\]

Many environments should also indent but not re-wrap
\begin{equation}
x + y
= \sum z_i
\end{equation}

\begin{equation*}
x + y
= \sum z_i
\end{equation*}

\begin{align}
x & y \\
z & \cdot
\end{align}

\begin{align*}
x & y \\
z & \cdot
\end{align*}

\begin{tabular}{cc}
x & y \\
z & \cdot
\end{tabular}

\begin{tabular*}{cc}
x & y \\
z & \cdot
\end{tabular*}

\end{document}

0 comments on commit 5b9ddd8

Please sign in to comment.