# LaTeX 코드의 올바른 복사/붙여넣기 추가

**URL:** https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663
**Category:** Feature
**Tags:** math, completed
**Created:** [6월 21, 2022, 12:28오후 UTC](https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663 "2022-06-21T12:28:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [6월 21, 2022, 12:28오후 UTC](https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663/1 "2022-06-21T12:28:13Z")

</div>

또 다른 PR를 만들었습니다. 이번에는 항상 원했던 기능을 추가하기 위한 것입니다: LaTeX 코드의 적절한 복사/붙여넣기입니다. 게시글에서 렌더링된 LaTeX를 강조 선택한 후 편집기에 붙여넣으면 적절한 LaTeX 코드가 삽입됩니다. 확인해 보세요:

> <https://github.com/discourse/discourse-math/pull/54>
>
> This is pretty cool and something I wanted for a long time. Katex has copy/paste… support via the Copy-Tex extension which is embedded but needs to be manually loaded, see https://github.com/KaTeX/KaTeX/tree/main/contrib/copy-tex
> 
> Basically, one highlights the browser rendered Latex, then Ctrl+C/Cmd+C and then Ctrl+V/Cmd+V and it will paste \*all\* the Latex Latex code (nicely formatted too). It even fetches tags and labels, not just equation code.
> 
> @pmusaraj 
> 
> p.s. The Discourse "quote" functionality is also improved, in that you also now get all the Latex code of what you highlighted (not just the (utterly ugly) text converted version of your Latex)

@sam Discourse의 “인용” 기능도 개선되었지만, 특이점이 있습니다. 강조된 방정식에 대해 적절한 LaTeX 코드를 삽입하기는 하는데(따라서 Discourse 코드가 클립보드 기능을 기반으로 한다는 것을 알 수 있습니다), 여전히 일반 텍스트 버전도 함께 추가하며, 그것도 두 번이나 추가합니다. 이는 명백한 버그입니다. 이 문제를 조사하고 수정해 볼 수 있지만, Discourse에서 강조된 텍스트의 “인용” 기능을 처리하는 코드에 대한 여러분의 힌트가 있으면 시간을 절약할 수 있을 것 같습니다.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [6월 22, 2022, 2:07오전 UTC](https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663/2 "2022-06-22T02:07:46Z")

</div>

> [@nordize](#):
>
> 이 문제를 살펴보고 수정해 보겠습니다만, 하이라이트된 텍스트에 대한 “인용” 기능을 처리하는 Discourse 코드에 대해 힌트를 주시면 시간을 절약할 수 있을 것 같습니다.

아, 정말 적시에 나온 질문이네요. 여기서 @martin이 한 작업이 이 질문에 도움이 될 수 있을까요?

> <https://github.com/discourse/discourse/pull/17141>
>
> This commit allows quoting of discourse-local-date elements
> and converts the qu…oted tags back into bbcode so that the
> rendered quote will also render the discourse-local-date HTML.
> This works on single dates as well as date ranges, and supports
> all of the options used by discourse-local-date.
> 
> This also necessitated adding addTextDecorateCallback to the
> to-markdown core lib (similar to addBlockDecorateCallback and
> addTagDecorateCallback) to transform the text nodes between
> date ranges to remove the -\> in the final quote.
> 
> c.f. https://meta.discourse.org/t/quotes-that-contain-date-time/101999
> 
> !\[chrome-capture-2022-5-20\](https://user-images.githubusercontent.com/920448/174523389-bec48cee-4599-4dd1-9ee0-b0dcf25baa12.gif)

---

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [6월 22, 2022, 4:13오전 UTC](https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663/3 "2022-06-22T04:13:21Z")

</div>

@sam이 지적한 제 수정 사항과 관련이 있는지 확실하지 않지만, 확인해 볼 수 있습니다. 재현을 시도해 볼 수 있는 LaTeX 코드를 제공해 주시겠습니까? 무슨 일이 일어나고 있는지에 대한 화면 녹화도 매우 유용할 것입니다.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2월 1, 2023, 11:06오전 UTC](https://meta.discourse.org/t/adding-proper-copy-paste-of-latex-code/253663/4 "2023-02-01T11:06:19Z")

</div>


