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