Latex-Tabelle komprimiert und zu klein

Latex-Tabelle komprimiert und zu klein

Entschuldigung, ich bin neu bei Latex. Ich versuche, eine Tabelle zu erstellen, aber sie kommt komprimiert. Die ganze Tabelle ist etwa 3 cm hoch. Ich möchte, dass die Tabelle im Hochformat auf einem A4-Blatt gut lesbar ist. Bitte helfen Sie.

\begin{table}[h!]
\caption{MRMC Requested Benchmarking Tests}
\label{BT2}
\resizebox{\textwidth}{!}{%
\begin{tabular}{*{14}{|c}|}%{|l|l|l|l|l|}\hline

\multicolumn{1}{|c|}{\textbf{S No.}} & \multicolumn{1}{c|}{\textbf{Test Description}}                      & \multicolumn{1}{c|}{\textbf{High Level Steps}}                                                                                                                   & \multicolumn{1}{c|}{\textbf{Expected Output}}                                                                                                   & \multicolumn{1}{c|}{\textbf{PQA Status}}                                                                                                              \\ \hline
1                                    & Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR & a)Take the available complete IHC portfolio.b)Obtain the same COB production 10 Day VaRc)Ensure trade population and notional match betweenTCM data and VaR data & 10 Day VaR should be lower and account for the gap risk in CVA Closeout                                                                         & This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\ \hline
2                                    & Same trade Stressed CVA vs CVA Closeout                             & a)Choose a swap with one year maturity. b)Apply both methodologies on the swap. c)Plot the exposure profile on a graph                                           & For Swap the profile should be forward declining slope and in case of CVA closeout there should be a spike post the 1 year mark.                & The same result can be implied from already run test cases.                                                                                           \\ \hline
3                                    & Same trade Stressed CVA vs CVA Closeout                             & a)Choose an option with one year maturity. b)Apply both methodologies on the swap. c)Plot the exposure profile on a graph                                        & For option it should be a straight line for both Stressed CVA and CVA Closeout. Just that for CVA closeout there should be a spike post expiry. & The same result can be implied from already run test cases.                                                                                           \\ \hline
4                                    & Swap with IM and without IM                                         & a)Take one year swap and run it with IM.b)Take the same swap and run it without IM. Note: Please use CVA closeout model in both cases.                           & With IM graph should start higher, converging into without IM towards expiry.                                                                   & The same result can be implied from already run test cases.                                                                                           \\ \hline
\end{tabular}%
}
\end{table}

Danke und Grüße Varun

Antwort1

ich würde deine Tabelle neu gestalten:

Bildbeschreibung hier eingeben

\documentclass{article}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}
    \begin{table}[htb]
\caption{MRMC Requested Benchmarking Tests}
\label{BT2}
    \footnotesize
    \setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{} l
              >{\hsize=0.8\hsize}L
              >{\hsize=1.2\hsize}L
                            *{2}{L}
                @{}}
    \toprule
\thead[b]{S\\ No.}
    &   \thead{Test Description}
        &   \thead{High Level Steps}
            &   \thead{Expected Output}
                &   \thead{PQA Status}             \\
    \midrule
1  & Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR
        & a) Take the available complete IHC portfolio.\quad
          b) Obtain the same COB production 10 Day VaRc). Ensure trade population and notional match between TCM data and VaR data
            & 10 Day VaR should be lower and account for the gap risk in CVA Closeout
                & This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\
    \addlinespace
2  & Same trade Stressed CVA vs CVA Closeout
        & a) Choose a swap with one year maturity. \quad
          b) Apply both methodologies on the swap. \quad
          c) Plot the exposure profile on a graph.
            & For Swap the profile should be forward declining slope and in case of CVA closeout there should be a spike post the 1 year mark.
                & The same result can be implied from already run test cases.               \\
    \addlinespace
3   & Same trade Stressed CVA vs CVA Closeout
        & a) Choose an option with one year maturity. \quad
          b) Apply both methodologies on the swap. \quad
          c) Plot the exposure profile on a graph
            & For option it should be a straight line for both Stressed CVA and CVA Closeout. Just that for CVA closeout there should be a spike post expiry.
                & The same result can be implied from already run test cases.               \\
    \addlinespace
4   & Swap with IM and without IM
        & a)Take one year swap and run it with IM. \quad
          b) Take the same swap and run it without IM.
          Note: Please use CVA closeout model in both cases.
            & With IM graph should start higher, converging into without IM towards expiry.
                & The same result can be implied from already run test cases.               \\
    \bottomrule
\end{tabularx}%
    \end{table}
\end{document}

bearbeitet:unter Berücksichtigung der gegebenen VorschlägeAbonnierenAntwort, aber mit verbessertem Code kann die Tabelle wie folgt aussehen:

