latex_query: Generate a CodeCogs URL that renders LaTeX as image

Description Usage Arguments Value Examples

View source: R/miscellaneous.R

Description

Interactive version at https://www.codecogs.com/latex/eqneditor.php

Usage

1
2
3
4
5
6
7
latex_query(
  formula,
  size = "normal",
  dpi = 300,
  transparent = FALSE,
  inline = FALSE
)

Arguments

formula

An appropriately escaped string of LaTeX code. Using the new string literal syntax r"(...)" from R 4.0.0 on the existing formula is recommended.

size

Font size. One of "tiny", "small", "normal", "large", or "huge"

dpi

Image resolution. Defaults to 300

transparent

Should the background be transparent? Defaults to FALSE, which adds a white background.

inline

Render as inline formula? If TRUE, results in a more compact image.

Value

A character string of the URL

Examples

1
2
3
4
5
6
## Not run: 
latex_query(r"(\beta + \alpha)")
latex_query("\\beta + \\alpha")
magick::image_read(latex_query(r"(\beta + \alpha)"))

## End(Not run)

yjunechoe/junebug documentation built on July 9, 2021, 7:12 p.m.