mathgenerator
mathgenerator copied to clipboard
Default to latex output
Funcs should generate latex output by default, but can be converted to asciimath or other with kwarg. Conversion can be handled by the Generator class using a LaTeX to asciimath library. This must be done so that output doesn't have to be written for seperate outputs inside of each func. LaTeX should be able to easily convert to asciimath but not the other way around. May be more appropriate to call output "tex" instead of "latex" since we are only interested in styling, not building entire documents.
Checkpoints:
- Remove
format
kwarg from functions and only export to latex- Inline latex blocks should start and end with
$
- Problems with text will not be enclosed in delimiters, only numbers and math operators.
- Inline latex blocks should start and end with
- In
__call__
method of generator class, enable formatting output ofself.func
to asciimath if latex flag or format flag is present.- Maybe also be able to change latex delimiters to
\\(
and)\\
. Should just give a kwarg with custom delimiter string-
$$
and\\(
\)\\
are block delimiters, but I don't think we need these.
-
- Should it default to asciimath because that is what people are familiar with or try to push latex adoption?
- Maybe also be able to change latex delimiters to
I believe that MathJax and pandoc can do that conversion. Is it ok to use external libs or you want the parsers being part of your lib and everything in Python?