emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: Chlo De <shiyue9621@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Bug: unexpected behavior of nesting braces when exporting to LaTeX
Date: Sun, 22 Aug 2021 17:03:50 +0200	[thread overview]
Message-ID: <878s0tikrt.fsf@gmail.com> (raw)
In-Reply-To: <466664A7-58C7-4552-A2AF-FC2A8B01BFB4@gmail.com> (Chlo De's message of "Sun, 22 Aug 2021 09:03:22 -0400")

Hello Yue,

Posting your mail below back to the list where you have a better chance
of getting the right explanation. I totally understand that many times
copy directly latex chunk is a nice feature org-mode offers.

From your example below, exporting the following script to latex would
work ok in org-mode.

#+options: toc:nil
#+LATEX_HEADER: \usepackage{amsthm}
#+LATEX_HEADER: \newtheorem{theorem}{Theorem}\usepackage{setspace}

* Theorem

 The longest word in this sentence is \emph{emphasized}.
   An emphasized a word looks \emph{distinguished}.

Yes, for my part I usually wrap into a source block, if I need native
latex syntax

#+BEGIN_SRC latex

I don't know if it is the case by design or if it is a bug.


On Sunday, 22 Aug 2021 at 09:03, Chlo De wrote:
> Hello Jeremie,
> Thank you for your reply. 
> As both \emph and \textit are commonly used LaTeX commands, I would
> expect everything inside the braces be interpreted in LaTeX way, i.e.,
> plain { }  are for semantic use only and are omitted in the output.
> I appreciate that you mentioned native org-syntax. There are two reasons
> that I prefer the LaTeX way. 
> - I sometimes need to copy large chunk of tex contents from my other
> notes or papers. It would be easier if I don’t need to convert them one
> by one, as it is hard to spot such a thing in a long document.
> - \emph is not exactly \textbf or \textit. With its default definition,
> in text, \emph behaves like \textit. However, in an environment where the
> text is italic by default, say, theorem, \emph will turn the text into
> normal font. Here is a minimal example.
> \documentclass{article}
> \usepackage{amsthm}
> \theoremstyle{theorem}
> \newtheorem{theorem}{Theorem}
> \begin{document}
>  The longest word in this sentence is \emph{emphasized}.
>  \begin{theorem}
>    An emphasized a word looks \emph{distinguished}.
>  \end{theorem}
> \end{document}
> The output is
> [cid]                                                    
> Besides, this question seems related 
> https://emacs.stackexchange.com/questions/52510/not-scape-braces-in-latex-org-mode
> Best,
> Yue
>     On Aug 22, 2021, at 03:27, Jeremie Juste <jeremiejuste@gmail.com>
>     wrote:
>     Hello Yue,
>     On Friday, 20 Aug 2021 at 00:45, Chlo De wrote:
>         \emph{{n+1}-a}
>         \textit{a{b}c}
>         will be translated as LaTeX expressions
>         \emph\{\{n+1\}-a\}
>         \textit\{a\{b\}c\}
>     I'm not sure it is a bug. Could you specify what do you expect in
>     these
>     cases?
>     Note that there are native org-syntax for \emph and \textbf
>     *n+1 - a*
>     /a{b}c/
>     (info "(org) Emphasis and Monospace")
>     HTH,
>     --
>     Jeremie Juste

Jeremie Juste

  parent reply	other threads:[~2021-08-22 15:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  4:45 Bug: unexpected behavior of nesting braces when exporting to LaTeX Chlo De
2021-08-22  7:27 ` Jeremie Juste
     [not found]   ` <466664A7-58C7-4552-A2AF-FC2A8B01BFB4@gmail.com>
2021-08-22 15:03     ` Jeremie Juste [this message]
2021-08-23  9:56 ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878s0tikrt.fsf@gmail.com \
    --to=jeremiejuste@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=shiyue9621@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).