org-ruby icon indicating copy to clipboard operation
org-ruby copied to clipboard

Add support to render latex math formula?

Open tninja opened this issue 9 years ago • 1 comments

Currently it doesn't support $$ $$, which is supported by org-mode html exporting with jsmath support.

tninja avatar Aug 15 '16 16:08 tninja

Having LaTeX support for blocks would be excellent because org babel produces them. Specifically, it would be nice if the following worked:

#+begin_src matlab :exports both :results output latex
  m = [4*pi, 3*pi; 2*pi, pi];
  result = latex(sym(m));
  disp(result)
#+end_src

#+RESULTS:
#+begin_export latex
\left(\begin{array}{cc} 4\,\pi  & 3\,\pi \\ 2\,\pi  & \pi  \end{array}\right)
#+end_export

You can use LaTeX directly, for example

#+begin_export latex
\begin{align}
y(t)       = & f_o(t,x_c,x_d,u,P) && - \text{ outputs } \\
\dot{x}_c(t) = & f_d(t,x_c,x_d,u,P) && - \text{ derivatives } \\
x_d(t+h)   = & f_u(t,x_c,x_d,u,P) && - \text{ update }
\end{align}
#+end_export

This is incorrectly rendered as the following (notice the LaTeX is missing):

m = [4*pi, 3*pi; 2*pi, pi];
result = latex(sym(m));
disp(result)
You can use LaTeX directly, for example

See https://github.com/mathworks/Emacs-MATLAB-Mode/blob/c4cf0f0dcef89bb8e261e5d8b512ce7b293edbba/examples/matlab-and-org-mode/matlab-and-org-mode.org from where the above was taken from.

Background: MATLAB is used by scientists, engineers, etc. who often create papers and org-mode is excellent at this because of its support for literate programming and reproducible research along with the other org features. It would be very nice if org files with MATLAB or other languages that generate latex blocks into the *.org file using org babel would render correctly in github. Improving org rendering of latex on github would likely result in more people using org mode from this community.

JohnC32 avatar May 29 '25 15:05 JohnC32