按照我在此处的帖子,我如何使用该命令:
\resizebox{\linewidth}{!}{...}
将表格放置在文本边距稍微外面一点的位置?
编辑:
目前,这对我来说很好。我唯一的问题是高度会相应地改变,这是我不想要的。
\documentclass[12pt,a4paper]{article}
\usepackage{setspace}
\spacing{1.5}
% \raggedright
\usepackage[margin=1.3in]{geometry}
\usepackage[polutonikogreek,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{textalpha}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage{color}
\usepackage{soul}
\usepackage{adjustbox}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\greek}[1]{{\selectlanguage{polutonikogreek}#1}}
\begin{document}
\section{Introduction}
\begin{table}[H]
\begin{adjustbox}{width=1.3\textwidth,center}
\begin{tabular}{ll}
\hline
\multicolumn{2}{c}{\head{Fuels}} \\
\hline
\multicolumn{1}{l}{\head{Name}} & \multicolumn{1}{l}{\head{Numbes}} \\
\hline
\ttfamily XXXXXXXXXX & \ttfamily XXX \\
\ttfamily XXXXXXXXXX & \ttfamily XXX \\
\hline
\end{tabular}
\end{adjustbox}
\caption{Selected fuels}
\label{tab:SelectedFuels}
\end{table}
\end{document}
答案1
以下是一些可能性。
\documentclass{article}
\usepackage[left=3in,right=3in,showframe]{geometry}
%\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{adjustbox}
\begin{document}
\noindent\resizebox{\linewidth}{!}{%
\begin{tabular}{|c|c|c|c|c|}
\hline
some thing & some thing & some thing & some thing & some thing \\
\hline
\end{tabular}%
}%
\begin{adjustbox}{width=1.2\textwidth,center}
\begin{tabular}{|c|c|c|c|c|}
\hline
some thing & some thing & some thing & some thing & some thing \\
\hline
\end{tabular}
\end{adjustbox}
\begin{adjustbox}{max width=\textwidth,center}
\begin{tabular}{|c|c|c|c|c|}
\hline
some thing & some thing & some thing & some thing & some thing \\
\hline
\end{tabular}
\end{adjustbox}
\noindent\makebox[\textwidth]{%
\resizebox{1.2\linewidth}{!}{%
\begin{tabular}{|c|c|c|c|c|}
\hline
some thing & some thing & some thing & some thing & some thing \\
\hline
\end{tabular}%
}%
}%
\end{document}
答案2
根据评论中的讨论,我认为您想要将两个表设置为相同的宽度:
\documentclass[12pt,a4paper]{article}
\usepackage{setspace}
\usepackage[margin=1.3in]{geometry}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\begin{document}
\section{Introduction}
\noindent X\dotfill X
\noindent X\dotfill X
\begin{table}[hpt]
\centering
\begin{tabular*}{.7\textwidth}{|@{\extracolsep{\fill}}ll@{}|}
\hline
\multicolumn{2}{c}{\head{Fuels}} \\
\hline
\multicolumn{1}{l}{\head{Name}} & \multicolumn{1}{l}{\head{Numbes}} \\
\hline
\ttfamily XXXXXXXXXX & \ttfamily XXX \\
\ttfamily XXXXXXXXXX & \ttfamily XXX \\
\hline
\end{tabular*}
\caption{Selected fuels}
\label{tab:SelectedFuels}
\end{table}
\noindent X\dotfill X
\begin{table}[hpt]
\centering
\begin{tabular*}{.7\textwidth}{|@{\extracolsep{\fill}}ll@{}|}
\hline
\multicolumn{2}{c}{\head{Fuels}} \\
\hline
\multicolumn{1}{l}{\head{Name}} & \multicolumn{1}{l}{\head{Numbes}} \\
\hline
\ttfamily XXXXXXX & \ttfamily XXX \\
\ttfamily XXXXXXX & \ttfamily XXXYYYY \\
\hline
\end{tabular*}
\caption{Selected fuels2}
\label{tab:SelectedFuels2}
\end{table}
\end{document}
注意我改成了[H]
,[hpt]
因为我可以有权威地说(我是第一个实现它的人),这[H]
通常是一个糟糕的选择。我还删除了该\spacing
命令,因为它会在文档末尾生成错误,因为它启动了一个组但没有关闭它。我认为它旨在用作环境,\begin{spacing}..\end{spacing}
但没有检查setspace
文档。