\documentclass{article}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}

\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{table}{%
\setlist[enumerate]{nosep, % <-- list setup used in all tables
                     topsep = 0pt,
                     partopsep = 0pt,
                     wide,
                     label=\alph*),
                     before = \vspace{-0.6\baselineskip},
                     }
                        }
\begin{document}
    \begin{table}[htb]
\caption{MRMC Requested Benchmarking Tests}
\label{BT2}
    \footnotesize
    \setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{} l
              >{\hsize=0.8\hsize}L
              >{\hsize=1.2\hsize}L
                            *{2}{L}
                @{}}
    \toprule
\thead[b]{S\\ No.}
    &   \thead{Test Description}
        &   \thead{High Level Steps}
            &   \thead{Expected Output}
                &   \thead{PQA Status}             \\
    \midrule
1  & Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR
        & \begin{enumerate} 
            \item   Take the available complete IHC portfolio.
            \item   Obtain the same COB production 10 Day VaRc). 
          \end{enumerate}
          Ensure trade population and notional match between TCM data and VaR data
            & 10 Day VaR should be lower and account for the gap risk in CVA Closeout
                & This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\
    \addlinespace
2  & Same trade Stressed CVA vs CVA Closeout
        & \begin{enumerate}
            \item   Choose a swap with one year maturity. 
            \item   Apply both methodologies on the swap. 
            \item   Plot the exposure profile on a graph.
          \end{enumerate}  
            & For Swap the profile should be forward declining slope and in case of CVA closeout there should be a spike post the 1 year mark.
                & The same result can be implied from already run test cases.               \\
    \addlinespace
3   & Same trade Stressed CVA vs CVA Closeout
        & \begin{enumerate}
            \item   Choose an option with one year maturity.
            \item   Apply both methodologies on the swap. 
            \item   Plot the exposure profile on a graph
          \end{enumerate}  
            & For option it should be a straight line for both Stressed CVA and CVA Closeout. Just that for CVA closeout there should be a spike post expiry.
                & The same result can be implied from already run test cases.               \\
    \addlinespace
4   & Swap with IM and without IM
        & \begin{enumerate}
            \item   Take one year swap and run it with IM.
            \item   Take the same swap and run it without IM.
          \end{enumerate}  
          Note: Please use CVA closeout model in both cases.
            & With IM graph should start higher, converging into without IM towards expiry.
                & The same result can be implied from already run test cases.               \\
    \bottomrule
\end{tabularx}
    \end{table}
\end{document}

Das Ergebnis ist:

Bildbeschreibung hier eingeben

Antwort2

Ich habe ein paar kleine Änderungen vorgenommen.

  • Ich habe die 14 Spalten entfernt, die Sie hatten. Sie verwenden nur 4.

  • Ich habe die Breite der ersten Spalte angepasst auf1cm

  • Ich habe die Zellengröße fest auf eingestellt (\textwidth-1cm)/4.

  • Ich habe das entfernt \resizeboxund die Schriftgröße manuell mit geändert \footnotesize. Ändern Sie dies nach Belieben.

  • Ich habe sie entfernt, \multicolumnsda Sie sie nicht wirklich verwendet haben.

Bildbeschreibung hier eingeben

\documentclass{article}

\usepackage{graphicx}

\begin{document}
\begin{table}[h!]
\caption{MRMC Requested Benchmarking Tests}
\label{BT2}
\footnotesize
% \resizebox{\textwidth}{!}{%
\begin{tabular}{|p{1cm}*{4}{|p{\dimexpr(\textwidth-1cm)/4\relax}}|}%{|l|l|l|l|l|}
\hline

\textbf{S No.} & \textbf{Test Description}                      & \textbf{High Level Steps}                                                                                                                   & \textbf{Expected Output}                                                                                                   & \textbf{PQA Status}                                                                                                              \\ \hline
1                                    & Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR & a)Take the available complete IHC portfolio.b)Obtain the same COB production 10 Day VaRc)Ensure trade population and notional match betweenTCM data and VaR data & 10 Day VaR should be lower and account for the gap risk in CVA Closeout                                                                         & This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\ \hline
2                                    & Same trade Stressed CVA vs CVA Closeout                             & a)Choose a swap with one year maturity. b)Apply both methodologies on the swap. c)Plot the exposure profile on a graph                                           & For Swap the profile should be forward declining slope and in case of CVA closeout there should be a spike post the 1 year mark.                & The same result can be implied from already run test cases.                                                                                           \\ \hline
3                                    & Same trade Stressed CVA vs CVA Closeout                             & a)Choose an option with one year maturity. b)Apply both methodologies on the swap. c)Plot the exposure profile on a graph                                        & For option it should be a straight line for both Stressed CVA and CVA Closeout. Just that for CVA closeout there should be a spike post expiry. & The same result can be implied from already run test cases.                                                                                           \\ \hline
4                                    & Swap with IM and without IM                                         & a)Take one year swap and run it with IM.b)Take the same swap and run it without IM. Note: Please use CVA closeout model in both cases.                           & With IM graph should start higher, converging into without IM towards expiry.                                                                   & The same result can be implied from already run test cases.                                                                                           \\ \hline
\end{tabular}%
% }
\end{table}
\end{document}

