emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Garid Zorigoo <garidzorigoo@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] Org export LaTeX: Multiple dashes in ~code~/=verbatim= turn into wrong number of dashes [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)]
Date: Wed, 12 Apr 2023 00:10:04 +0900	[thread overview]
Message-ID: <CAEDgBW44j4NpYUpppLpOA5Pmmsfi-GbCzDH4rTmRjf-F64mSaA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4386 bytes --]

I'm exporting the following org file (left-side) to a LaTeX pdf file.
The org file contains the multiple dashes in the ~code~ =verbatim=
format. The exported PDF file doesn't have the correct number of dashes.

|----------------+-----------------------------------|
| Original org   |   Exported  tex file  section     |
|----------------+-----------------------------------|
|                |    ....                           |
|* code          |    \section{code}                 |
| 1. ~-~         |    \label{sec:org532ffa5}         |
| 2. ~--~        |    \begin{enumerate}              |
| 3. ~---~       |    \item \texttt{-}               |
| 4. ~----~      |    \item \texttt{-{}-}            |
| 5. ~-----~     |    \item \texttt{-{}--}           |
| 6. ~a------b~  |    \item \texttt{-{}--{}-}        |
|                |    \item \texttt{-{}--{}--}       |
|* verbatim      |    \item \texttt{a-{}--{}--{}-b}  |
| 1. =-=         |    \end{enumerate}                |
| 2. =--=        |                                   |
| 3. =---=       |    \section{verbatim}             |
| 4. =----=      |    \label{sec:org4a05ec4}         |
| 5. =-----=     |    \begin{enumerate}              |
| 6. =a------b=  |    \item \texttt{-}               |
|                |    \item \texttt{-{}-}            |
|                |    \item \texttt{-{}--}           |
|                |    \item \texttt{-{}--{}-}        |
|                |    \item \texttt{-{}--{}--}       |
|                |    \item \texttt{a-{}--{}--{}-b}  |
|                |    \end{enumerate}                |
|                |    ...                            |
|----------------+-----------------------------------|

These multiple dashes need `{}` separator in between (i.e. `-{}-`).
However, I believe that ~----~ should become \texttt{-{}-{}-{}-{}-}
(actual 4 dashes) instead of \texttt{-{}--{}-} (dash + en.dash + dash)?

It may be needed {} in between every dash. (I read from here
<https://tex.stackexchange.com/a/9814/292504>)

Basically what I'm saying is that. I might need the following in
order to have the correct number of dashes.

|----------------+--------------------------------------|
| Original org   |   Maybe it should have exported      |
|----------------+--------------------------------------|
|                |   ...                                |
|* code          |   \section{code}                     |
| 1. ~-~         |   \label{sec:org532ffa5}             |
| 2. ~--~        |   \begin{enumerate}                  |
| 3. ~---~       |   \item \texttt{-}                   |
| 4. ~----~      |   \item \texttt{-{}-}                |
| 5. ~-----~     |   \item \texttt{-{}-{}-}             |
| 6. ~a------b~  |   \item \texttt{-{}-{}-{}-}          |
|                |   \item \texttt{-{}-{}-{}-{}-}       |
|* verbatim      |   \item \texttt{a-{}-{}-{}-{}-{}-b}  |
| 1. =-=         |   \end{enumerate}                    |
| 2. =--=        |                                      |
| 3. =---=       |   \section{verbatim}                 |
| 4. =----=      |   \label{sec:org4a05ec4}             |
| 5. =-----=     |   \begin{enumerate}                  |
| 6. =a------b=  |   \item \texttt{-}                   |
|                |   \item \texttt{-{}-}                |
|                |   \item \texttt{-{}-{}-}             |
|                |   \item \texttt{-{}-{}-{}-}          |
|                |   \item \texttt{-{}-{}-{}-{}-}       |
|                |   \item \texttt{a-{}-{}-{}-{}-{}-b}  |
|                |   \end{enumerate}                    |
|                |    ...                               |
|----------------+--------------------------------------|

The possible place this bug might reside:
It's possible that while exporting, it replaces -- with -{}-.
So 4 dashes (----) has 2 -- so each couple gets replaced
with -{}- finally forming -{}--{}-.


I was suggested to report this possible bug in the following forum question
<https://emacs.stackexchange.com/questions/76777/org-export-latex-multiple-dashes-in-code-verbatim-turn-into-wrong-number-of?noredirect=1#comment127290_76777>
.


If this was an intentional feature I'm sorry.


Garid Z.



Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.36, cairo version 1.17.6)
 of 2023-01-03
Package: Org mode version 9.5.5 (release_9.5.5 @
/usr/share/emacs/28.2/lisp/org/)

[-- Attachment #2: Type: text/html, Size: 5491 bytes --]

             reply	other threads:[~2023-04-11 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 15:10 Garid Zorigoo [this message]
2023-04-12  6:12 ` [BUG] Org export LaTeX: Multiple dashes in ~code~/=verbatim= turn into wrong number of dashes [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)] Garid Zorigoo
2023-04-12  8:59 ` Ihor Radchenko

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=CAEDgBW44j4NpYUpppLpOA5Pmmsfi-GbCzDH4rTmRjf-F64mSaA@mail.gmail.com \
    --to=garidzorigoo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).