This commit is contained in:
@@ -49,3 +49,26 @@
|
||||
first-paragraph-belongs-to-first-section?))
|
||||
(t/is (not (-> (parse-resource "first-paragraph-under-heading.org")
|
||||
first-paragraph-belongs-to-first-section?)))))
|
||||
|
||||
(defn- first-paragraph-ends-with-latex? [doc]
|
||||
(-> (sp/select-first [sut/postorder-walker
|
||||
#(sut/of-type? % "paragraph")
|
||||
(sp/must :children)
|
||||
sp/LAST]
|
||||
doc)
|
||||
(sut/of-type? "latex-environment")))
|
||||
|
||||
(defn- first-paragraph-has-latex? [doc]
|
||||
(sp/select-first [sut/postorder-walker
|
||||
#(sut/of-type? % "paragraph")
|
||||
(sp/must :children)
|
||||
#(sut/of-type? % "latex-environment")]
|
||||
doc))
|
||||
|
||||
(t/deftest paragraph-separation
|
||||
(t/testing "paragraph ending with latex"
|
||||
(t/is (->> (parse-resource "paragraph-ending-with-latex.org")
|
||||
first-paragraph-ends-with-latex?)))
|
||||
(t/testing "paragraph surrounding latex"
|
||||
(t/is (->> (parse-resource "paragraph-surrounding-latex.org")
|
||||
first-paragraph-has-latex?))))
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#+title: paragraph ending with latex
|
||||
|
||||
here is the paragraph,
|
||||
\begin{align*}
|
||||
\text{and here} &
|
||||
\\ & \text{is the \LaTeX}
|
||||
\end{align*}
|
||||
@@ -0,0 +1,7 @@
|
||||
#+title: paragraph surrounding latex
|
||||
|
||||
first part of paragraph
|
||||
\begin{equation*}
|
||||
\text{some \LaTeX \}:)}
|
||||
\end{equation*}
|
||||
last part of paragraph
|
||||
Reference in New Issue
Block a user