texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.81k stars 345 forks source link

Priority feature request: Ability to paste markdown and auto convert to LaTex format #3676

Closed elanmoritz closed 5 months ago

elanmoritz commented 5 months ago

Describe the feature and the current behavior/state

I am using various LLMs and GPTChat versions. The text copied to clipboard is usually in markdown format. My current approach is either to manually "Tex"ify :-) it, or use Pandoc. Pandoc itself introduces artifacts and spurious commands not recognized by TexStudio, so I end up manually correcting those. It would be enormously helpful, and increasingly more important to have the capability to a) paste the markdown directly, and then b) highlight it and for the software to TeXify it

Who will benefit with this feature? I think A LOT of people. It would be enormously useful if the TeXifying would handle common math, logic, Physics, and Chemistry symbols.

Any Other info

Eager to hear others' opinion

sunderme commented 5 months ago

The simplest solution is to tell LLM to use LaTeX as output format. As the chats retain context, you can even tell to convert the last answer to LaTeX.

sunderme commented 5 months ago

The other solution is to write a macro which does simple conversions, see https://github.com/texstudio-org/texstudio/wiki/Scripts#paste-as-latex-table as starting point.

sunderme commented 5 months ago

And, maybe as a final remark, I have classified this as "question". "TeXifying" is outside of txs scope (except for for simple cases, for sure not for "common math, logic, Physics, and Chemistry symbols"). pandoc is the specialist for this. (if you can make it work, possibly via macros) Alternative LLMs are really good at text transformation into formats.

elanmoritz commented 5 months ago

Thank You. I have started appending a directive to LLMs to provide output in LaTex formatting ... they're close but not there yet. Still at a toddler level AI there. Hopefully they'll get better. May be if some decent style documents / books were RAG'ed they'd do a better job. I am hoping someone in the TexStudio universe gets interested ... It is good to learn about the script ideas ... I haven't used these yet ... definitely will look into it.

elanmoritz commented 5 months ago

I just located a reference document that can really be of incredible help to brave souls in this adventure ... check
(https://ctan.math.washington.edu/tex-archive/macros/generic/markdown/markdown.html)