Opened 4 years ago
Last modified 5 months ago
#27543 needs_work enhancement
Definitions and commands in sagetex
Reported by:  Aram Dermenjian  Owned by:  

Priority:  major  Milestone:  sagewishlist 
Component:  packages: standard  Keywords:  sagetex 
Cc:  Merged in:  
Authors:  aram.dermenjian  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/aram.dermenjian/definitions_and_commands_in_sagetex (Commits, GitHub, GitLab)  Commit:  dedc3560b15dd2293e612b15331b62ae794b12c0 
Dependencies:  Stopgaps: 
Description (last modified by )
When using latex(Tableau([[1]]))
we normally get back:
{\def\lr#1{\multicolumn{1}{@{\hspace{.6ex}}c@{\hspace{.6ex}}} {\raisebox{.3ex}{$#1$}}} \raisebox{.6ex}{$\begin{array}[b]{*{1}c}\cline{11} \lr{1}\\\cline{11} \end{array}$} }
This is normally except when using sagetex. When sagetex runs, it encodes everything in
\newlabel{@sageinline0}{ .... code goes here ... }
This is normally ok except that in \newlabel
we can't have \def\lr#1
(in particular we need ##1
instead of #1
). This means when using the code \sage{Tableau([[1]])}
in latex causes problems and doesn't allow compilation.
This ticket proposes adding a new function called sagetex()
which is like latex()
in that objects can define a _sagetex_
method and when sagetex()
is called, the _sagetex_
method is called, and if not present, it runs latex()
instead.
After this implementation, we'd propose a change to sagetex (the latex package) in order to use the sagetex()
function instead of the latex()
function.
The reason we have decided this method is to try and allow more flexibility in the future. In particular, (as a use case other than adding proper definition embedding) if we ever want the code in latex()
versus sagetex()
to be vastly different, this would allow us to do that. Additionally, we chose not to do a grep replace of #x
to ##x
(for x increasing) is due to the fact that there is a use case in which the user might actually want to keep #1
and not have it escaped.
Change History (20)
comment:1 Changed 4 years ago by
Authors:  → aram.dermenjian 

Component:  PLEASE CHANGE → packages: standard 
Description:  modified (diff) 
Keywords:  sagetex added 
Type:  PLEASE CHANGE → enhancement 
comment:2 Changed 4 years ago by
Branch:  → u/aram.dermenjian/definitions_and_commands_in_sagetex 

comment:3 Changed 4 years ago by
Commit:  → 9c349e3624ebaa6e677c55c0ee6bf47388236ce4 

Description:  modified (diff) 
comment:4 Changed 3 years ago by
Commit:  9c349e3624ebaa6e677c55c0ee6bf47388236ce4 → 390dcf2fc427a12d8bc9b3146af08b7501622f32 

Branch pushed to git repo; I updated commit sha1. New commits:
390dcf2  Merge branch 'develop' into t/27543/definitions_and_commands_in_sagetex

comment:5 Changed 3 years ago by
Status:  new → needs_review 

comment:6 Changed 3 years ago by
Commit:  390dcf2fc427a12d8bc9b3146af08b7501622f32 → 49c4eb29cdb020010417785d63e24d3c0818e6f9 

comment:7 Changed 3 years ago by
Commit:  49c4eb29cdb020010417785d63e24d3c0818e6f9 → 2b9ca1b0bc1b9194c290894ddb1926198316ea8e 

Branch pushed to git repo; I updated commit sha1. New commits:
2b9ca1b  Minor documentation updates

comment:8 Changed 3 years ago by
Commit:  2b9ca1b0bc1b9194c290894ddb1926198316ea8e → 4ea49f83a0db04d1d3102804d1fd7dec4930bfc0 

Branch pushed to git repo; I updated commit sha1. New commits:
4ea49f8  Doc fixes

comment:9 Changed 3 years ago by
Milestone:  sage8.8 → sage8.9 

Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).
comment:10 Changed 3 years ago by
Commit:  4ea49f83a0db04d1d3102804d1fd7dec4930bfc0 → 1f9324ff592fc2f9e7fb938cd82f2a50eb7cf271 

comment:11 Changed 3 years ago by
Status:  needs_review → needs_work 

comment:12 Changed 3 years ago by
Commit:  1f9324ff592fc2f9e7fb938cd82f2a50eb7cf271 → dedc3560b15dd2293e612b15331b62ae794b12c0 

Branch pushed to git repo; I updated commit sha1. New commits:
dedc356  Without lazy import, can't build

comment:13 Changed 3 years ago by
Milestone:  sage8.9 → sage9.1 

Ticket retargeted after milestone closed
comment:14 Changed 2 years ago by
Milestone:  sage9.1 → sage9.2 

Moving tickets to milestone sage9.2 based on a review of last modification date, branch status, and severity.
comment:15 Changed 2 years ago by
Milestone:  sage9.2 → sage9.3 

comment:16 Changed 20 months ago by
Milestone:  sage9.3 → sage9.4 

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
comment:17 Changed 14 months ago by
Milestone:  sage9.4 → sage9.5 

Setting a new milestone for this ticket based on a cursory review.
comment:18 Changed 9 months ago by
Milestone:  sage9.5 → sage9.6 

comment:19 Changed 5 months ago by
Milestone:  sage9.6 → sage9.7 

comment:20 Changed 5 months ago by
Milestone:  sage9.7 → sagewishlist 

New commits:
Add sagetex support
Merge branch 'sagetex' into t/27543/definitions_and_commands_in_sagetex