Carnets icon indicating copy to clipboard operation
Carnets copied to clipboard

Advanced latex features

Open weiszr opened this issue 3 years ago • 5 comments

Hello, how difficult would it be to add more latex features such as the capability to change fonts to cmbright? Like this: params = {'text.usetex': True,} 'text.latex.preamble': [r'\usepackage{cmbright}', r'\usepackage{amsmath}']}

pylab.rcParams.update(params)

weiszr avatar May 31 '21 00:05 weiszr

I could be wrong, but I think text.usetex requires a LaTeX install. I have that (I use it in a-Shell), but it's a bit large. Including it in Carnets would make the app really huge. Then again, I realize it's a useful feature.

holzschu avatar May 31 '21 13:05 holzschu

Yes, it would be an extremely useful feature, especially for those of us in academia. Could it be implemented as an optional download?

weiszr avatar May 31 '21 14:05 weiszr

I just looked at it. In the current situation, there would have to be some binaries that must be included in the app (adding about 100 MB), plus things to be downloaded to activate LaTeX (+800 MB). If I was to restrict TeX to "only pdflatex", I could trim those numbers, especially the first one (there are a lot of formats included in the distribution which are not used often, such as jadetex, csplain, eplain...). And if I was to compile TeX to WebAssembly, I could trim it a bit further.

It's not as big as I thought, especially if I can make a tiny distribution with only pdflatex, bibtex and the required packages.

My plan for the next months is:

  • compile Python modules that have been on the Carnets TODO list for a long time (graphviz, geopandas, cartopy, pymc3).
  • cross-compile texlive 2021 for iOS for a-Shell (we're still on texlive 2019)

The next step after that could be to work on TeX for Carnets. That leaves time to think about essential features and user interface. Also: should it be for both apps, or just for "Carnets with Scipy"?

holzschu avatar May 31 '21 14:05 holzschu

This would be useful especially for scientific visualizations for academic submissions. I would vote for inclusion only in the larger app (with scipy) to keep the other one lean.

nipunbatra avatar Jun 22 '21 01:06 nipunbatra

Report: I've tried to put TeX in Carnets, so that "Download as PDF (via LaTeX)" would work. I'm afraid it currently fails (it causes a crash after the 2nd or 3rd run of pdflatex). I'll get back to it later, but for now it's a failure.

holzschu avatar May 25 '22 10:05 holzschu