Hi,
I'm using the ggtext package in combination with a faceted plot. There seems to be a problem with spaces in the labels when saving the plots as tex/tikz image. I present a reprex to illustrate the problem and a workaround.
In the following reprex, I generate three different images:
1) faceted plot without use of ggtext
2) faceted plot using ggtext in the "normal" way (as I understand), produces only very small spaces between words, every word gets its own node in tex/tikz file
3) faceted plot using ggtext and replacing spaces by "latex spaces" (~), produces normal spaces between words
I'm using texi2pdf to compile the standalone tikz files and magick package to convert pdf to png. Nevertheless, the problem is already visible in the tex files, I present the corresponding lines as comments. The problem also arises when using pictex device instead of tikzDevice::tikz.
I also tried element_textbox() instead of element_markdown(), but got the same results.
Hi, I'm using the
ggtext
package in combination with a faceted plot. There seems to be a problem with spaces in the labels when saving the plots as tex/tikz image. I present a reprex to illustrate the problem and a workaround.In the following reprex, I generate three different images: 1) faceted plot without use of
ggtext
2) faceted plot usingggtext
in the "normal" way (as I understand), produces only very small spaces between words, every word gets its own node in tex/tikz file 3) faceted plot usingggtext
and replacing spaces by "latex spaces" (~
), produces normal spaces between wordsI'm using
texi2pdf
to compile the standalone tikz files andmagick
package to convert pdf to png. Nevertheless, the problem is already visible in the tex files, I present the corresponding lines as comments. The problem also arises when usingpictex
device instead oftikzDevice::tikz
.I also tried
element_textbox()
instead ofelement_markdown()
, but got the same results.Created on 2021-03-10 by the reprex package (v1.0.0)