我如何在Emacs组织模式下保护强调如斜体或代码
当我有类似的事情

/cologne/dome/

或者
=<pre language="python">=

最佳答案

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

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

有关详细信息,请参见《组织手册》中的Literal ExamplesMonospace

组织

* 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导出

<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>&lt;pre language="python"&gt;</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">
&lt;pre language="python"&gt;
</pre>

</li>
<li>Multi-line blocks



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

</li>
</ul>

LaTeX导出

\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}

关于emacs - 组织模式:保护重点,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9367565/

10-17 01:56