我遇到了一些格式问题。目前,我的代码如下所示:
\documentclass[titlepage]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{color}
% Adjust margins
\addtolength{\oddsidemargin}{-.75in}
\addtolength{\evensidemargin}{-.75in}
\addtolength{\textwidth}{1.5in}
\addtolength{\topmargin}{-.75in}
\addtolength{\textheight}{1.5in}
\begin{document}
\begin{wrapfigure}{L}{.2\textwidth}
\rule{1cm}{5cm}
\end{wrapfigure}
\quad Figure~\ref{fig:measTool} is a zoomed in version of the measurement toolbar, the other primary toolbar that
will be used during simulations. Here, instead of picking components like resistors and operational amplifiers, you
will find primarily measurement tools.
\begin{table}[h]
\centering
\caption{Descriptions of Measurement Toolbar Options}
\label{tab:measToolTab}
\begin{tabular}{clc} \toprule
Color & Label & Description \\ \midrule
\color{red} Red & \color{red} Multimeter & Primarily used to measure DC current, voltage, \\
& & and resistance. \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
可以看出,表格没有在文本下方居中,而是与整个页面居中。我想知道如何移动表格以使其与文本居中?
答案1
您想要下面这样的东西吗?
这只是用minipage
s 完成的。我还替换了geometry
,这比手动设置页面尺寸要好,但你应该根据自己的需求进行调整。
\documentclass[titlepage]{article}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage[verbose]{geometry}
\geometry{margin=0.75in}
\begin{document}
\noindent
\begin{minipage}{.2\textwidth}
\centering
\rule{1cm}{5cm}
\captionof{figure}{My rule}\label{fig:measTool}
\end{minipage}%
\begin{minipage}{.8\textwidth}
\quad Figure~\ref{fig:measTool} is a zoomed in version of the measurement toolbar, the other primary toolbar that will be used during simulations.
Here, instead of picking components like resistors and operational amplifiers, you will find primarily measurement tools.
\begin{center}
\captionof{table}{Descriptions of Measurement Toolbar Options}
\label{tab:measToolTab}
\begin{tabular}{clc} \toprule
Color & Label & Description \\ \midrule
\color{red} Red & \color{red} Multimeter & Primarily used to measure DC current, voltage, \\
& & and resistance. \\ \bottomrule
\end{tabular}
\end{center}
\end{minipage}
\end{document}