1

The problem here is that in the third column of this table, there is suddenly extra space between the words. I have no clue why this happens. Someone who can help me out?

Other improvements are also welcome of course; I am still learning latex.

MWE:

\documentclass[11pt]{article}
\usepackage[
textwidth=155mm,
top=23.5mm,
bottom=23.5mm,
footskip=40pt,
heightrounded,
]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern} % math & rm
\usepackage{microtype}
\usepackage{threeparttable}
\usepackage{threeparttablex} %
\usepackage[table,xcdraw]{xcolor}
\usepackage[skip=0.33\baselineskip]{caption}
\usepackage{array}
\usepackage{booktabs,makecell}
\usepackage{tabularx}
\begin{document}
\begin{table}[H]
    \caption{List of variables}

    \begin{threeparttable}
    \renewcommand{\arraystretch}{1.3}

        \begin{tabular}{l p{7cm} p{3cm} p{2cm}} %%zxqdcolumn
            \toprule 
            \multicolumn{1}{l}{Variable}  &  \multicolumn{1}{l}{Explanation}  & 
            \multicolumn{1}{l}{Measure of} &  \multicolumn{1}{l}{Source} \\
            \midrule

            \multicolumn{4}{c}{\textbf{Dependent variables}} \\
            \rule{0pt}{1ex}

            $Y^n_{eu,t}$ &  Yield on a 10-year zero coupon government bond of an eurozone country in the sample  & & Datastream \\
            $Y^n_{us,t}$ &  Yield on the 10-year US zero coupon government bond & & Datastream \\
            $R^n_{eu,t}$ &  10-year Overnight Index Swap rate of the EU & & Datastream \\
            $R^n_{us,t}$ &  10-year Overnight Index Swap rate of the US & & Bloomberg
             \\\multicolumn{4}{c}{\textbf{Control variables}} \\
        \rule{0pt}{1ex}
            $VSTOXX$ & Implied volatility of near term options on the EuroStoxx 50 index (eurozone equivalent of the VIX) & Euro-area risk aversion &  Datastream \\
            $CDS$ & 10-year credit default swap of an eurozone country in the sample. Defined in Datastream as ''the mid-rate spread between the entity and the relevant benchmark curve'' & Country specific credit risk &  Datastream \\
             $Redom$ & Redenomination risk. Calculated as the difference between the 5-year CDS of an eurozone country  dominated in dollars minus the 5-year CDS  dominated in Euro of that same country (this is called the quanto CDS), and quanto CDS of Germany ($Qcds_{t}$-$Qcds_{t_{Ger}}$) & Redenomination risk & Bloomberg \\
            $CESI_{j}$ &  The Citigroup Economic Surprise Index (CESI) measures the surprise content of the release of macroeconomic and fiscal news (not monetary policy news) on a daily basis. A positive value indicates a positive surprise. $j \in us,eu$.  & Macro-economic news & Datastream \\
            $ECB$ & Impulse dummies which equal 1 on ECB UMP announcement days and 0 otherwise. See also Table A.2 in Appendix A.2. & UMP announcements of the ECB &  ECB website \\
            \bottomrule
    \end{tabular}
\begin{tablenotes}[para,flushleft]\scriptsize{
    \item \textbf{Notes}: Rates and yields are measured in basis points. The variables $Y^n_{eu,t}$, $CDS$, $BAS$ and $Redom$ are collected for each eurozone country in the sample. The other  variables  are time-series observations.}
\end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}
  • What happens if you replace p{3cm} with >{\raggedright\arraybackskash}p{3cm} and recompile? – Mico Jan 16 '17 at 23:01
4

Main suggestion:

  • To suppress full justification of the material in the third column, replace p{3cm} with >{\raggedright\arraybackslash}p{3cm}.

