删除页面上的垂直空间

删除页面上的垂直空间

我正在尝试删除页面上的垂直空白区域。我尝试过此解决方案(减少文本和表格之间的垂直空间并删除表格缩进),但是没有作用。

这是我的 MWE:

\documentclass[12pt,a4paper]{report}
\usepackage{graphicx}
\begin{document}
\chapter{Securities Activities Licensed}
The Capital Market Law provides a mechanism for licensing the following activities
\begin{enumerate}
\item advising; 
\item arranging; 
\item managing; and 
\item custody
\end{enumerate}
\vspace{-1cm}
\begin{table}
\centering
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|c|c|c|c|}
\hline
\begin{tabular}[c]{@{}l@{}}Activity/\\ Type of Company
\end{tabular}
\end{tabular}}
\end{table}




\end{document}

至于第二点,我不确定 \tablularx 是否是解决方案:

桌子

使用此代码(在序言中添加 tabularx 包之后:

    \begin{table}[ht!]
    \centering
    \begin{tabularx}{\textwidth}{|l|X|X|X|X|}

    \hline
    \begin{tabular}[c]{@{}l@{}}Activity/\\ Type of Company\end{tabular}                                                      & \multicolumn{1}{l|}{Custody} & \multicolumn{1}{l|}{Dealing} & \multicolumn{1}{l|}{Managing} & \multicolumn{1}{l|}{Arranging/Advising} \\ 
    \hline
Joint Stock Company                                                                                                      & X                            & X                            & X                             & X                                       \\ \hline
Local Bank Subsidiary                                                                                                    & X                            & X                            & X                             & X                                       \\ \hline
Saudi Joint Stock Company                                                                                                & X                            & X                            & X                             & X                                       \\ \hline
    \begin{tabular}[c]{@{}l@{}}Subsidiary of foreign financial institution licensed\\ under Banking Control law\end{tabular} & X                            & X                            & X                             & X                                       \\ 
    \hline
Any other legal entity                                                                                                   &                              &                              &                               & X                                       \\ 
    \hline
    \end{tabularx}
    \end{table}

答案1

表格环境是 a float,其位置将由 LaTeX 选择。您可以建议h使用可选参数(如(here)、t(top)、b(bottom))将 LaTeX 放置在您想要的位置。这!使得 LateX 忽略其他限制,如页面上的浮点数等。它们的顺序无关紧要。

微调表格和图形的位置简短解释和/或 关于花车放置的完整历史以获得完整的。

因此,作为浮动项,\vspace其后的项目不会对其最终位置产生任何影响。

和你的问题无关。

问题在于resizebox它会改变字体大小。

如果您想要一个使用完整行宽的表格,一种可能就是使用tabularx包。X ​​列将适应其宽度以实现此目的。

A

\documentclass[11pt,a4paper]{report}

\usepackage{graphicx}

\usepackage{tabularx} % added <<<<<<<<<<<<
\newcolumntype{Y}{>{\centering\arraybackslash}X} % centered X column

\begin{document}
    \chapter{Securities Activities Licensed}
    The Capital Market Law provides a mechanism for licensing the following activities
    \begin{enumerate}
        \item advising; 
        \item arranging; 
        \item managing; and 
        \item custody
    \end{enumerate}
    
    \begin{table}[!ht]
        \centering
        \caption{Using \texttt{tabularx}}
            \begin{tabularx}{\textwidth}{|l|X|X|X|X|}
                \hline
                \begin{tabular}{l}
                    Activity/\\ Type of Company
                \end{tabular}  & zz & zz & zz \\ \hline         
        \end{tabularx}
    \end{table}
    
        \begin{table}[!ht]
        \centering
        \caption{Using \texttt{tabularx} and centered columns}
        \begin{tabularx}{\textwidth}{|l|Y|Y|Y|Y|}
            \hline
            \begin{tabular}{>{\Large\bfseries}l}
                Activity/\\ Type of Company
            \end{tabular}  & zz & zz & zz \\ \hline         
        \end{tabularx}

    \end{table}
    
    \begin{table}
        \centering
        \caption{Using \texttt{resizebox} changes the font size}
        \resizebox{\textwidth}{!}{
            \begin{tabular}{|l|c|c|c|c|}
                \hline
                \begin{tabular}[c]{@{}l@{}}Activity/\\ Type of Company
                \end{tabular} 
        \end{tabular}}
    \end{table} 
    
\end{document}

更新在后续问题之后。

b

尝试一下这个代码。

\documentclass[11pt,a4paper]{article}

\usepackage[left=3.00cm, right=3.00cm, top=4.00cm, bottom=3.00cm]{geometry}

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X} % centered X column

\begin{document}
    
     \begin{table}[ht!]
        \centering
        \setlength{\extrarowheight}{4pt}% extra row separation <<<%
        \begin{tabularx}{\textwidth}{|l|Y|Y|Y|Y|}                       
            \hline
            \begin{tabular}[c]{@{}l}Activity/\\ Type of Company\end{tabular}   & Custody & Dealing & Managing 
            &\begin{tabular}{c} Arranging/ \\ Advising\end{tabular} \\ \hline   
            Joint Stock Company                 & X & X & X & X     \\ \hline
            Local Bank Subsidiary               & X & X & X & X     \\ \hline
            Saudi Joint Stock Company           & X & X & X & X     \\ \hline
            \begin{tabular}[c]{@{}l@{}}Subsidiary of foreign \\ financial institution licensed\\ under Banking Control law\end{tabular}
                                                & X & X & X & X     \\ \hline
            Any other legal entity              &   &   &   & X     \\ \hline
        \end{tabularx}
    \end{table} 
    
\end{document}

相关内容