我有一些 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 代码。我怎样才能做到这一点?
最佳答案
您尝试过逐字
环境吗?
\begin{verbatim}
Your text here.
\end{verbatim}
如果不知道您的“奇怪符号”是什么,就很难为您的问题提出解决方案。
<小时/>更新:为了在表格单元格中嵌入逐字
环境,您需要将该列更改为段落列(使用p
code>、m
或 b
作为列说明符);例如
\begin{tabular}{|p{10cm}|}
\begin{verbatim}
Your text here.
\end{verbatim}
\end{tabular}
参见Wikibooks了解更多信息。
关于latex - 如何插入纯文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14203243/