Hello:

I would like to drive your attention to the new project texsurgery:

<goog_1155008532>
https://framagit.org/pang/texsurgery

It allows to replace some latex environments like

\begin{run}
some code
\end{run}

or \eval{code}

by the results of running that code in some jupyter kernel. 

Much like sagetex <https://github.com/sagemath/sagetex> so far,  but with 
the following initial differences:

   1. sagetex collects all the code using LaTeX and only then runs sage to 
   get the LaTeX output, which definitely works, but this conflicts with some 
   interesting LaTeX packages and is slower than a direct conversion.
   2. TexSurgery works in any language with a jupyter kernel

However, texsurgery also allows for some extra constructions like

\sif{code}{texif}{texelse}

and features some css-style selectors that can be used for surgery, like 
this:

TexSurgery(tex).findall('questionmultx \AMCnumericChoices[_nargs=2]')

which will find all LaTeX commands \AMCnumericChoices with at least two 
arguments that are nested within a questionmultx environment, or

TexSurgery(tex).insertAfter(r'choices,itemize \wrongchoice', 
'\wrongchoice{$\sage{fd/a}$}')

which will insert the tex code '\wrongchoice{$\sage{fd/a}$}' after the 
first command \wrongchoice which is nested within either a choices or an 
itemize environment.

The final goal is to make exams, or attendance certificates, or any kind of 
repetitive LaTeX job reading data from a csv file and/or with random 
variations. That possibility is still rather undeveloped, but you can get 
the idea here:

https://framagit.org/pang/pyexams

Anyway, texsurgery is still fresh, and we would love to hear some feedback.

Regards

Related thread: 
https://groups.google.com/g/sage-edu/c/fCEsBFMTEWA/m/zrECOKH7BAAJ?pli=1

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/4bf51eed-5453-4177-b726-c95c69189ab9n%40googlegroups.com.

Reply via email to