org: fix rendering of R examples for recent ESS/Org

* doc/org/.dir-locals.el.in, doc/org/init.el.in: Newer ESS version
need to be taught to use default-directory instead of the project
directory.
* doc/org/ltlcross.org: Use "result file" to render the output.
This commit is contained in:
Alexandre Duret-Lutz 2023-03-03 00:14:18 +01:00
parent a146457ea1
commit dcd4759896
3 changed files with 8 additions and 4 deletions

View file

@ -27,6 +27,9 @@
(setenv "SPOT_DOTEXTRA" "node[fontsize=12] fontsize=12 stylesheet=\"spot.css\" edge[arrowhead=vee, arrowsize=.7, fontsize=12]")
(setq org-babel-temporary-directory "@abs_top_builddir@/doc/org/tmp")
(make-directory org-babel-temporary-directory t)
; has to be set globally, not buffer-local
(setq ess-ask-for-ess-directory nil)
(setq ess-startup-directory 'default-directory)
(org-babel-do-load-languages 'org-babel-load-languages
`((,(if (version< org-version "8.3") 'sh 'shell) . t)
(python . t)
@ -39,7 +42,6 @@
(org-babel-python-command . "@PYTHON@")
(org-babel-C++-compiler . "./g++wrap")
(shell-file-name . "@SHELL@")
(ess-ask-for-ess-directory . nil)
(org-export-html-postamble . nil)
(org-html-table-header-tags
"<th scope=\"%s\"%s><div><span>" . "</span></div></th>")

View file

@ -88,7 +88,9 @@
(setq org-babel-C++-compiler "./g++wrap")
(setq shell-file-name "@SHELL@")
(setq ess-ask-for-ess-directory nil)
; setting ess-startup-directory to 'default-directory is enough with
; newer ESS version (after Fev 2022) but does not work with older ones.
(setq ess-startup-directory "@abs_top_builddir@/doc/org")
(setq org-babel-default-header-args:plantuml
'((:results . "file")
(:exports . "results")

View file

@ -924,7 +924,7 @@ compare the number of states produced by the two configurations of
=ltl2tgba= for each formula, we just need to plot column
=dt2$state.small= against =dt2$state.deter=.
#+BEGIN_SRC R :results output graphics :width 5 :height 5 :file ltlcross-r.svg
#+BEGIN_SRC R :results output graphics file :width 5 :height 5 :file ltlcross-r.svg
library(ggplot2)
ggplot(dt2, aes(x=states.small, y=states.deter)) +
geom_abline(colour='white') + geom_point()
@ -937,7 +937,7 @@ ggplot(dt2, aes(x=states.small, y=states.deter)) +
We should probably print the formulas for the cases where the two
sizes differ.
#+BEGIN_SRC R :results output graphics :width 5 :height 5 :file ltlcross-r2.svg
#+BEGIN_SRC R :results output graphics file :width 5 :height 5 :file ltlcross-r2.svg
ggplot(dt2, aes(x=states.small, y=states.deter)) +
geom_abline(colour='white') + geom_point() +
geom_text(data=subset(dt2, states.small != states.deter),