Open krlmlr opened 11 years ago
Here's more detail:
p = pipe("pdflatex", "w")
cat("\\measureThis{...}", file=p)
This might even work on Windows. Reading from pdflatex' s stdout seems to require fifos.
Obviously, Charlie had the same idea: https://github.com/yihui/tikzDevice/commits/feature/texPipe. Can use this, I hope.
Perhaps more robust and easier to implement -- use a precompiled preamble first. Preamble depends only on document declaration and packages, these change rarely.
Do we really need measuring separately for each cex
value? Isn't it just a scaling factor anyway?
LaTeX package mylatexformat
could be a big help here. Also allow reusing an existing format, in case the user already has set up his format file.
Currently, each string to be measured requires one run of
latex
. This is horribly inefficient.The following scenario could help:
latex
and grab its stdin and stdoutModule
latexStrWidth.R
.