Wiki entry: Math #74

Open
opened 2021-11-28 15:56:27 +01:00 by are0h · 1 comment
are0h commented 2021-11-28 15:56:27 +01:00 (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 2021-12-01 01:54:02 +01:00 (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.
ro added this to the Road to Version One project 2024-05-07 22:36:21 +02:00
ro self-assigned this 2024-06-05 21:39:31 +02:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
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: projects/fipamo#74
No description provided.