Skip to content

Eqn parser #59

Description

@philchalmers

I've placed a barebones parser in dev/eqn_parser.R which implements some of the ideas I was thinking w.r.t. reducing the amount of LaTeX code for the novice user, but still allow power users freedom. The idea is to try and reduce equations such as

Eqn("\\mathcal{H}_0 : \\mathcal{C} \\mathcal{B} & = ")
Eqn("\\mathbf{H}_0 : \\mathbf{C} \\mathbf{B} & = ")

to something analogous to markdown but for LaTeX equations, such as

Eqn("*H*_0 : *C B* & = ")
Eqn("**H**_0 : **C B** & = ")

Of course, the main limitation is that LaTeX has many more environments to choose from, so I've left it possible for users to define what * and ** should mean in this context, among others. This parser also allows for macro definitions, where for example '*' will give \\times and %n will give the same string that's currently provided by Eqn_newline(). Other macros starting with % are easy to add at this point.

There are number of other avenues to go, such as detecting Greek letter inputs to, say, replace beta -> \\beta to reduce the \\ requirements, but I worry about going too deep here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions