Подтвердить что ты не робот

Как я могу ссылаться на раздел по номеру в экспорте org-mode?

Я работаю в режиме org и пытаюсь создать ссылку для ссылки на раздел по его номеру, а не по названию.

* Section One
:PROPERTIES:
:CUSTOM_ID: sec:one
:END:

* Section Two
#+label: sec:two

I can reference Section One with  [[#sec:one]] and [[#sec:one][Section One]],
but I can't get the actual section number (1) to resolve.

Я хочу видеть

As you can see in Section 1

Пишем что-то вроде

As you can see in Section [[sec:one]],

Любые идеи?

4b9b3361

Ответ 1

Я использую выделенные цели для этого:

* Section One
  <<sec:one>>

* Section Two
  <<sec:two>>

I can reference Section One with  [[sec:one]] and [[sec:one][Section One]],
but I can get the actual section number (1) to resolve.

Это работает так, как ожидалось; см. документацию orgmode по внутренним ссылкам для справки.

Ответ 2

Подход Tom Regner работает, однако вам не нужно использовать выделенный объект, вы все равно можете использовать ссылку custom_id, но без описания. Вот так:

* Section One
:PROPERTIES:
:CUSTOM_ID: sec:one
:END:

* Section Two
You can reference Section One with [[#sec:one]] but NOT
[[#sec:one][Section One]], i.e., the link without description
will get you the actual section number (1).

Ответ 3

Вы можете обратиться к разделам по имени:

* Section One

* Section Two

* Links
  This is a number link: [[Section One]]
  This is a textual link: [[Section One][Some text for the link]]

Здесь вывод LaTeX:

\section{Section One}
\label{sec:orgheadline1}

\section{Section Two}
\label{sec:orgheadline2}

\section{Links}
\label{sec:orgheadline3}
This is a number link: \ref{sec:orgheadline1}
This is a textual link: \hyperref[sec:orgheadline1]{Some text for the link}