From 5b9ddd89cad52048c690791db754f8c235c54851 Mon Sep 17 00:00:00 2001 From: Cyprien de Saint Guilhem Date: Thu, 12 Dec 2024 17:01:37 +0100 Subject: [PATCH] Add initial math mode re-wrapping tests --- src/tests.rs | 1 + tests/source/rewrap-math.tex | 51 ++++++++++++++++++++++++++++++++++++ tests/target/rewrap-math.tex | 51 ++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 tests/source/rewrap-math.tex create mode 100644 tests/target/rewrap-math.tex diff --git a/src/tests.rs b/src/tests.rs index 04d05e1..d7825b3 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -117,6 +117,7 @@ fn test_short() { //"quiver.sty", //"readme.tex", "rewrap.tex", + "rewrap-math.tex", //"sections.tex", // "short_document.tex", //"tikz_network.sty", diff --git a/tests/source/rewrap-math.tex b/tests/source/rewrap-math.tex new file mode 100644 index 0000000..29f02d5 --- /dev/null +++ b/tests/source/rewrap-math.tex @@ -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} \ No newline at end of file diff --git a/tests/target/rewrap-math.tex b/tests/target/rewrap-math.tex new file mode 100644 index 0000000..a6dc006 --- /dev/null +++ b/tests/target/rewrap-math.tex @@ -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}