如何在 Latex 中绘制对角线表格边框,就像在 Excel 中一样?
是否可以在LaTeX中绘制对角线(平行四边形)单元格:单元格内容是对角线,单元格原来垂直的边框也是对角线。
以下是我使用旋转包所做的事情:
\begin{tabular}{|r|c|c|}
\hline
\\ \\ \\ \\ \\ \\ \\ \\ \\ \\
& \begin{rotate}{45}Trying to save some horizontal space\end{rotate} & \begin{rotate}{45}While keeping headers readable\end{rotate} \\
\hline
this & is & a \\
\hline
sample & latex & table \\
\hline
\end{tabular}
这是输出的屏幕截图与使用 Excel 的可能结果:
Is it possible to draw diagonal (parallelogram) cells in LaTeX: the cell content is diagonal, and the cell's originally vertical borders are also diagonal.
Here is what I managed to do using the rotating package:
\begin{tabular}{|r|c|c|}
\hline
\\ \\ \\ \\ \\ \\ \\ \\ \\ \\
& \begin{rotate}{45}Trying to save some horizontal space\end{rotate} & \begin{rotate}{45}While keeping headers readable\end{rotate} \\
\hline
this & is & a \\
\hline
sample & latex & table \\
\hline
\end{tabular}
Here is a screenshot of the output vs what is possible using Excel:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答:LaTeX 常规表不具备该功能。
长答案:肯定可以做到,但需要付出更多努力,如 Tex.Stackexchange 中类似(但不完全相同)的问题所示:
Short answer: LaTeX regular tables don't have that capability.
Long answer: It can surely be done but with more effort, as shown by similar (but not quite the same) questions in Tex.Stackexchange: