@@ -554,4 +554,11 @@ figure.fullwidth figcaption {
|
||||
; align-items: center
|
||||
; justify-content: center
|
||||
; display: flex
|
||||
; max-width: 55%
|
||||
; width: 55%
|
||||
}
|
||||
|
||||
p > .latex-fragment.display-math
|
||||
{ max-width: 100%
|
||||
; width: 100%
|
||||
}
|
||||
|
||||
@@ -243,7 +243,8 @@
|
||||
"Is `e` a paragraph, and does it end with a newline?"
|
||||
[e]
|
||||
(and (of-type? e "paragraph")
|
||||
(some-> e :children last :value (str/ends-with? "\n"))))
|
||||
(some-> (-> e :position :end :column)
|
||||
(= 1))))
|
||||
|
||||
(defn consequtive-elements?
|
||||
"Returh truthy if each successive pair of elements is NOT separated
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
[net.deertopia.doerg.html :as doerg-html]
|
||||
[hiccup2.core :as hiccup]
|
||||
[clojure.pprint]
|
||||
;; #_
|
||||
[net.deertopia.doerg.tex :as tex]
|
||||
;; [net.deertopia.doerg.tex.native :as tex-native]
|
||||
[net.deertopia.doerg.tex.temml :as tex-temml]
|
||||
[clojure.zip :as z]
|
||||
[babashka.fs :as fs]))
|
||||
|
||||
@@ -63,15 +63,25 @@
|
||||
sp/LAST]
|
||||
doc)
|
||||
sut/type)]
|
||||
(t/is type "latex-environment")))
|
||||
(t/is (= "latex-environment" type))))
|
||||
|
||||
(t/deftest paragraph-surrounding-latex
|
||||
(let [doc (parse-resource "paragraph-surrounding-latex.org")]
|
||||
(t/is (sp/select-first [(walk-types "paragraph")
|
||||
(sp/must :children)
|
||||
sp/ALL
|
||||
#(sut/of-type? % "latex-environment")]
|
||||
doc))))
|
||||
(let [doc (parse-resource "paragraph-surrounding-latex.org")
|
||||
children (->> doc
|
||||
(sp/select-first [(walk-types "paragraph")])
|
||||
:children
|
||||
(map sut/type))]
|
||||
(t/is (= ["text" "latex-environment" "text"]
|
||||
children))))
|
||||
|
||||
(t/deftest paragraph-ending-in-bold-surrounding-latex
|
||||
(let [doc (parse-resource "paragraph-ending-in-bold-surrounding-latex.org")
|
||||
children (->> doc
|
||||
(sp/select-first [(walk-types "paragraph")])
|
||||
:children
|
||||
(map sut/type))]
|
||||
(t/is (= ["text" "bold" "latex-environment" "text"]
|
||||
children))))
|
||||
|
||||
(t/deftest paragraph-with-multiple-latex
|
||||
(let [doc (parse-resource "paragraph-with-multiple-latex.org")
|
||||
@@ -82,9 +92,8 @@
|
||||
"text" "latex-environment"]]
|
||||
[p₂ ["text" "latex-environment"
|
||||
"text" "latex-environment" "text"]]]]
|
||||
(t/is (= (sp/select [(sp/must :children)
|
||||
sp/ALL (sp/view sut/type)] p)
|
||||
ts))))))
|
||||
(t/is (= ts (sp/select [(sp/must :children)
|
||||
sp/ALL (sp/view sut/type)] p)))))))
|
||||
|
||||
(t/deftest paragraph-with-separate-latex
|
||||
(let [doc (parse-resource "paragraph-with-separate-latex.org")
|
||||
@@ -104,20 +113,3 @@
|
||||
doc)]
|
||||
(t/is (= ["paragraph" "latex-environment" "paragraph"] cs))))
|
||||
|
||||
#_
|
||||
(t/deftest paragraph-separation
|
||||
(t/testing "paragraph ending with latex"
|
||||
(-> (parse-resource "paragraph-ending-with-latex.org")
|
||||
paragraph-ends-with-latex?))
|
||||
(t/testing "paragraph surrounding latex"
|
||||
(-> (parse-resource "paragraph-surrounding-latex.org")
|
||||
paragraph-has-latex?))
|
||||
(t/testing "paragraph with interleaved latex"
|
||||
(-> (parse-resource "paragraph-with-multiple-latex.org")
|
||||
paragraph-has-multiple-latex?))
|
||||
(t/testing "paragraph with separate latex"
|
||||
(-> (parse-resource "paragraph-with-separate-latex.org")
|
||||
paragraph-has-separate-latex?))
|
||||
#_(t/testing "paragraphs surrounding separate latex"
|
||||
(-> (parse-resource "paragraph-surrounding-separate-latex.org")
|
||||
paragraph-surrounding-separate-latex?)))
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#+title: bold-final 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