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?
M-x org-submit-bug-report
.report-emacs-bug