如何使 SQL 表看起来像来自终端

问题描述 投票:0回答:1

我有一个来自终端的 SQL 表,我希望能够在 LaTeX 报告中“按原样”复制它。这将帮助读者看得更清楚,也更容易复制粘贴。表格看起来像这样:

+-----------+----------+------+-----+---------+-------+
| Field     | Type     | Null | Key | Default | Extra |
+-----------+----------+------+-----+---------+-------+
| Name      | char(16) | NO   |     | NULL    |       |
| RA        | float    | NO   |     | NULL    |       |
| DE        | float    | NO   |     | NULL    |       |
+-----------+----------+------+-----+---------+-------+

理想情况下我会是这样吗: SQL table in LaTeX (goal)

sql formatting latex
1个回答
0
投票
\documentclass{article}

\begin{document}

\begin{verbatim}
+-----------+----------+------+-----+---------+-------+
| Field     | Type     | Null | Key | Default | Extra |
+-----------+----------+------+-----+---------+-------+
| Name      | char(16) | NO   |     | NULL    |       |
| RA        | float    | NO   |     | NULL    |       |
| DE        | float    | NO   |     | NULL    |       |
+-----------+----------+------+-----+---------+-------+
\end{verbatim}

\end{document}

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.