-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
76 lines (56 loc) · 2.05 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(equatags)
```
# equatags
<!-- badges: start -->
[![R build status](https://github.com/ardata-fr/equatags/workflows/R-CMD-check/badge.svg)](https://github.com/ardata-fr/equatags/actions)
<!-- badges: end -->
The goal of the package is to provide a tool to transform latex math expressions
into `HTML` format and `Office Open XML Math` format (which can be used in a
Word or PowerPoint document).
## Installation
You can install the development version from GitHub with:
``` r
# install.packages("remotes")
remotes::install_github("davidgohel/equatags")
```
## Example with flextable
```{r eval=FALSE}
library(flextable)
eqs <- c(
"(ax^2 + bx + c = 0)",
"a \\ne 0",
"x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}")
df <- data.frame(formula = eqs)
df
ft <- flextable(df)
ft <- compose(
x = ft, j = "formula",
value = as_paragraph(as_equation(formula)))
ft <- align(ft, align = "center", part = "all")
ft <- width(ft, width = 2, j = "formula")
ft
```
## Related work
- Packages [texPreview](https://CRAN.R-project.org/package=texPreview) written by
Jonathan Sidi, "compile snippets of 'LaTeX' directly into
images from the R console to view in the 'RStudio' viewer pane, Shiny apps
and 'RMarkdown' documents". With this package, you can get images from
your 'latex' code. The tool offers a wider functional spectrum than just
equation processing and focuses on 'latex' instead of only 'MathJax' equations.
- Package [mathjaxr](https://cran.r-project.org/package=mathjaxr) written by
Wolfgang Viechtbauer, "Using 'Mathjax' in Rd Files". This package let you
add equations in the manual pages of your package in a very convenient way.
- Package [katex](https://cran.r-project.org/package=katex) written by
Jeroen Ooms, "Rendering Math to HTML, 'MathML', or R-Documentation Format".
'equatags' mainly uses its functions.