我刚刚加入这个社区。
我已经通过在线课程学习 LaTeX 一段时间了,在此过程中我遇到了一个问题。但课程讲师似乎没有意识到这一点。我在下面给出了代码,抱歉它有点长。所以除了单个输出页面右下角的页码显示不正确之外,没有错误。如何修复此问题?文章类中没有问题。我使用了两个并排放置的图形图像供您参考。
\documentclass{proc}
\usepackage[margin=1in]{geometry}
\usepackage{multirow}
\usepackage{graphicx}
\graphicspath{{graphics/}}
\usepackage{caption, subcaption}
\title{More on Tables and Graphics}
\author{Some author}
\date{}
\begin{document}
\maketitle
\section{Introduction}
Here we'll look at more table and graphics formatting.
\subsection{More on Tables}
Table~\ref{tab:wrapping} uses text wrapping in the last column.
\begin{table}[htbp]
\caption{Text Wrapping}
\begin{center}
\begin{tabular}{| l | l | p{3cm} |}
\hline
CS101 & Java & Programming with Java\\
CS201 & Languages & Programming Language Principles\\
CS301 & Compilers & Principles of compilers design and implementation\\
\hline
\end{tabular}
\end{center}
\label{tab:wrapping}
\end{table}
Table~\ref{tab:multi} uses row and column span
\begin{table}[htbp]
\caption{Spanning rows and columns}
\begin{center}
\begin{tabular}{| l | c | c |}
\hline
& \multicolumn{2}{c |}{Ranges} \\
\cline{2-3}
& X & Y \\
\hline
\multirow{3}{*}{Hot} & 7 & 9 \\
& 5 & 8 \\
& 6 & 7 \\
\hline
\multirow{3}{*}{Cold} & 4 & 9 \\
& 2 & 8 \\
& 3 & 5 \\
\hline
\end{tabular}
\end{center}
\label{tab:multi}
\end{table}
\subsection{More on graphics}
Both of my graphics are in the graphics folder for the subfigures, Figure~\ref{fig:paper} and Figure~\ref{fig:page} in Figure~\ref{fig:subs}.
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.2\textwidth}
\centering
\includegraphics[scale=.5]{paper.png}
\caption{Beginning}
\label{fig:paper}
\end{subfigure}%
\begin{subfigure}[b]{0.2\textwidth}
\centering
\includegraphics[scale=.5]{page.png}
\caption{End}
\label{fig:page}
\end{subfigure}%
\caption{The process}
\label{fig:subs}
\end{figure}
\section{Conclusion}
Now I know more about tables and graphics.
\end{document}
答案1
该layout
包有助于显示边距和其他页面布局参数。
\documentclass{proc}
和之间存在差异\documentclass[twocolumn]{article}
,并且包含geometry
包时也存在差异。
该表总结了主要差异,前三列显示了影响垂直对齐的因素。
(需 \usepackage[footskip=30pt,top=125.3pt, textheight=550pt, right =1in, left=1in ]{geometry}
贴近文章+几何布局)
\documentclass[twocolumn]{文章}
\documentclass[twocolumn]{article} 加几何
\documentclass{proc}
\documentclass{proc} 加几何
当前页面的所有参数都可以从 LaTeX 文档中访问,无需额外的包。
% !TeX TS-program = pdflatex
\documentclass{proc}
\usepackage[margin=1in]{geometry}
\usepackage{layout} % show the layout of the page <<<<<<<<
\usepackage{multirow}
\usepackage{graphicx}
\graphicspath{{graphics/}}
\usepackage{caption, subcaption}
\title{More on Tables and Graphics}
\author{Some author}
\date{}
\begin{document}
\layout % show the layout of the page <<<<<<<<<<
\maketitle
\section{Introduction}
Here we'll look at more table and graphics formatting.
\subsection{More on Tables}
Table~\ref{tab:wrapping} uses text wrapping in the last column.
\begin{table}[htbp]
\caption{Text Wrapping}
\begin{center}
\begin{tabular}{| l | l | p{3cm} |}
\hline
CS101 & Java & Programming with Java\\
CS201 & Languages & Programming Language Principles\\
CS301 & Compilers & Principles of compilers design and implementation\\
\hline
\end{tabular}
\end{center}
\label{tab:wrapping}
\end{table}
Table~\ref{tab:multi} uses row and column span
\begin{table}[htbp]
\caption{Spanning rows and columns}
\begin{center}
\begin{tabular}{| l | c | c |}
\hline
& \multicolumn{2}{c |}{Ranges} \\
\cline{2-3}
& X & Y \\
\hline
\multirow{3}{*}{Hot} & 7 & 9 \\
& 5 & 8 \\
& 6 & 7 \\
\hline
\multirow{3}{*}{Cold} & 4 & 9 \\
& 2 & 8 \\
& 3 & 5 \\
\hline
\end{tabular}
\end{center}
\label{tab:multi}
\end{table}
\subsection{More on graphics}
Both of my graphics are in the graphics folder for the subfigures, Figure~\ref{fig:paper} and Figure~\ref{fig:page} in Figure~\ref{fig:subs}.
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.2\textwidth}
\centering
\includegraphics[scale=.2]{example-image}
\caption{Beginning}
\label{fig:paper}
\end{subfigure}%
\begin{subfigure}[b]{0.2\textwidth}
\centering
\includegraphics[scale=.2]{example-image}
\caption{End}
\label{fig:page}
\end{subfigure}%
\caption{The process}
\label{fig:subs}
\end{figure}
\section{Conclusion}
Now I know more about tables and graphics.
\vspace*{60pt}
footskip = \the\footskip
topmargin = \the\topmargin
textheight =\the\textheight
textwidth = \the\textwidth
marginparwidth = \the\marginparwidth
columnsep = \the\columnsep
\end{document}