yaph / chatgpt-export

A browser bookmarklet for exporting conversations with ChatGPT as markdown files.
https://geeksta.net/tools/chatgpt-to-markdown/
MIT License
61 stars 9 forks source link

LaTeX not copied from conversation... #7

Open malekinho8 opened 3 months ago

malekinho8 commented 3 months ago

Problem Description

I had a conversation that looked like so:

Screenshot 2024-08-08 at 8 16 34 AM

When I ran the bookmarklet and displayed the Markdown in VS Code, I was expecting to see the LaTeX formatted text, but I saw this:

Screenshot 2024-08-08 at 8 17 26 AM

The Markdown code was this:

# ChatGPT

## PROMPT 1

you know how in electrical circuits the potential drop across all elements in series is equal to sum of potential drop across each element in the series?

## RESPONSE 1

Yes, I understand. In an electrical circuit, when resistors (or other components) are connected in series, the total voltage drop across the series combination is equal to the sum of the voltage drops across each individual component.

Mathematically, if you have resistors R1,R2,…,RnR\_1, R\_2, \\ldots, R\_nR1​,R2​,…,Rn​ connected in series, and a total voltage VVV applied across the entire series, the voltage drop across each resistor V1,V2,…,VnV\_1, V\_2, \\ldots, V\_nV1​,V2​,…,Vn​ can be expressed as:

V\=V1+V2+⋯+VnV = V\_1 + V\_2 + \\cdots + V\_nV\=V1​+V2​+⋯+Vn​

Where V1,V2,…,VnV\_1, V\_2, \\ldots, V\_nV1​,V2​,…,Vn​ are the voltage drops across R1,R2,…,RnR\_1, R\_2, \\ldots, R\_nR1​,R2​,…,Rn​ respectively.

Expected Behavior

It should have been this:

# ChatGPT

## PROMPT 1

you know how in electrical circuits the potential drop across all elements in series is equal to sum of potential drop across each element in the series?

## RESPONSE 1

Yes, I understand. In an electrical circuit, when resistors (or other components) are connected in series, the total voltage drop across the series combination is equal to the sum of the voltage drops across each individual component.

Mathematically, if you have resistors $R_1, R_2, \ldots, R_n$​ connected in series, and a total voltage $V$ applied across the entire series, the voltage drop across each resistor $V_1, V_2, \ldots, V_n$,​ can be expressed as:

$$V = V_1 + V_2+ \cdots + V_n$$

Where $V_1, V_2, \ldots, V_n$ are the voltage drops across $R_1, R_2, \ldots, R_n$​ respectively.

Which would look like so:

Screenshot 2024-08-08 at 8 22 03 AM
yaph commented 3 months ago

Thanks for the comprehensive report! The responses are converted to markdown using the turndown package and ChatGPT uses KaTeX markup. If the conversion step would be skipped for responses containing LaTeX document.querySelector('.katex').textContent still yields the same result:

Vtotal=V1+V2+V3+⋯+VnV_{\\text{total}} = V_1 + V_2 + V_3 + \\dots + V_nVtotal​=V1​+V2​+V3​+⋯+Vn​