Antwort3

Ein anderer Ansatz unter Verwendung tabularxder enumerateUmgebung:

\documentclass{article}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{enumerate}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}

\begin{document}

\begin{table}[h!]
\caption{MRMC Requested Benchmarking Tests}
\label{BT2}
\begin{tabularx}{\textwidth}{cYYYY}

\textbf{S No.} & \textbf{Test Description} & \textbf{High Level Steps}                                                                                                           & \textbf{Expected Output}                                                                                                 & \textbf{PQA Status} \\ \midrule
1                                    
& Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR 
& \begin{enumerate}[a)]\vspace*{-1.5\baselineskip}
   \item Take the available complete IHC portfolio.
   \item Obtain the same COB production 10 Day VaR
   \item Ensure trade population and notional match betweenTCM data and VaR data 
   \end{enumerate}
   & 10 Day VaR should be lower and account for the gap risk in CVA Closeout
& This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\  \midrule
\end{tabularx}%
\end{table}
\end{document}

Antwort4

Hier ist eine weitere tabularx-basierte Lösung: Sie verwendet den lSpaltentyp für die erste Spalte und modifizierte XSpalten für die vier Datenspalten. Sie verzichtet auf alle vertikalen Linien und verwendet nur wenige, aber gut verteilte horizontale Linien. Beachten Sie, dass Leerzeichen genauso effektiv sein können wie eine feste Linie, um eine visuelle Trennlinie zu erstellen. Der Inhalt jeder Zelle wird rechtsbündig statt rechtsbündig gesetzt, wobei Silbentrennung möglich ist. ~Bei Bedarf werden Haltebögen ( ) eingefügt, um falsche Zeilenumbrüche in den zweiten Datenspalten zu verhindern. Schließlich schlage ich vor, diefettgedrucktaus der Kopfzeile, da es nicht wirklich benötigt wird.

Bildbeschreibung hier eingeben

\documentclass{article}
\usepackage[english]{babel}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page parameters suitably
\usepackage{tabularx,booktabs,caption,ragged2e}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\begin{document}
\begin{table}[ht!]
\setlength\tabcolsep{4pt} % default is 6pt
\captionsetup{skip=0.333\baselineskip}
\caption{MRMC Requested Benchmarking Tests} \label{BT2}
\begin{tabularx}{\textwidth}{@{} l *{4}{Y} @{}}
\toprule
S No. & Test Description & High-Level Steps & Expected Output & PQA Status\\ 
\midrule
1 & Comparison of complete IHC portfolio aggregated TCM with 10-Day VaR 
  & a) Take the available complete IHC portfolio. b)~Obtain the same COB production 10~Day VaR\@. c)~Ensure trade population and notional match between TCM data and VaR data 
  & 10~Day VaR should be lower and account for the gap risk in CVA Closeout
  & This test was deemed unfit as variance between VaR and CVA Closeout can be because of various reasons like difference in choice of risk factors, etc. \\ 
\addlinespace
2 & Same trade Stressed CVA vs CVA Closeout
  & a) Choose a swap with one year maturity. b)~Apply both methodologies on the swap. c)~Plot the exposure profile on a graph 
  & For Swap the profile should be forward declining slope and in case of CVA closeout there should be a spike post the 1 year mark. 
  & The same result can be implied from already-run test cases. \\ 
\addlinespace
3 & Same trade Stressed CVA vs CVA Closeout
  & a) Choose an option with one year maturity. b)~Apply both methodologies on the swap. c)~Plot the exposure profile on a graph 
  & For option it should be a straight line for both Stressed CVA and CVA Closeout. Just that for CVA closeout there should be a spike post expiry. 
  & The same result can be implied from already-run test cases.\\ 
\addlinespace
4 & Swap with IM and without IM 
  & a) Take one year swap and run it with~IM\@. b)~Take the same swap and run it without~IM\@. Note: Please use CVA closeout model in both cases.
  & With IM graph should start higher, converging into without IM towards expiry.
  & The same result can be implied from already-run test cases.\\ 
\bottomrule
\end{tabularx}
\end{table}
\end{document}

verwandte Informationen