请看下表。第二列中的部分文本是斜体,并且文本被拆分以适合列宽。
我使用了以下 tex 代码,但它生成的表格未居中且位于右侧页面边框之外(见图 2)。
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabularx}{0.7\textwidth}{llll}
\hline
\multirow{2}{*}{\textbf{S\#}} & \multicolumn{2}{c}{\textbf{Required Input}} & \multirow{2}{*}{\textbf{Output}} \\ \cline{2-3}
& \textbf{1-level} & \textbf{2-level} & \\ \hline
E-call (EC) & Vehicle information, e.g., type and id, vehicle location,\\ \textit{freight information, e.g., type and amount.} & Any output here. \\ \hline
\end{tabularx}
\end{table}
答案1
不确定你尝试了什么,但以下内容应该可以生成斜体文本。
\documentclass[border=1pt]{standalone}%{article}
\usepackage{tabularx}
\begin{document}
\begin{center}
%% Be sure to select the desired width of the "tabularx" environment
\begin{tabularx}{0.7\textwidth}[c]{@{}X@{}}
Vehicle information, e.g., type and id, vehicle location,
\textit{freight information, e.g., type and amount.}\\
\end{tabularx}
\end{center}
\end{document}
生成大胆的文本,使用\textbf{...}
; 来生成加粗斜体文本,使用\textbf{\textit{...}}
。