Wiki entry: Math #74

Open
opened 3 years ago by are0h · 1 comments
are0h commented 3 years ago (Migrated from koodu.ubiqueros.com)

Math rendering is a tricky subject, and php-markdown-extra-math having spent 11 years without love might mean that implementing it could fuck up any number of other systems. A better solution might be to offload the support for math rendering to people who's entire thing is doing exactly that in the first place, by pointing to them in the wiki.

Let's say you're writing something a bit more technical, you want to show an equation and have it look like a nice textbook. Step 0 would be to learn a bit of LaTeX, but here's how to display it on your blog;

Step 1: Note down your LaTeX code in a comment for later use. Your written result will be a URL pointing to an image, which will be even harder to read. For this example we'll use the formula for a capacitor's reactance at a known frequency
[//]: # "X_C = {1 \over 2 \cdot \pi \cdot f \cdot C}"
Step 2: Go to codecogs.com, paste that LaTeX code in, have it render to SVG
Step 3: Copy the download link, and have it display in your blog post. For example:
[//]: # "X_C = {1 \over 2 \cdot \pi \cdot f \cdot C}"
![equation](https://latex.codecogs.com/svg.latex?X_C&space;=&space;{1&space;\over&space;2&space;\cdot&space;\pi&space;\cdot&space;f&space;\cdot&space;C})

The Markdown renderer will show your beautiful equation as a hotlinked image, and you'll have your LaTeX code stowed away so you can check it out later, like so:
Capacitive reactance

Github Markdown's safety features are kicking in here, so instead of the image it's just showing alt-text, but you get the idea.

Math rendering is a tricky subject, and php-markdown-extra-math having spent 11 years without love might mean that implementing it could fuck up any number of other systems. A better solution might be to offload the support for math rendering to people who's entire thing is doing exactly that in the first place, by pointing to them in the wiki. > Let's say you're writing something a bit more technical, you want to show an equation and have it look like a nice textbook. Step 0 would be to learn a bit of LaTeX, but here's how to display it on your blog; > > Step 1: Note down your LaTeX code in a comment for later use. Your written result will be a URL pointing to an image, which will be even harder to read. For this example we'll use the formula for a capacitor's reactance at a known frequency > `[//]: # "X_C = {1 \over 2 \cdot \pi \cdot f \cdot C}"` > Step 2: Go to codecogs.com, paste that LaTeX code in, have it render to SVG > Step 3: Copy the download link, and have it display in your blog post. For example: > `[//]: # "X_C = {1 \over 2 \cdot \pi \cdot f \cdot C}"` `![equation](https://latex.codecogs.com/svg.latex?X_C&space;=&space;{1&space;\over&space;2&space;\cdot&space;\pi&space;\cdot&space;f&space;\cdot&space;C})` > > The Markdown renderer will show your beautiful equation as a hotlinked image, and you'll have your LaTeX code stowed away so you can check it out later, like so: > ![Capacitive reactance](https://latex.codecogs.com/svg.download?X_C%20%3D%20%7B1%20%5Cover%202%20%5Ccdot%20%5Cpi%20%5Ccdot%20f%20%5Ccdot%20C%7D) Github Markdown's safety features are kicking in here, so instead of the image it's just showing alt-text, but you get the idea.
are0h commented 2 years ago (Migrated from koodu.ubiqueros.com)

Yeah, I know about this. It's a bit of a fringe requirment because most poeple don't have the need for expressing complex formulas so this will go on the back burner for now.

But this is definitely related to the other issue you filed where you're hitting the limitations of the editor, which does need to be improved. I might start looking into that after the next feature release. I may even just find a free open source option to plug into the editor because that could be easier than rebuilding the whole thing from scratch.

Yeah, I know about this. It's a bit of a fringe requirment because most poeple don't have the need for expressing complex formulas so this will go on the back burner for now. But this is definitely related to the other issue you filed where you're hitting the limitations of the editor, which does need to be improved. I might start looking into that after the next feature release. I may even just find a free open source option to plug into the editor because that could be easier than rebuilding the whole thing from scratch.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: are0h/Fipamo#74
Loading…
There is no content yet.