alfredapp / openai-workflow

OpenAI integrations
BSD 3-Clause "New" or "Revised" License
67 stars 33 forks source link

Render latex math outputted by ChatGPT as math #39

Closed dblarons closed 5 months ago

dblarons commented 5 months ago

Frequently Asked Questions

Feature details

Most of my ChatGPT searches include math formulas, either inline or on their own line.

The workflow plugin doesn't render the math formulas provided by ChatGPT as math formulas regardless of whether they are inline or on their own line.

Here is an example of an inline formula displayed in Alfred:

image

and the raw markdown code:

1. **Compute the Update Gate \( zᵗ \)**:
\[ zᵗ = σ(Wᶻ \cdot [h^{t-1}, xᵗ]) \]
Here, \( σ \) is the sigmoid activation function, \( xᵗ \) is the input at time step \( t \), \( h^{t-1} \) is the hidden state from the previous time step, and \( Wᶻ \) is the weight matrix for the update gate.

Here is an example of a formula on it's own line in Alfred:

image

In Github Markdown, you are able to render latex math by wrapping your text with $ for an inline equation or $$ for a block:

  1. Compute the Update Gate $zᵗ$: $zᵗ = σ(Wᶻ \cdot [h^{t-1}, xᵗ])$ Here, $σ$ is the sigmoid activation function, $xᵗ$ is the input at time step $t$, $h^{t-1}$ is the hidden state from the previous time step, and $Wᶻ$ is the weight matrix for the update gate.

$$\frac{d^2y}{dt^2} + \omega^2 y = 0$$

Converting this required replacing the instances of \(, \), \[, and \] with either $ or $$.

I tested using the $ syntax in the Alfred notes workflow plugin, and it didn't appear to work:

image

In any event, it looks like the ChatGPT plugin may need to be updated to support substituting the latex symbols for markdown symbols, and whatever text field and markdown code within Alfred itself may need to be updated to support the $ symbol like Github markdown does.

I am aware that you can ask ChatGPT to return the math in a different format, but I have found that to be hit or (mostly) miss. I hope you can consider supporting this because in this is my number one use case and I've had to switch back to the ChatGPT website.

MacOS Ventura 13.6.7 Alfred 5.5 OpenAI Workflow v2024.11

vitorgalvao commented 5 months ago

This is not something which can be supported in the workflow itself. The rendering is done by Alfred.