Further suggestions, made in no particular order:

  • Suppress full justification in the second column as well. To allow hyphenation of words in columns 2 and 3, load the ragged2e package and specify \RaggedRight instead of \raggedright.

  • There's no need to the multitude of \multicolumn{1}{l}{...} wrappers.

  • There seems to be no need for a threeparttable setup.

  • Don't write VSTOXX in direct math mode -- TeX will interpret it as the procuct of the varibles V, S, T, O, X, and X. I suggest you set up a helper macro called, say, \vname -- short for "variable name" -- as follows

    \newcommand{\vname}[1]{\mathrm{#1}} % or: \mathit
    

    and encase all variable names in \vname wrappers.

  • Use a l column type for the final column.

  • Don't use bold for the two intermediate headers, and left-align them instead of centering them.

  • Use a tabular* environment instead of a tabular environment, and set width of the tabular* to \textwidth.

  • Don't use the H placement specifier for the table environment -- it's virtually guaranteed to create a great big gaping hole on the page that precedes the table. Instead, use the p placement specifier, to place it on a page all by itself.

Here's what your table looks like if all of the preceding suggestions are implemented:

enter image description here

\documentclass[11pt]{article}
% I've simplified preamble to bare minimum
\usepackage[textwidth=155mm,vmargin=23.5mm, footskip=40pt,
            heightrounded]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern} 
\usepackage{microtype}
\usepackage[skip=0.33\baselineskip]{caption}
\usepackage{booktabs,array,ragged2e}
\newcommand{\vname}[1]{\mathrm{#1}} % or: \mathit
\begin{document}

\begin{table}[p] % not "H"!
\renewcommand{\arraystretch}{1.3}
\setlength{\tabcolsep}{0pt} % let LaTeX figure out intercolumn whitespace
\caption{List of variables}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} 
     l 
     >{\RaggedRight\arraybackslash}p{7cm} 
     >{\RaggedRight\arraybackslash}p{3cm} 
     l} 
\toprule 
Variable & Explanation & Measure of & Source \\
\midrule
\multicolumn{4}{l}{Dependent variables} \\
$Y^n_{eu,t}$ & Yield on a 10-year zero coupon government bond of a eurozone country in the sample & & Datastream \\
$Y^n_{us,t}$ & Yield on the 10-year US zero coupon government bond & & Datastream \\
$R^n_{eu,t}$ & 10-year Overnight Index Swap rate of the EU & & Datastream \\
$R^n_{us,t}$ & 10-year Overnight Index Swap rate of the US & & Bloomberg \\
\addlinespace
\multicolumn{4}{l}{Control variables} \\
$\vname{VSTOXX}$   & Implied volatility of near term options on the EuroStoxx 50 index (eurozone equivalent of the VIX) & Euro-area risk aversion &  Datastream \\
$\vname{CDS}$      & 10-year credit default swap of an eurozone country in the sample. Defined in Datastream as ``the mid-rate spread between the entity and the relevant benchmark curve'' & Country specific credit risk &  Datastream \\
$\vname{Redom}$    & Redenomination risk. Calculated as the difference between the 5-year CDS of an eurozone country  dominated in dollars minus the 5-year CDS  dominated in Euro of that same country (this is called the quanto CDS), and quanto CDS of Germany ($\vname{Qcds}_{t}-\vname{Qcds}_{t_{\vname{Ger}}}$) & Redenomination risk & Bloomberg \\
$\vname{CESI}_{j}$ & The Citigroup Economic Surprise Index ($\vname{CESI}$) measures the surprise content of the release of macroeconomic and fiscal news (not monetary policy news) on a daily basis. A positive value indicates a positive surprise. $j\in\{us,eu\}$.  & Macroeconomic news & Datastream \\
$\vname{ECB}$      & Impulse dummies which equal $1$ on ECB UMP announcement days and~$0$ otherwise. See also Table A.2 in Appendix~A.2. & UMP announcements of the ECB &  ECB website \\
\bottomrule
\addlinespace
\end{tabular*}

\footnotesize
\textbf{Notes} Rates and yields are measured in basis points. The variables $Y^n_{eu,t}$, $\vname{CDS}$, $\vname{BAS}$ and $\vname{Redom}$ are collected for each eurozone country in the sample. The other  variables  are time series observations.

\end{table}
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.