16

我在组织模式下工作并尝试生成一个链接以通过其编号而不是其标题来引用一个部分。

* 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]],

有任何想法吗?

4

3 回答 3

29

我为此使用专用目标

* 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 文档以供参考。

于 2013-05-03T09:33:09.783 回答
9

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).
于 2014-07-06T17:04:38.543 回答
6

您可以按名称引用部分:

* 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}
于 2016-08-07T23:06:45.717 回答