@@ -53,6 +53,9 @@
|
||||
(defn walk-types [type & types]
|
||||
[sut/postorder-walker #(apply sut/of-type? % type types)])
|
||||
|
||||
(defn headline-matches? [re]
|
||||
())
|
||||
|
||||
(defn- paragraph-ends-with-latex? [doc]
|
||||
(-> (sp/select-first [(walk-types "paragraph")
|
||||
(sp/must :children)
|
||||
@@ -68,13 +71,22 @@
|
||||
doc))
|
||||
|
||||
(defn- paragraph-has-multiple-latex? [doc]
|
||||
(sp/select-first [(walk-types "paragraph") (sp/must :children)]
|
||||
doc))
|
||||
(let [[interleaved fenceposted]
|
||||
(sp/select [(walk-types "section")
|
||||
(sp/must :children)
|
||||
#(some-> % first (sut/of-type? "headline"))
|
||||
(sp/subselect (sp/view #(drop 1 %))
|
||||
sp/ALL (sp/must :children) sp/ALL
|
||||
(sp/must :type))]
|
||||
doc)]))
|
||||
|
||||
(t/deftest paragraph-separation
|
||||
(t/testing "paragraph ending with latex"
|
||||
(t/is (->> (parse-resource "paragraph-ending-with-latex.org")
|
||||
paragraph-ends-with-latex?)))
|
||||
(-> (parse-resource "paragraph-ending-with-latex.org")
|
||||
paragraph-ends-with-latex?))
|
||||
(t/testing "paragraph surrounding latex"
|
||||
(t/is (->> (parse-resource "paragraph-surrounding-latex.org")
|
||||
paragraph-has-latex?))))
|
||||
(-> (parse-resource "paragraph-surrounding-latex.org")
|
||||
paragraph-has-latex?))
|
||||
(t/testing "paragraph with interleaved latex"
|
||||
(let [(parse-resource "paragraph-with-multiple-latex.org")])
|
||||
(t/is (-))))
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#+title: paragraph with multiple latex environments
|
||||
|
||||
* interleaved
|
||||
|
||||
first part of paragraph
|
||||
\begin{equation*}
|
||||
\text{first \LaTeX\ environment}
|
||||
@@ -8,3 +10,15 @@ second part of paragraph
|
||||
\begin{equation*}
|
||||
\text{second \LaTeX\ environment}
|
||||
\end{equation*}
|
||||
|
||||
* fenceposted
|
||||
|
||||
first fencepost
|
||||
\begin{equation*}
|
||||
\text{first fenceposted \LaTeX\ environment}
|
||||
\end{equation*}
|
||||
second fencepost
|
||||
\begin{equation*}
|
||||
\text{second fenceposted \LaTeX\ environment}
|
||||
\end{equation*}
|
||||
third fencepost
|
||||
|
||||
Reference in New Issue
Block a user