【问题标题】:How to insert plain text?如何插入纯文本?
【发布时间】:2013-01-07 20:08:15
【问题描述】:

我有一些 xml 文本作为纯文本插入到文档中。我直接插入,但它给出了奇怪的符号。我怎样才能避免这种情况?

我要添加的XML:

\begin{tabular}{|c|}

<table>
<tr>
<td> Title and Logo</td>
</tr>
<tr>
<td> left Column </td>
<td> main table </td>
</tr>
</table>


\end{tabular}

输出是这样的:

¡table¿ ¡tr¿ ¡td¿ Title and Logo¡/td¿ ¡/tr¿ ¡tr¿ ¡td¿ left Column ¡/td¿ ¡td¿ main table ¡/td¿ ¡/tr¿ ¡/table

基本上我想在表格中添加 HTML 代码。我该怎么做?

【问题讨论】:

标签: latex tex


【解决方案1】:

您尝试过verbatim 环境吗?

\begin{verbatim}
  Your text here.
\end{verbatim}

如果不知道您的“奇怪符号”是什么,就很难为您的问题提出解决方案。


更新:为了在表格单元格中嵌入verbatim 环境,您需要将列更改为段落列(使用pm 或@987654327 @ 作为列说明符);例如

\begin{tabular}{|p{10cm}|}
  \begin{verbatim}
    Your text here.
  \end{verbatim}
\end{tabular}

更多信息请参见Wikibooks

【讨论】:

  • 我试图在表格中逐字添加开始,但它没有编译
  • @texasbruce ...那么它失败的错误信息是什么?
  • ! LaTeX Error: Something's wrong--perhaps a missing \item. See the LaTeX manual or LaTeX Companion for explanation. Type H &lt;return&gt; for immediate help. ... l.186 \begin{verbatim} Try typing &lt;return&gt; to proceed. If that doesn't work, type X &lt;return&gt; to quit.
猜你喜欢
  • 1970-01-01
  • 2011-10-26
  • 2016-10-15
  • 2021-08-22
  • 1970-01-01
  • 2019-01-24
  • 1970-01-01
  • 1970-01-01
  • 2011-05-15
相关资源
最近更新 更多