davidgohel / rvg

https://davidgohel.github.io/rvg/
132 stars 15 forks source link

plotmath expressions for pptx() #19

Open davidgohel opened 6 years ago

davidgohel commented 6 years ago

@Lukas-1 commented on Fri Mar 24 2017

I saw some issues when using plotmath expressions in powerpoint files. Specifically, if an expression() is composed of multiple elements joined using "*" or "~", separate textboxes are created in PowerPoint, which leads faulty vertical alignment. It would be better if the whole expression were contained in one textbox.

For example, the following code displays buggy vertical alignment of the text:

plot(1:10) title(expression("foo" "-" "oo"))

Also, using an en dash in plotmath expressions causes a bug where each element of the expression is individually centered and overlaps.

P.S. thank you for developing this great package!


@davidgohel commented on Tue Apr 04 2017

Hi

Sorry, it's a known issue but I don't know exactly what is wrong.

I'll have a coding session probably next month and will invest on this case.

David

emiliemillet commented 6 years ago

Hi,

I am facing the same issue when using superscript "^" or subscript "[]" in expression(). It also creates separate textboxes in PowerPoint.

Emilie

davidgohel commented 6 years ago

@emiliemillet

Thanks, I saw your previous comment. Thanks for reporting that issue.

davidgohel commented 6 years ago

@Lukas-1 @emiliemillet sorry for the delay... Having a whole expression in a single textbox is not possible as this is made by R internally. It's now far better but there are cases in ?plotmath that I don't know how to solve for now:

  1. Alignment, I don't know how but I think I will find (one day) a fix
  2. Ability to display all plotmath symbols, I don't believe this can be solved. Fonts are not always containing the necessary glyph required by plotmath.