I'm currently writing a report in org-mode. I have a couple of sections which have the same names, with the section names appearing both as a subsection of the background section, and as a section in themselves. The following example should show the issue that I'm coming across. In the document below, I want to refer to the two sections with duplicate names in the introduction. To refer to a section the [[Section Name]]
syntax is used. A brief description of the usage is found in the org manual.
#+TITLE: Musings about Sections
#+AUTHOR: R. Chapter
#+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [a4paper,11pt]
* Introduction
In section [[The Use of Sections]], we speak about how sections are used. In section
[[How Sections Work]] we briefly introduce the implementation of sections. In
section [[How Sections Work]] we go into more detail about the inner workings of sections.
* Background
** The Use of Sections
** How Sections Work
* How Sections Work
Exporting this file to latex results in the first section with the duplicate name being referenced twice, where in fact the first section reference to "How Sections Work" should be to sec-2-2
, and the second to sec-3
.
\title{Musings about Sections}
\author{R. Chapter}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
\label{sec-1}
In section \ref{sec-2-1}, we speak about how sections are used. In section
\ref{sec-2-2} we briefly introduce the implementation of sections. In
section \ref{sec-2-2} we go into more detail about the inner workings of sections.
\section{Background}
\label{sec-2}
\subsection{The Use of Sections}
\label{sec-2-1}
\subsection{How Sections Work}
\label{sec-2-2}
\section{How Sections Work}
\label{sec-3}
Is there any way that I can refer to a specific section from within org-mode, given that I don't know what section reference it will be given when I export it?