3

enter image description here

As shown in the image, ~--~ becomes \texttt{-{}-} which turn into 2 dashes in the PDF.

Reason behind seems to be: LaTeX thinks -- as a single character (TeX-ligature for en.dash). And, {} in -{}- separates the two. (take a look here). So, it seems that org wants to export multiple dashes into same amount dashes (no ligature). Plus, Text in the ~code~ and =verbatim= shouldn't get TeX-ligatures:

Text in the code and verbatim string is not processed for Org specific syntax; it is exported verbatim.

By these logic, shouldn't ~----~ become \texttt{-{}-{}-{}-{}-} (actual 4 dashes) instead of \texttt{-{}--{}-} (dash + en.dash + dash)?

                |                                        |                                            
 Original Org   |   Exported  tex file  section          |   Shouldn't be like this?                                    
                |                                        |                                          
* code          |      \section{code}                    |     \section{code}
 1. ~-~         |      \label{sec:org532ffa5}            |     \label{sec:org532ffa5}
 2. ~--~        |      \begin{enumerate}                 |     \begin{enumerate}
 3. ~---~       |      \item \texttt{-}                  |     \item \texttt{-}
 4. ~----~      |      \item \texttt{-{}-}               |     \item \texttt{-{}-}
 5. ~-----~     |      \item \texttt{-{}--}              |     \item \texttt{-{}-{}-}
 6. ~a------b~  |      \item \texttt{-{}--{}-}           |     \item \texttt{-{}-{}-{}-}
                |      \item \texttt{-{}--{}--}          |     \item \texttt{-{}-{}-{}-{}-}
* verbatim      |      \item \texttt{a-{}--{}--{}-b}     |     \item \texttt{a-{}-{}-{}-{}-{}-b}
 1. =-=         |      \end{enumerate}                   |     \end{enumerate}
 2. =--=        |                                        |
 3. =---=       |      \section{verbatim}                |     \section{verbatim}
 4. =----=      |      \label{sec:org4a05ec4}            |     \label{sec:org4a05ec4}
 5. =-----=     |      \begin{enumerate}                 |     \begin{enumerate}
 6. =a------b=  |      \item \texttt{-}                  |     \item \texttt{-}
                |      \item \texttt{-{}-}               |     \item \texttt{-{}-}
                |      \item \texttt{-{}--}              |     \item \texttt{-{}-{}-}
                |      \item \texttt{-{}--{}-}           |     \item \texttt{-{}-{}-{}-}
                |      \item \texttt{-{}--{}--}          |     \item \texttt{-{}-{}-{}-{}-}
                |      \item \texttt{a-{}--{}--{}-b}     |     \item \texttt{a-{}-{}-{}-{}-{}-b}
                |      \end{enumerate}                   |     \end{enumerate}

I'm guessing what's going on behind the curtains: it replaces -- with -{}-. So 4 dashes (----) has 2 -- so each couple get replaced with -{}- finally forming -{}--{}-.


  • Is my reasoning right?
  • Is this legit bug?
  • Or, Is there any reason behind it works the way this is?
3
  • 1
    It's very much a corner case and the output is probably an implementation accident. You probably should submit a bug report: M-x org-submit-bug-report.
    – NickD
    Apr 11 at 14:36
  • Reported it, thanks. I didn't knew org bug report was separate than report-emacs-bug
    – Garid
    Apr 11 at 15:18
  • 1
    Both will work I think: Org devs are watching the Emacs bug reports coming in.
    – NickD
    Apr 11 at 15:49

1 Answer 1

0

Update:

The bug was reported here.

And now, maintainer fixed the bug here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.