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

Support Tikz in Slidev #1751

Open
issaccv opened this issue Jul 11, 2024 · 0 comments
Open

Support Tikz in Slidev #1751

issaccv opened this issue Jul 11, 2024 · 0 comments
Labels
can be an addon This feature can be implemented as an addon, so may not become a builtin feature enhancement New feature or request

Comments

@issaccv
Copy link

issaccv commented Jul 11, 2024

Is your feature request related to a problem? Please describe.

I am a researcher. Thanks to slidev's complete community ecology, I can use markdown to quickly complete some simple reports and introduce rich animation effects. I can almost entirely use slidev instead of Latex for reporting. However, whenever I need to display complex drawings, especially tikz charts that are very common in latex, I have to put the screenshots into the public folder. This way the screenshots produce different resolutions on different screens. As a result, it is difficult to obtain the best display effect.

Describe the solution you'd like
Based on my investigation, I found a plugin from the hexo community: https://github.com/prinsss/hexo-filter-tikzjax

This plug-in enables markdown to support tikz syntax. Specifically, you can draw a tikz chart in the following way

```tikz
\begin{document}
\begin{tikzpicture}[domain=0:4,scale=1.1]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot (\x,\x) node[right] {$f(x) =x$};
\draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$};
\draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
\end{tikzpicture}
\end{document}
```

Describe alternatives you've considered
I'm not familiar with JavaScript, but it would be great if slidev could support tikzjax the same way it supports katex!

@issaccv issaccv added the enhancement New feature or request label Jul 11, 2024
@KermanX KermanX added the can be an addon This feature can be implemented as an addon, so may not become a builtin feature label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be an addon This feature can be implemented as an addon, so may not become a builtin feature enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants