Skip to content

/tex should support inline TeX #386

@Zabuzard

Description

@Zabuzard

Overview

The /tex command should support inline TeX, for example using the idiomatic $-notation:

/tex latex: Hello, look at this $\frac{x}{2}$, nice stuff!

Right now, the command interprets the whole content as TeX and renders it accordingly:
example

It should instead be rendered as:
desired

Implementation hint

This could be solved by identifying the $...$ areas. If not present, simply use the existing flow. But if present, wrap the part to the left and right of it inside \text{...} blocks.

So A$B$C would be turned into \text{A}B\text{C}.

Be careful though, that there could be multiple $-sections.

  • For example See $\frac{x}{2}$ and also $\frac{y}{2}$.
  • Also the edge cases that it either starts with a section $\frac{x}{2}$ nice
  • or ends with it See $\frac{x}{2}$.

The previous example Hello, look at this $\frac{x}{2}$, nice stuff! would then be turned into

\text{Hello, look at this }\frac{x}{2}\text{, nice stuff!}

and send like that to the TeX-engine.

Metadata

Metadata

Assignees

Labels

enhance commandModify or improve an existing command or group of commands of the botpriority: normalvalidThis issue/PR is validated and ready to be picked. This auto adds items to TJ project board.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions