daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
https://daqana.github.io/tikzDevice
132 stars 26 forks source link

Accelerate measurement of dimensions #5

Open krlmlr opened 11 years ago

krlmlr commented 11 years ago

Currently, each string to be measured requires one run of latex. This is horribly inefficient.

The following scenario could help:

Module latexStrWidth.R.

krlmlr commented 11 years ago

Here's more detail:

This might even work on Windows. Reading from pdflatex' s stdout seems to require fifos.

krlmlr commented 11 years ago

Obviously, Charlie had the same idea: https://github.com/yihui/tikzDevice/commits/feature/texPipe. Can use this, I hope.

krlmlr commented 10 years ago

Perhaps more robust and easier to implement -- use a precompiled preamble first. Preamble depends only on document declaration and packages, these change rarely.

krlmlr commented 10 years ago

Do we really need measuring separately for each cex value? Isn't it just a scaling factor anyway?

krlmlr commented 10 years ago

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.