sagetex icon indicating copy to clipboard operation
sagetex copied to clipboard

Update example.tex

Open 927589452 opened this issue 6 years ago • 12 comments
trafficstars

use the internal \ST command to typeset SageTeX

927589452 avatar Sep 08 '19 15:09 927589452

as the example.tex seems to be the easiest reference for sagetex, extending it to showcase all commands seems useful

927589452 avatar Sep 08 '19 15:09 927589452

This is a nice idea. Since there is nice history of Dan documenting the code (and since it's likely people will read it to know how to do things), probably there should be a comment saying what that is for immediately before it. Also, what is your opinion on the later occurrence of Sage\TeX? I notice that one doesn't have the \textsf; I wonder if that was intentional because it was in a section not a title.

Finally, if you would like "official" recognition as a contributor we don't mind real names and do like acknowledging all contributors when possible. Thanks for pointing this change out!

kcrisman avatar Sep 09 '19 09:09 kcrisman

@kcrisman I just moved them all to ST and added a comment at the first use

927589452 avatar Sep 09 '19 10:09 927589452

You have a \textsf{\ST} which I'm not sure how that would look, but at any rate is redundant somehow.

Other than that, once of of us maintainers has a chance to build the file with ST and make sure it still looks good (which I assume is the case) I'm sure we can merge this.

kcrisman avatar Sep 09 '19 14:09 kcrisman

@kcrisman I prefer attribution to my handle (is the same on SE, trac, etc)

927589452 avatar Sep 17 '19 07:09 927589452

This needs some work in the installation department: the problem is that somehow on the 1st run of make one ends up with

 Undefined control sequence.
\@title ...f embedding Sage in \LaTeX {} with \ST 
                                                  
l.32 

which is due to the package not quite being ready at this point. If I re-run make, without cleaning, then things work.

dimpase avatar Nov 13 '19 00:11 dimpase

Is it more of a race condition or more of a structural problem, do you think?

kcrisman avatar Nov 13 '19 03:11 kcrisman

sorry, it's a just the style file problem. There is no \ST macro in sagetex.sty:

I get the same error as in https://github.com/sagemath/sagetex/pull/43#issuecomment-553183410 if I just run latex example.tex (after I ran make enough times so that it completes without an error).

dimpase avatar Nov 13 '19 10:11 dimpase

I see the issue now. All the .dtx files use this macro (where it's defined, I don't know), but example.tex is not this format. Maybe the Python preprocessor replaces it?

I could see several outcomes to this ticket - closing it as unneeded, making a new macro, perhaps others. I guess I'm leaning toward the former, since Dan probably would have done so if he had thought it helped. Dima, do you know offhand what the generated .tex files have for the \ST macro?

kcrisman avatar Nov 13 '19 12:11 kcrisman

I see the issue now. All the .dtx files use this macro (where it's defined, I don't know), but example.tex is not this format. Maybe the Python preprocessor replaces it?

I gather Python has nothing to do with it; indeed, one can run

latex sagetex.ins
latex sagetex.dtx

and get something ready to be run through Sage, no errors reported. No idea why this works with \ST.

dimpase avatar Nov 13 '19 13:11 dimpase

No idea why this works with \ST.

in fact, the macro is here: https://github.com/sagemath/sagetex/blob/6dbe41ac3c2e97f3b766914a727cded51854efd4/sagetex.dtx#L162

to make it go into the style file, one needs to tag it with <latex>.

%<latex> \newcommand{\ST}{\textsf{Sage\TeX}\xspace}

not sure we want such a short named macro to potentially clash with what people might use. I'd instead have something like

%<latex> \newcommand{\SageTeX}{\textsf{Sage\TeX}\xspace}

for the general public (and, naturally, example.tex)

dimpase avatar Nov 13 '19 17:11 dimpase

That seems reasonable, though certainly not a high priority.

kcrisman avatar Nov 13 '19 21:11 kcrisman