Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rmd html tex tips #2

Open
yonicd opened this issue Feb 28, 2020 · 2 comments
Open

rmd html tex tips #2

yonicd opened this issue Feb 28, 2020 · 2 comments

Comments

@yonicd
Copy link

yonicd commented Feb 28, 2020

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

@dan-reznik
Copy link
Owner

dan-reznik commented Feb 28, 2020 via email

@yonicd
Copy link
Author

yonicd commented Feb 28, 2020

i my daily case for report writing I need a bit more flexibility than mathjax with tables and such. in addition we usually port kable/kableExtra outputs to individual tex files in deliverable directory and the main body tex file an input call is the function side effect.

eg

This makes our report writing more modular and easier to QC.

I guess if you are going fully raw tex then you are good with mathjax engine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants