我正在org-mode工作并尝试生成一个链接,以引用一个部分的编号,而不是它的标题.
* 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.
Run Code Online (Sandbox Code Playgroud)
我想看看
As you can see in Section 1
Run Code Online (Sandbox Code Playgroud)
写点东西
As you can see in Section [[sec:one]],
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
Tom*_*ner 21
我为此使用专用目标:
* 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.
Run Code Online (Sandbox Code Playgroud)
这按预期工作; 请参阅内部链接上的orgmode文档以供参考.
汤姆·雷格纳(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).
Run Code Online (Sandbox Code Playgroud)
您可以按名称引用部分:
* Section One
* Section Two
* Links
This is a number link: [[Section One]]
This is a textual link: [[Section One][Some text for the link]]
Run Code Online (Sandbox Code Playgroud)
这是 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}
Run Code Online (Sandbox Code Playgroud)