Skip to content

rmd html tex tips #2

@yonicd

Description

@yonicd

sorry.. i was snooping in the main doc... i saw in this file you were using raw tex. I think {texPreview} can make your life easier with rmds that aren't pdf.

It's main job is to make tex table work much easier, where you can iterate the table while you work, just like you would a ggplot in the viewer. it supports kable/kableExtra/xtable and other classes like texreg and equatiomatic.

specific to your usecase it has it's own chunk engine where you can preview tex snippets with the play button of the chunk. The same chunk will let you treat tex just like any other chunk when you knit the document.

here is an example.

---
title: "Untitled"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(texPreview)
```

```{texpreview}
$$
\begin{array}{cclcc}
\text{index} & \text{kimb} & \text{name} & \text{similarity} & \text{proven by} \\
\hline
 1 & X_{1}^* & \text{Incenter} & \text{J}^t & \text{OR,RG} \\
 2 & X_{2}^* & \text{Centroid} & \text{B} & \text{ST+RS} \\
 3 & X_{3}^* & \text{Circumcenter} & \text{C}^t & \text{RG,CF} \\
 4 & X_{4}^* & \text{Orthocenter} & \text{B}^t & \text{RG}   \\
 5 & X_{5}^* & \text{9-Point Center} & & \text{RG} \\
 6 & X_{7}^* & \text{Gergonne Point} & \text{B} & \text{MH} \\
 7 & X_{8}^* & \text{Nagel Point} & & \text{RG} \\
 8 & X_{10}^* & \text{Spieker Center} & \text{B}^t & \text{MH} \\
 9 & X_{11}^* & \text{Feuerbach Point} & \text{C}^* & \text{RG} \\
 10 & X_{12}^* & \text{$\{X_{1},X_{5}\}$-Harmonic Conjugate of $X_{11}$} & & \text{RG} \\
 11 & X_{20} & \text{de Longschamps Point} & & \\
 12 & X_{21} & \text{Schiffler Point} & & \\
 13 & X_{35} & \text{$\{X_{1},X_{3}\}$-Harmonic Conjugate of $X_{36}$} & & \\
 14 & X_{36} & \text{Inverse-in-Circumcircle of Incenter} & & \\
 15 & X_{40}^* & \text{Bevan Point} & \text{B}^t & \text{MH} \\
 16 & X_{46} & \text{$X_{4}$-Ceva Conjugate of $X_{1}$} & & \\
 17 & X_{55} & \text{Insimilicenter(Circumcircle,Incircle)} & \\
 18 & X_{56} & \text{Exsimilicenter(Circumcircle,Incircle)} & &  \\
 19 & X_{57}^* & \text{Isogonal Conjugate of $X_{9}$} & & \text{MH} \\
 20 & X_{63}^* & \text{Isogonal Conjugate of $X_{19}$} & & \text{MH} \\
 21 & X_{65} & \text{Orthocenter of the Intouch Triangle} & & \\
 22 & X_{72} & \text{Isogonal Conjugate of $X_{28}$} & & \\
 23 & X_{78} & \text{Isogonal Conjugate of $X_{34}$} & & \\
 24 & X_{79} & \text{Isogonal Conjugate of $X_{35}$} & & \\
 25 & X_{80} & \text{Reflection of Incenter in Feuerbach Point} & & \\
 26 & X_{84} & \text{Isogonal Conjugate of $X_{40}$} & & \\
 27 & X_{88}^* & \text{Isogonal Conjugate of $X_{44}$} &  \text{B}^* & \\
 28 & X_{90} & \text{$X_{3}$-Cross Conjugate of $X_{1}$} & \\
 29 & X_{100}^* & \text{Anticomplement of Feuerbach Point} & \text{B}^* & \text{RG} \\
\end{array}
 $$
```

image


```{texpreview}
$$
\begin{array}{cll}
 1 & X_{2}^* & \text{Centroid} \\
 2 & X_{4}^* & \text{Orthocenter} \\
 3 & X_{7}^* & \text{Gergonne Point} \\
 4 & X_{10}^* & \text{Spieker Center} \\
 5 & X_{40}^* & \text{Bevan Point} \\
 6 & X_{57}^* & \text{Isogonal Conjugate of $X_{9}$} \\
 7 & X_{63}^* & \text{Isogonal Conjugate of $X_{19}$} \\
 8 & X_{88} & \text{Isogonal Conjugate of $X_{44}$} \\
 9 & X_{100}^* & \text{Anticomplement of Feuerbach Point} \\
\end{array}
$$
```

image

obviously this isnt contained to only raw scripts, it can be used for tikz too

https://metrumresearchgroup.github.io/texPreview/articles/tikz.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions