Compare commits

..

7 Commits

Author SHA1 Message Date
d0840233c9
All checks were successful
build / build (push) Successful in 1m0s
2026-03-09 22:11:27 -06:00
86db8d0fe2 wip: fix: latex-environment belongs to paragraph
All checks were successful
build / build (push) Successful in 1m27s
2026-03-08 20:24:30 -06:00
2198b5f409 fix: ????
All checks were successful
build / build (push) Successful in 4s
2026-03-05 15:59:55 -07:00
bc5138086d fix: remove debug code again idiot
Some checks failed
build / build (push) Failing after 19s
2026-03-05 15:58:14 -07:00
6d1d94194b fix: display math scales with text
All checks were successful
build / build (push) Successful in 44s
2026-03-05 15:51:13 -07:00
fd9322740d fix: remove debug code
All checks were successful
build / build (push) Successful in 39s
2026-03-05 15:11:26 -07:00
e5b47898a5 Merge pull request 'fix: tikz svgs' (#10) from fix-tikz-svgs into main
All checks were successful
build / build (push) Successful in 5s
Reviewed-on: #10
2026-03-05 15:10:46 -07:00
5 changed files with 62 additions and 27 deletions

View File

@@ -2,13 +2,17 @@
const { parse } = require ("uniorg-parse/lib/parser.js");
const opts = {
trackPosition: true
}
async function main () {
const chunks = []
for await (const chunk of process.stdin) {
chunks.push (chunk)
}
const orgText = Buffer.concat (chunks).toString ("utf8")
process.stdout.write (JSON.stringify (parse (orgText)))
process.stdout.write (JSON.stringify (parse (orgText, opts)))
}
main ()

View File

@@ -48,6 +48,12 @@
\newcommand{\optic}[3]{\opticname{#1}^\prime\;#2\;#3}
\newcommand{\Optic}[5]{\opticname{#1}\;#2\;#3\;#4\;#5}
% Default uses arrow glyphs from the active font, which are kinda ugly in the
% case of Plex.
\tikzcdset{
arrow style=tikz
}
\begin{document}
\setlength\abovedisplayskip{0pt} % Remove padding before equation environments.
%% \color[rgb]{0.000,0.000,0.004}\special{dvisvgm:currentcolor on}\setcounter{equation}{0}%

View File

@@ -104,6 +104,7 @@ section {
p,
dl,
ol,
.latex-fragment,
ul {
font-size: 1.2rem;
line-height: 1.5rem;

View File

@@ -208,3 +208,36 @@
:children first-section-nodes})
rest)]
(assoc node :children new-children)))
(defn- neighbourly-mapcat [coll f]
(let [rest-coll (rest coll)]
(map f
coll
rest-coll
(concat (rest rest-coll) [nil]))))
(comment
(-> [1 2 3 4]
(neighbourly-mapcat prn) )
(def doc (read-string (slurp some-org-file)))
(let [r (atom [])
blah
(sp/transform
[postorder-walker
(sp/must :children)
(sp/collect-one sp/VAL)
sp/INDEXED-VALS
#_
#(of-type? (second %) "latex-environment")
#_
sp/ALL
#_
sp/INDEXED-VALS]
(fn [siblings x]
x)
doc)]
@r))
(defn gather-latex-paragraphs [node]
())

View File

@@ -34,16 +34,7 @@
;; it doesn't get e.g. TikZ arrows.
(str/replace #"stroke=['\"]#000['\"]" "stroke=\"currentColor\"")))
(def ^:dynamic *save-snippets?* false)
(defn render-snippets [snippet-promises]
(with-redefs [fs/delete-tree
(fn
([path]
(l/warnf "refusing to delete %s" path))
([path opts]
(lr/warnf "refusing to delete %s with opts %s"
path opts)))]
(fs/with-temp-dir [svg-dir {:prefix "doerg-svg-"}]
(let [rendered-snippets
(delay (->> snippet-promises
@@ -60,7 +51,7 @@
hiccup/raw (deliver p)))
(catch Exception e
(l/error e "Error in TeX thread")
(throw e))))))))
(throw e)))))))
(comment
(let [snippets (for [x ["\\(\\ifxetex blah \\fi\\)"