组织模式:保护重点

发布于 2025-01-07 18:42:46 字数 170 浏览 0 评论 0原文

我如何在 Emacs org-mode 中保护斜体或代码等强调内容 当我有类似

/cologne/dome/

或 的

=<pre language="python">=

事情时?

How could I protect emphasis like italics or code within Emacs org-mode
when I have things like

/cologne/dome/

or

=<pre language="python">=

?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想你的星星会说话 2025-01-14 18:42:46

以下组织块演示了哪些部分默认工作,哪些部分需要少量的解决方法才能工作。

以下内容是使用Org-mode 版本 7.8.03 (release_7.8.03.321.gaac1c) 创建的。如果您使用的是旧版本,行为可能会略有不同。

请参阅文字示例Monospace 了解完整详细信息

ORG

* Italics
  - Your example simply works\\
    /cologne/dome/
  - It also works if your /example had / spaces within it/
  - It will only fail if / your /have spaces on one end or the other /
* Code
  Code blocks can be delimited in multiple ways:
 ** Inline formatting
    - Using ~ for verbatim text works\\
      ~<pre language="python">~
    - ~ renders the same as = for blocks =test= ~test~
 ** Code Blocks
    - Single-line blocks
      : <pre language="python">
    - Multi-line blocks
      #+BEGIN_EXAMPLE
        asdf
      #+END_EXAMPLE

HTML Export

<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Italics</h2>
<div class="outline-text-2" id="text-1">

<ul>
<li>Your example simply works<br/>
  <i>cologne/dome</i>
</li>
<li>It also works if your <i>example had / spaces within it</i>
</li>
<li>It will only fail if / your /have spaces on one end or the other /
</li>
</ul>

</div>

</div>

<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Code</h2>
<div class="outline-text-2" id="text-2">

<p>Code blocks can be delimited in multiple ways:
</p>
</div>

<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Inline formatting</h3>
<div class="outline-text-3" id="text-2-1">

<ul>
<li>Using ~ for verbatim text works<br/>
  <code><pre language="python"></code>
</li>
<li>~ renders the same as = for blocks <code>test</code> <code>test</code>
</li>
</ul>

</div>

</div>

<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Code Blocks</h3>
<div class="outline-text-3" id="text-2-2">

<ul>
<li>Single-line blocks
<pre class="example">
<pre language="python">
</pre>

</li>
<li>Multi-line blocks



<pre class="example">asdf
</pre>

</li>
</ul>

LaTeX Export

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

\begin{itemize}
\item Your example simply works\\
\emph{cologne/dome}
\item It also works if your \emph{example had / spaces within it}
\item It will only fail if / your /have spaces on one end or the other /
\end{itemize}
\section{Code}
\label{sec-2}

Code blocks can be delimited in multiple ways:
\subsection{Inline formatting}
\label{sec-2-1}

\begin{itemize}
\item Using \~{} for verbatim text works\\
\verb~<pre language="python">~
\item \~{} renders the same as = for blocks \texttt{test} \verb~test~
\end{itemize}
\subsection{Code Blocks}
\label{sec-2-2}

\begin{itemize}
\item Single-line blocks
\begin{verbatim}
   <pre language="python">
\end{verbatim}
\item Multi-line blocks

\begin{verbatim}
asdf
\end{verbatim}
\end{itemize}

The following org-block demonstrates which parts work by default and which need a small amount of work-around to work.

The following was created using Org-mode version 7.8.03 (release_7.8.03.321.gaac1c). If you're using an older version it is possible that the behaviour is slightly different.

See Literal Examples and Monospace in the Org-Manual for full details

ORG

* Italics
  - Your example simply works\\
    /cologne/dome/
  - It also works if your /example had / spaces within it/
  - It will only fail if / your /have spaces on one end or the other /
* Code
  Code blocks can be delimited in multiple ways:
 ** Inline formatting
    - Using ~ for verbatim text works\\
      ~<pre language="python">~
    - ~ renders the same as = for blocks =test= ~test~
 ** Code Blocks
    - Single-line blocks
      : <pre language="python">
    - Multi-line blocks
      #+BEGIN_EXAMPLE
        asdf
      #+END_EXAMPLE

HTML Export

<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Italics</h2>
<div class="outline-text-2" id="text-1">

<ul>
<li>Your example simply works<br/>
  <i>cologne/dome</i>
</li>
<li>It also works if your <i>example had / spaces within it</i>
</li>
<li>It will only fail if / your /have spaces on one end or the other /
</li>
</ul>

</div>

</div>

<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Code</h2>
<div class="outline-text-2" id="text-2">

<p>Code blocks can be delimited in multiple ways:
</p>
</div>

<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Inline formatting</h3>
<div class="outline-text-3" id="text-2-1">

<ul>
<li>Using ~ for verbatim text works<br/>
  <code><pre language="python"></code>
</li>
<li>~ renders the same as = for blocks <code>test</code> <code>test</code>
</li>
</ul>

</div>

</div>

<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Code Blocks</h3>
<div class="outline-text-3" id="text-2-2">

<ul>
<li>Single-line blocks
<pre class="example">
<pre language="python">
</pre>

</li>
<li>Multi-line blocks



<pre class="example">asdf
</pre>

</li>
</ul>

LaTeX Export

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

\begin{itemize}
\item Your example simply works\\
\emph{cologne/dome}
\item It also works if your \emph{example had / spaces within it}
\item It will only fail if / your /have spaces on one end or the other /
\end{itemize}
\section{Code}
\label{sec-2}

Code blocks can be delimited in multiple ways:
\subsection{Inline formatting}
\label{sec-2-1}

\begin{itemize}
\item Using \~{} for verbatim text works\\
\verb~<pre language="python">~
\item \~{} renders the same as = for blocks \texttt{test} \verb~test~
\end{itemize}
\subsection{Code Blocks}
\label{sec-2-2}

\begin{itemize}
\item Single-line blocks
\begin{verbatim}
   <pre language="python">
\end{verbatim}
\item Multi-line blocks

\begin{verbatim}
asdf
\end{verbatim}
\end{itemize}
止于盛夏 2025-01-14 18:42:46

我猜你想输出原始的 /cologne/dome/,而不是 cologne/dome,对吧?

两种方式:

  1. 设置#+OPTIONS: *:nil关闭所有强调符号
  2. 修改org-emphasis-alist,删除相关项

我在这里也问了类似的问题: 如何在组织模式下转义斜杠?

I guess you want to output the original /cologne/dome/, but not <i>cologne/dome</i>, right?

Two ways:

  1. set #+OPTIONS: *:nil to turn off all emphasis symbols
  2. modify org-emphasis-alist, remove the relevant items

I also asked a similar question here: How do I escape slash in org-mode?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文