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

Supply and override render rules #12

Open
light-matters opened this issue Feb 25, 2022 · 1 comment
Open

Supply and override render rules #12

light-matters opened this issue Feb 25, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@light-matters
Copy link

light-matters commented Feb 25, 2022

This is a feature request more than a bug.

Exists:
Currently, rendering to LaTeX etc. is controlled centrally from the 'render' namespace. There are special handlers for particular functions and symbols but everything is hard coded internally.

Problem:
The representation is then closely coupled to the underlying clojure symbols in the majority of cases. There is also no easy way for a user to specify their own symbol definitions either for newly defined symbols or for overriding the existing choices.

Feature:
At the moment, I can think of two ways of helping this. First of all, it may be useful for developer's to define the default symbols for their new functions and types using some form of metadata convention. This would allow for compartmentalized local design decisions. Secondly, and I think more importantly, the user could supply a symbol map to the appropriate representation function.
e.g.

(->TeX (= 'force (* 'mass 'acceleration))
{:environment-options {:label \"label!\"}
 :symbols {:force 'F
                 :mass 'm
                 :acceleration 'a}})

This would give a lot of flexibility and help separate the mathematical and representational content. The user could also provide their own functions for additional special-handlers.

Just some first thoughts :).

@light-matters light-matters changed the title Override render rules Supply and override render rules Feb 25, 2022
@sritchie sritchie added the enhancement New feature or request label Mar 3, 2022
@sritchie sritchie transferred this issue from sicmutils/sicmutils Jan 24, 2023
@sritchie sritchie transferred this issue from another repository Jan 24, 2023
@littleredcomputer
Copy link
Contributor

Another thought that recently came up would be to allow tagging a literal-function with rendering advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants