0
votes

Take an example when I attempt to cross-reference a header in org-mode that does not exist. When I export an org file to LaTeX, it does not generate a ref, but instead a texttt. For example:

* Foo

Detail X is in Section [[Bar]]. Detail Y is in Section [[Baz]].

* Bar

This exports to:

\section{Foo}
\label{sec-1}

Detail X is in Section \ref{sec-2}. Detail Y is in Section \texttt{Baz}.
\section{Bar}
\label{sec-2}

When I am using the :export: and :noexport tags to export only parts of my org document, any "bad" cross-refs (i.e. that reference a non-exported heading) are transmored into verbatim with texttt. When those headings are long, the resulting bad cross ref looking ugly.

Question: can I instead tell org-mode just simply export \texttt{??} for a bad cross-referenced heading? This would make it look consistent with broken bibtex citations.

2

2 Answers

1
votes

Check this variable out:

org-latex-link-with-unknown-path-format is a variable defined in ox-latex.el. Its value is \\texttt{%s}

Documentation: Format string for links with unknown path type.

0
votes

As already said, you can configure the variable to sthing other than \texttt. What I use:

(setq org-latex-link-with-unknown-path-format "\\colorbox{red}{%s}")