Skip to content

/tex should support inline TeX #386

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

Closed
Zabuzard opened this issue Feb 17, 2022 · 3 comments · Fixed by #441
Closed

/tex should support inline TeX #386

Zabuzard opened this issue Feb 17, 2022 · 3 comments · Fixed by #441
Assignees
Labels
enhance command Modify or improve an existing command or group of commands of the bot priority: normal valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.

Comments

@Zabuzard
Copy link
Member

Zabuzard commented Feb 17, 2022

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.

@Zabuzard Zabuzard added enhance command Modify or improve an existing command or group of commands of the bot priority: normal labels Feb 17, 2022
@Zabuzard Zabuzard added this to the Improvement phase 1 milestone Feb 17, 2022
@DevSerendipity
Copy link
Contributor

Can I be assigned to this I want to give it a try?

DevSerendipity added a commit to DevSerendipity/TJ-Bot that referenced this issue Feb 23, 2022
@Zabuzard Zabuzard linked a pull request Feb 25, 2022 that will close this issue
DevSerendipity added a commit to DevSerendipity/TJ-Bot that referenced this issue Feb 28, 2022
Adding the changes which were requested from the review

Added constants, and helper method 
Improving the naming, splitting up regular expressions, removing methods


Adding comment for Math regex


Added Comments, annotations, and if statement 

Added comments describing the method and the regex expressions,
annotations for the method parameter and if statement for not doing unnecessary operations 
SonarLint and improving the comments


adding space at bottom (spotless) 


Improving the Java doc


Fixed the regex bug and spacing

Regex bug which was, that it would register the first dollar sign and the last one in whole sentence, and it would place everything between as a match,
improved spacing 
Improving Regex and adding fail if statement
DevSerendipity added a commit to DevSerendipity/TJ-Bot that referenced this issue Feb 28, 2022
Adding the changes which were requested from the review

Added constants, and helper method 
Improving the naming, splitting up regular expressions, removing methods


Adding comment for Math regex


Added Comments, annotations, and if statement 

Added comments describing the method and the regex expressions,
annotations for the method parameter and if statement for not doing unnecessary operations 
SonarLint and improving the comments


adding space at bottom (spotless) 


Improving the Java doc


Fixed the regex bug and spacing

Regex bug which was, that it would register the first dollar sign and the last one in whole sentence, and it would place everything between as a match,
improved spacing 
Improving Regex and adding fail if statement
DevSerendipity added a commit to DevSerendipity/TJ-Bot that referenced this issue Feb 28, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Mar 24, 2022
@Zabuzard Zabuzard added valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board. and removed stale labels Mar 24, 2022
@Zabuzard Zabuzard assigned Zabuzard and unassigned DevSerendipity May 4, 2022
@Zabuzard
Copy link
Member Author

Zabuzard commented May 4, 2022

Taking over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance command Modify or improve an existing command or group of commands of the bot priority: normal valid This issue/PR is validated and ready to be picked. This auto adds items to TJ project board.
Projects
None yet
2 participants