From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mEnUOh7A1GCcDgAAgWs5BA (envelope-from ) for ; Thu, 24 Jun 2021 19:25:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WFiRNh7A1GB3BAAA1q6Kng (envelope-from ) for ; Thu, 24 Jun 2021 17:25:50 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 37028FCD6 for ; Thu, 24 Jun 2021 19:25:50 +0200 (CEST) Received: from localhost ([::1]:34006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwT6r-0007GJ-7O for larch@yhetil.org; Thu, 24 Jun 2021 13:25:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwT6G-0007G9-P9 for emacs-orgmode@gnu.org; Thu, 24 Jun 2021 13:25:12 -0400 Received: from mout.gmx.net ([212.227.15.15]:57223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwT6D-0002VP-Kk for emacs-orgmode@gnu.org; Thu, 24 Jun 2021 13:25:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624555507; bh=9Kpm3h58hInzmmg9diTiz7H8aUc1+fwFSh6AzyDzeFA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e+QrOKEFgb8cvU/EOLlf/Ds77cVj3A7FunDERybhAHgm43GgtWRTGVv2UaWj7yojZ baBq08FRBDn3dl8KSHVy1FEv2U9OlA3IyzJ/s5utOZUIpJhyatU6TPQiCH8Z/c3xCg 3xzDlaQ1dfqduD8yTG4UAqABTsGu52OPJ79xAisU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [92.251.40.31] ([92.251.40.31]) by web-mail.gmx.net (3c-app-mailcom-bs06.server.lan [172.19.170.174]) (via HTTP); Thu, 24 Jun 2021 19:25:06 +0200 MIME-Version: 1.0 Message-ID: From: Christopher Dimech To: Rodrigo Morales Subject: Latex highlighting for org-mode Content-Type: text/html; charset=UTF-8 Date: Thu, 24 Jun 2021 19:25:06 +0200 Importance: normal Sensitivity: Normal In-Reply-To: References: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:oJAfq/S8NViT8sX5UawpivlrxAmtPliDbyUB28C747wguyuhXvmT6QXkyKNl2IiwoASAV hRVhvT3hRKgbWxuq4ILmeY+aHvIY/fPPazL2FKw2TTFWIM5Ht9i4F3++xyPPl0CF5+m4FTYWLB78 SRuGNKWHZpbm9tpg5+69p5bdIW9/wTRJbyT/vPsd82qmkEHIfeE6WvZH+8xpBSanJJJaLLH/+08p 4ISLOKBfgY2PK2KrX08JLZSot6EU9YRh3dXd7YWUWK+eAL1pXmSFgzzab/zxqRaoEEr9TX9C/jRY kY= X-UI-Out-Filterresults: notjunk:1;V03:K0:JMzRlXzq/ek=:KQQopNrsO2kxVsB3RVUqax GlRDklWOO0J3/8Woyb+gnm8SlNuijTtqbG+uOsiBcT4TEjxxc+UD4whY6xBzgVQHiLK1yfQuP C7lnyOqbY25NmTXuGgBSrY93glUUZ9x7KCSNcfsA6NBDUbg5C78fLxlLMX5zqCBj6i5p9w93G 4Ev14LB1ad4uM5D8jYsxLie5l0Rrrm8Djpt1oqffDs3WqgIxGOavv/0gNfk4wFvlMQIkwR+Xc hdBP5sbrzAElw8PNNFrPfNjvJbxUZscjEfJnhyvt2b0YDJ5b4px7hHLHWWsshQYY4VvkwS8O8 JRphyx+nFET0TvDsUAYMgwM5+GS0y2oTTV6I5Gd34PBkecOcK0vlxSuYZa0qZmBkAgUEcPjAs VP2guv0ZNfhOyPcoBOyXGHSW6/JpWNKu+5XPPyOf5W2r6M8HKa62ZT1tr7hVZ3m6HzPPIcsp7 1FkbhvILivcK4f3guSPJDgggmh2xKbgG5rs8gdk7xmUPiPMBUES3Q2n408kxMeGAB2gp7kxK/ sUXOAvvU452RXjiz7CprygxPxug2kuqrFDP03M+7UokInmVE28o6ZMY2WdzwfbKMyy9H6c8w9 0pSCQm4nM3c1BJr0NIvMEviqJ4aPWFSaXHDgEH3ENBGBcjg2OoaP/Y1+Su7ISbzQBFzr7WnNo oBZu9uutImRwvgQI5xC2aaaq0SkY3G/jW6IPLclyyrw1GMvFINl2WWQq/9sDmcM5j9zYZ9ngR 19tZFHgDH2BaP3mtM45yIPXBv5dSuQK9ZIFuTnToQ8YuP0c0UcWe0vIvjfBK3KNfFWXG1S8xF Uk7QsNh1e4Uv/VmLsSb2ga8bLvQDw== Received-SPF: pass client-ip=212.227.15.15; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Help Emacs Orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624555550; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9Kpm3h58hInzmmg9diTiz7H8aUc1+fwFSh6AzyDzeFA=; b=seBLzwxsnj2cJYhsPjd7U8JFfvAGBwCRwY9rK4IfkPwXzqUrfkBI5/Z+tvB6Gp3KuiHfHm K5SBHJr7IdWNMeLPou926v0oCvOYTWOuPYle4bkwIFEg1X8iFCnkWKssBXQLYEJrZgHeyW hQsLttJtR4A+1Sm8sE353HiYXartAlaTops1L1gzxcHjfZF4W7wWNqgqIFvcPRYF0GkaEI 8YpRypyHW+PdujxJEawY0VxUudnCQz2Ja2OuonD0cwsvhs5G9ILYa7GG/ca9Ok4S+JjP0t NPttRQio0cBKtJDuaWx1knmVdh2c4FQzlaqnTTkvw4K/yI9i2i/3E2urTUnXZw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624555550; a=rsa-sha256; cv=none; b=kOSjaY3NUIrz80Zj/XeYJyEQBlfyYu6MkoQNwHOju7M+oyXoPJISQgKaDHGPJ6/Dwm4acD Pj3rs+JoEI3zxUeO2CNk/fJgLINVSjAAFyjl41ifxhISsdVH5gDQAlfqPXDGVsj12FrESq /isJdUDq8tabyGFcd9htJCDd76LXUVg117JnfKLLRM5ZKDDOJMmzYtToGfGIQjiK+Yn/1Y Fgkwb2yJtYsaO+VXS1wAsQsIB1GbVzxZ5OJzDIZm8o96L/8LlTQc8hgLjOu7Dowy5NTiek iOa/lxjPqgyiQQ1jnAWp+D7bzKZh51O0q4Xb9FYiGwgtA7LoDOxx3uMpt5fHFQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=e+QrOKEF; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=e+QrOKEF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 37028FCD6 X-Spam-Score: -1.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0b4Zw4D7Pr1f
I conclude that org-mode cauld do with some improvements.  If org-mode was designed to allow
LaTeX fragments without the need of any special marking, it should allow latex syntex highlighting
without the need of any special markings.
 
Sent: Friday, June 25, 2021 at 4:28 AM
From: "Rodrigo Morales" <moralesrodrigo1100@gmail.com>
To: "Christopher Dimech" <dimech@gmx.com>
Cc: "Help Emacs Orgmode" <emacs-orgmode@gnu.org>
Subject: Re: Latex highlighting for org-mode
There are two ways with which you can get LaTeX syntax highlighting when
editing LaTeX in org-mode buffers.

* No. 1: LaTeX code blocks

You can have LaTeX code blocks within your document with the following
header arguments and thus have syntax highlighting and make the content
of those code blocks to be exported as LaTeX.

Advantage: Code blocks are syntax highlighted.

Disadvantage: The code block is not exported when exporting to HTML,
only when exporting to LaTeX.

#+BEGIN_SRC latex :results latex :exports results
\[
  \frac{12}{13} + 12
\]
#+END_SRC

* No 2: Executing org-edit-special in LaTeX environments

When using org-edit-special (C-c ') in LaTeX environments, the snippet
is opened in a buffer whose major mode is latex-mode so you get syntax
highlighting within that buffer.

Advantage: The snippets are exported as raw text when exporting to HTML.

Disadvantage: The snippets are not syntax highlighted. They are only syntax
highlighted in the dedicated buffer which is shown in org-edit-special.

#+BEGIN_SRC org
Solving $12 + 13$ is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\[
  12 + 13
\]

is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\begin{equation}
  12 + 13
\end{equation}

is not difficult.
#+END_SRC

* Side note

If you want to see the behavior when exporting to HTML, I encourage you
to export the following Org Mode file to HTML and see what happens.

#+BEGIN_SRC org
The following is not shown when exporting to HTML.

#+begin_src latex :results latex :exports results
\[
  10 + 10
\]
#+end_src

#+RESULTS:
#+begin_export latex
\[
  10 + 10
\]
#+end_export

The following is shown as an image when exporting to HTML.
3
#+begin_src latex :exports results :results file graphics :file 20.png
\[
  20 + 20
\]
#+end_src

#+RESULTS:
[[file:20.png]]

The following is shown as text when exporting to HTML.

\[
  30 + 30
\]

The following is shown as text when exporting to HTML.

\begin{equation}
40 + 40
\end{equation}
#+END_SRC

Hope that helps.

---
Greetings,
rdrg109
 
On Thu, 24 Jun 2021 at 00:07, Christopher Dimech <dimech@gmx.com> wrote:
Would it be possible for org-mode to have syntax highlighting
for latex commands?  Currently I have to change mode with
"M-x latex-mode" to get the highlighting.