emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] New LaTeX exporter, link to \ref


From: Nicolas Goaziou
Subject: Re: [O] New LaTeX exporter, link to \ref
Date: Sun, 16 Sep 2012 09:40:33 +0200

Hello,

address@hidden (Thomas S. Dye) writes:

> This in the org file:
>
> (fig. [[fig:old-wood]])
>
> exports to this in the latex file:
>
> (fig. \ref{fig-old-wood})
>
> I think the exporter is replacing the colon with a hyphen, which breaks
> the reference.

Correct. It's done by the function `org-export-solidify-link-text'. The
problem is that it isn't used consistently across the back-end. It
should be fixed now.

> Also, is there some way to toggle a non-breaking space, e.g.,
> (fig.~\ref{fig:old-wood})?  I thought to use \tilde{}, but this wouldn't
> work with other back ends.

You may use \nbsp{} entity.

My keyboard layout allows for easy access to non-breaking spaces. So
I use the following instead (_ character stands for the non-breaking
space):

#+begin_src emacs-lisp
(defun ngz-latex-filter-nobreaks (text backend info)
  "Ensure \"_\" are properly handled in Beamer/LaTeX export."
  (when (memq backend '(e-beamer e-latex))
    (replace-regexp-in-string "_" "~" text)))
(add-to-list 'org-export-filter-plain-text-functions
             'ngz-latex-filter-nobreaks)
#+end_src

HTH,


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]