0

I am trying to remove blank vertical space on a page. I tried this solution (Reduce vertical space between text and table and remove table indentation) but it didn't work.

Here is my 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}

As to the second point, I'm not sure \tablularx is the solution:

table

using this code (after adding tabularx package in the preamble:

    \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}
2
  • Use \begin{table}[ht!] (\vspace{-1cm} is not necessary). Commented Nov 18, 2021 at 13:27
  • Make this as an answer and I'll mark it solved, But I don't know why \vspace doesn't work, nor the meaning of the [h!] option. I'd like to know.
    – user26732
    Commented Nov 18, 2021 at 14:09

1 Answer 1

0

The table environment is a float and its place will be chosen by LaTeX. You can suggest to LaTeX the place you want using optionals parameters like h (here), t (top), b (bottom). The ! makes LateX ignore other restrictions like the number of floats on the page, etc. Their order does not matter.

See fine tune the placement of tables and figures for a short explanation and/or the full history on floats placement for a complete one.

So by being a float the \vspace after the items will not have any effect whatsoever over its final position.

Not related with your question.

The problem with resizebox is that it changes font sizes.

If you want a table that uses the full line width, one possibility is the tabularx package. The X columns will accommodate their width to achieve that.

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}

UPDATE after follow up question.

b

Try this code.

\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}
2
  • I'm not sure tabularx is the solution, the table still runs off the page. I can't post images here, I have to link to them: imgur.com/a/IK5d8Nd
    – user26732
    Commented Nov 19, 2021 at 14:39
  • @user26732 I added an update to the answer, now it deals with tabularx. Commented Nov 19, 2021 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .