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

Add texsurgery as a pip package, advertise as an alternative to sagetex #33778

Open
mkoeppe opened this issue Apr 30, 2022 · 14 comments
Open

Add texsurgery as a pip package, advertise as an alternative to sagetex #33778

mkoeppe opened this issue Apr 30, 2022 · 14 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Apr 30, 2022

https://pypi.org/project/texsurgery/

Update various places in the doc found by git grep sagetex src/doc

CC: @dimpase @miguelmarco @sagetrac-pang

Component: packages: standard

Author: Matthias Koeppe, ...

Branch/Commit: u/mkoeppe/add_texsurgery_as_a_pip_package__advertise_as_an_alternative_to_sagetex @ e005a7c

Issue created by migration from https://trac.sagemath.org/ticket/33778

@mkoeppe mkoeppe added this to the sage-9.6 milestone Apr 30, 2022
@dimpase
Copy link
Member

dimpase commented May 1, 2022

comment:1

looks promising.

@dimpase dimpase modified the milestones: sage-9.6, sage-9.7 May 1, 2022
@jhpalmieri
Copy link
Member

comment:2

I'm not sure what the goal of this ticket is. (1) Stop distributing sagetex with Sage? (2) Advertise texsurgery in our documentation instead of sagetex? (3) Is there any reason to distribute texsurgery with Sage?

Parts of texsurgery seem a little clunkier: the command-line version works like

texsurgery input_file.tex -o output_file.tex

and it's a little annoying to have to create a second TeX file. Can it all be automated using latexmk, the way sagetex can?

Maybe this ticket should do (2), or at least advertise texsurgery in addition to sagetex. Maybe also (3), if (3) is a good idea. Then a later ticket could remove sagetex as a standard package.

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Replace sagetex by texsurgery Add texsurgery as a pip package, advertise as an alternative to sagetex May 1, 2022
@miguelmarco
Copy link
Contributor

comment:4

Since it is pip installable, do we really need to add it?

sage -pip install texsurgery should just work, right?

Parts of texsurgery seem a little clunkier

Suggestions for improvement are more than welcome.

@jhpalmieri
Copy link
Member

comment:5

Replying to @miguelmarco:

Since it is pip installable, do we really need to add it?

sage -pip install texsurgery should just work, right?

Parts of texsurgery seem a little clunkier

Suggestions for improvement are more than welcome.

latexmk automation would be great: a version of https://mirrors.rit.edu/CTAN/support/latexmk/example_rcfiles/pythontex-latexmkrc (see also https://ctan.org/tex-archive/support/latexmk/example_rcfiles). Being able to use a single command latexmk FILE is very handy, and it's not clear to me how to do this with texsurgery.

@dimpase
Copy link
Member

dimpase commented May 2, 2022

comment:6

latexmk may be adjusted to run whatever shell script it has to run, in case one cannot just put in .latexmk things like pipes, i.e.
pdflatex = 'texsurgery input_file.tex | ...

@miguelmarco
Copy link
Contributor

comment:7

One problem is that pdflatex is not pipe friendly. It expects an actual file as input.

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

comment:9

Replying to @miguelmarco:

Since it is pip installable, do we really need to add it?

After adding it (see branch), it will be more discoverable because it will be listed in https://doc.sagemath.org/html/en/reference/spkg/index.html#optional-packages


New commits:

e005a7cbuild/pkgs/texsurgery: New pip package

@mkoeppe
Copy link
Member Author

mkoeppe commented May 2, 2022

Commit: e005a7c

@mkoeppe
Copy link
Member Author

mkoeppe commented May 3, 2022

Author: Matthias Koeppe, ...

@dimpase
Copy link
Member

dimpase commented May 3, 2022

comment:11

Replying to @miguelmarco:

One problem is that pdflatex is not pipe friendly. It expects an actual file as input.

But there is a -jobname= option, which for all purposes is basically what you need. E.g.

$ cat t.tex 
\documentclass{article}
\begin{document}
Blah, $x^2$.
\end{document}
$
$ cat t.tex | pdflatex -jobname=t
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
**entering extended mode
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06>
*(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
No file t.aux.

*
*[1{/usr/share/texlive/texmf-dist/fonts/map/pdftex/updmap/pdftex.map}] (./t.aux)
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/
share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/t
exlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
Output written on t.pdf (1 page, 25571 bytes).
Transcript written on t.log.

(if one sets jobname=foo then one gets foo.pdf as output)

@kcrisman
Copy link
Member

kcrisman commented May 9, 2022

comment:12

Maybe this ticket should do (2), or at least advertise texsurgery in addition to sagetex. Maybe also (3), if (3) is a good idea. Then a later ticket could remove sagetex as a standard package.

Advertising in addition seems fine. Certainly something that supports multiple kernels in a single document (including R, Julia?) would be pretty cool. As optional package, seems reasonable.

Possible issues with anything beyond that, collated here for convenience, not because this ticket is necessarily about deprecating sagetex:

  • There seem to be a fairly large number of people who use sagetex (based on help requests as well as its direct support in !TeXShop), so there would probably need to be some kind of migration tool if we were to dump it for some reason.
  • It's also not clear whether it supports easy graphics generation; there is an allusion to graphics, but the documentation seems to still be pretty rudimentary (after all, still not at release 1.0). If we recommend it above sagetex sometime, it would be reasonable to ask for essentially the same ease of use.
  • Does !TeXShop support this? I can't find anything in a quick search.

Cc:ing Pablo since it is quite convenient that he is both a Sage developer and the lead of this project :)

@dimpase
Copy link
Member

dimpase commented May 10, 2022

comment:13

Ideally, one would write LaTeX macros (or a sagetex document class) which would take input with our SageTeX macros and use texsurgery behind the curtains.

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

No branches or pull requests

5 participants