0

I am trying to build a long table that extends to multiple pages and I don't want vertical lines in the table but there are different sections within the table divided by horizontal lines. I am using the long table package but no success. I am providing the codes that I am using below:

     \usepackage{longtable}
     \begin{document}
     \begin{longtable}[ \centering
        \caption{Pre-Treatment Covariates for Calculating Propensity Scores}
        \toprule
        \textbf{Acronym} & \textbf{Variable Name} & \textbf{Description}                              
        \endfirsthead
        \multicolumn{3}{c}%
        {{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\
        \textbf{Acronym} & \textbf{Variable Name} & \textbf{Description}
        \endhead
        \multicolumn{3}{|r|}{{Continued on next page}} \\
        \endfoot
        \midrule
        \multicolumn{3}{c}{\textbf{DETERMINANTS OF SMS ISSUANCE }} \\
        \midrule
        \multicolumn{3}{l}{\textbf{Credit Risk}} \\
        \midrule
        RWATA & Risk Weighted Asset Ratio  & Risk Weighted Assets / Total Assets \\
        LLP   & Loan Impairment  & Loan Impairment Charges / Gross Loans  \\
        NPLs  & Non-Performing Loans & NPLS / Total Loans  \\
        LLP   & Loan Loss Provision  & Loan Loss Provision / Total Loans  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Profitability }} \\
        \midrule
        NIM   & Net Interest Margin & Net Interest Income / Total Earning Assets \\
        ROA   & Return on Assets & Operating Income / Total Assets  \\
        ROE   & Return on Equity & Net Income / Total Equity  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Funding Structure and Cost }} \\
        \midrule
        LFD   & Loans Funded by Deposits  & Loans / Customer Deposits\% \\
        FTD   & Funding Through Deposits  & Customer Deposits / Total Funding excel Derivatives\% \\
        LFST  & Loans Funded by Short Term Funding  & Net Loans / Short Term Funding  \\
        LFLT  & Loans Funded by Long Term Funding  & Net Loans / Long Term Funding  \\
        FCTL  & Funding Cost for Total Liabilities  & Total Interest Expense / Total Liabilities  \\
        FCTD  & Funding Cost for Total Deposits  & Interest Expense on Deposits / Total Deposits  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Liquidity }} \\
        \midrule
        LAFST & Liquid Assets Funded by Short Term Funding  & Liquid Assets / Short Term Funding \\
        LAFLT & Liquid Assets Funded by Long Term Funding  & Liquid Assets / Long Term Funding \\
        Liq. R & Liquidity Ratio  & Cash + Securities / Total Assets \\
        \midrule
        \multicolumn{3}{l}{\textbf{Capital Ratios}} \\
        \midrule
        ER    & Equity Ratio  & Total Equity / Total Assets \\
        CAR   & Capital Adequacy Ratio  & (Tier 1 Capital + Tier 2 Capital) / Risk Weighted Assets \\
        \midrule
        \multicolumn{3}{c}{\textbf{LOAN PORTFOLIO}} \\
        \midrule
        LBR   & Loans to Banks  & Loans to Banks / Total Loans  \\
        RMLR  & Residential Mortgage Loans Ratio & Residential Mortgage Loans / Total Loans  \\
        OMLR  & Other Mortgage Loan Ratio & Other Mortgage Loan / Total Loans  \\
        CRLR  & Consumer \& Retails Loans Ratio & Consumer \& Retails Loans / Total Loans  \\
        CCLR  & Corporate \& Commercial Loans Ratio & Corporate \& Commercial Loans / Total Loans  \\
        OLR   & Other Loans Ratio & Other Loans Ratio / Total Loans  \\
        LR    & Loan Ratio  & Total Loans / Total Assets \\
        \midrule
        \multicolumn{3}{c}{\textbf{INSTITUTIONAL CHARACTERISTICS }} \\
        \midrule
        \multicolumn{3}{l}{\textbf{Income and Cost Structure }} \\
        \midrule
        C/I   & Cost / Income & Operating Cost / Operating Income   \\
        LInc.R & Loan Income Ratio  & Interest Income on Loan / Total Loans  \\
        LIR   & Loan Interest Ratio  & Interest Income on Loans / Total Interest Income  \\
        OIR   & Other Interest Ratio  & Other Interest Income / Total Interest Income  \\
        IEDR  & Interest Expense on Deposits Ratio  & Interest Expense on Deposits / Total Interest Expense  \\
        OIER  & Other Interest Expense Ratio  & Other Interest Expense / Total Interest Expense  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Solvency }} \\
        \midrule
        D/E   & Debt to Equity Ratio & Total Liabilities / Total Equity  \\
        D/A   & Debt to Assets Ratio & Total Liabilities / Total Assets \\
        ICR   & Interest Coverage Ratio & EBIT / Total Interest Expense  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Other Institutional Characteristics }} \\
        \midrule
        AG    & Assets Growth  & Growth of Total Assets\% \\
        LG    & Loan Growth  & Growth of Gross Loans\% \\
        DPO   & Dividend Payout  & Total Dividends Paid / Net Income  \\
        Size  & Size of Bank  & Ln (Total Assets) \\
        Rep   & Reputation of Bank  & Letter of Guarantees / Total Assets \\
        COR   & Charge Off Ratio & Net Charge Offs / Total Loans  \\
        \bottomrule
        \label{tab:covariates}%
        \end{longtable}%
        \end{document}

The original table should look like this. enter image description here

Any help will be much appreciated.

1

longtable is the same as tabular: you need to specify the columns in the first argument.

enter image description here

\documentclass{article}
 \usepackage{longtable,booktabs,array}
     \begin{document}
\small
     \begin{longtable}{
l
>{\raggedright\arraybackslash}p{4.5cm}
>{\raggedright\arraybackslash}p{4.5cm}}%????[ \centering
\caption{Pre-Treatment Covariates for Calculating Propensity Scores\label{tab:covariates}}\\
        \toprule
        \textbf{Acronym} & \textbf{Variable Name} & \textbf{Description}                              
        \endfirsthead
        \multicolumn{3}{c}%
        {{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\
        \textbf{Acronym} & \textbf{Variable Name} & \textbf{Description}
        \endhead
        \multicolumn{3}{r}{{Continued on next page}} \\
        \endfoot
        \midrule
        \multicolumn{3}{c}{\textbf{DETERMINANTS OF SMS ISSUANCE }} \\
        \midrule
        \multicolumn{3}{l}{\textbf{Credit Risk}} \\
        \midrule
        RWATA & Risk Weighted Asset Ratio  & Risk Weighted Assets / Total Assets \\
        LLP   & Loan Impairment  & Loan Impairment Charges / Gross Loans  \\
        NPLs  & Non-Performing Loans & NPLS / Total Loans  \\
        LLP   & Loan Loss Provision  & Loan Loss Provision / Total Loans  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Profitability }} \\
        \midrule
        NIM   & Net Interest Margin & Net Interest Income / Total Earning Assets \\
        ROA   & Return on Assets & Operating Income / Total Assets  \\
        ROE   & Return on Equity & Net Income / Total Equity  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Funding Structure and Cost }} \\
        \midrule
        LFD   & Loans Funded by Deposits  & Loans / Customer Deposits\% \\
        FTD   & Funding Through Deposits  & Customer Deposits / Total Funding excel Derivatives\% \\
        LFST  & Loans Funded by Short Term Funding  & Net Loans / Short Term Funding  \\
        LFLT  & Loans Funded by Long Term Funding  & Net Loans / Long Term Funding  \\
        FCTL  & Funding Cost for Total Liabilities  & Total Interest Expense / Total Liabilities  \\
        FCTD  & Funding Cost for Total Deposits  & Interest Expense on Deposits / Total Deposits  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Liquidity }} \\
        \midrule
        LAFST & Liquid Assets Funded by Short Term Funding  & Liquid Assets / Short Term Funding \\
        LAFLT & Liquid Assets Funded by Long Term Funding  & Liquid Assets / Long Term Funding \\
        Liq. R & Liquidity Ratio  & Cash + Securities / Total Assets \\
        \midrule
        \multicolumn{3}{l}{\textbf{Capital Ratios}} \\
        \midrule
        ER    & Equity Ratio  & Total Equity / Total Assets \\
        CAR   & Capital Adequacy Ratio  & (Tier 1 Capital + Tier 2 Capital) / Risk Weighted Assets \\
        \midrule
        \multicolumn{3}{c}{\textbf{LOAN PORTFOLIO}} \\
        \midrule
        LBR   & Loans to Banks  & Loans to Banks / Total Loans  \\
        RMLR  & Residential Mortgage Loans Ratio & Residential Mortgage Loans / Total Loans  \\
        OMLR  & Other Mortgage Loan Ratio & Other Mortgage Loan / Total Loans  \\
        CRLR  & Consumer \& Retails Loans Ratio & Consumer \& Retails Loans / Total Loans  \\
        CCLR  & Corporate \& Commercial Loans Ratio & Corporate \& Commercial Loans / Total Loans  \\
        OLR   & Other Loans Ratio & Other Loans Ratio / Total Loans  \\
        LR    & Loan Ratio  & Total Loans / Total Assets \\
        \midrule
        \multicolumn{3}{c}{\textbf{INSTITUTIONAL CHARACTERISTICS }} \\
        \midrule
        \multicolumn{3}{l}{\textbf{Income and Cost Structure }} \\
        \midrule
        C/I   & Cost / Income & Operating Cost / Operating Income   \\
        LInc.R & Loan Income Ratio  & Interest Income on Loan / Total Loans  \\
        LIR   & Loan Interest Ratio  & Interest Income on Loans / Total Interest Income  \\
        OIR   & Other Interest Ratio  & Other Interest Income / Total Interest Income  \\
        IEDR  & Interest Expense on Deposits Ratio  & Interest Expense on Deposits / Total Interest Expense  \\
        OIER  & Other Interest Expense Ratio  & Other Interest Expense / Total Interest Expense  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Solvency }} \\
        \midrule
        D/E   & Debt to Equity Ratio & Total Liabilities / Total Equity  \\
        D/A   & Debt to Assets Ratio & Total Liabilities / Total Assets \\
        ICR   & Interest Coverage Ratio & EBIT / Total Interest Expense  \\
        \midrule
        \multicolumn{3}{l}{\textbf{Other Institutional Characteristics }} \\
        \midrule
        AG    & Assets Growth  & Growth of Total Assets\% \\
        LG    & Loan Growth  & Growth of Gross Loans\% \\
        DPO   & Dividend Payout  & Total Dividends Paid / Net Income  \\
        Size  & Size of Bank  & Ln (Total Assets) \\
        Rep   & Reputation of Bank  & Letter of Guarantees / Total Assets \\
        COR   & Charge Off Ratio & Net Charge Offs / Total Loans  \\
        \bottomrule

        \end{longtable}%
        \end{document}
  • It worked almost fine but two minor issues are still there. The columns are really narrow. I want to expand the columns as a lot of space is left on both sides of the paper. Moreover, when the table ends, it is still written at the end of table "Continued on next page". How I can get rid of these two issues. – Ahmed Arif Nov 4 '16 at 11:14
  • @AhmedArif to get rid of the last foot use an empty \endlastfoot I made the columns as wide as would fit in the page, perhaps your page is wider, (the question should always have a complete document so don't have to guess these things) anyway they are specified above as 4.5cm just make them whatever width you want – David Carlisle Nov 4 '16 at 11:33
  • thank you for your response. \endlastfoot perfectly worked. I increased the margins to 7 cm and table columns are expanded but the caption still remains in the narrow range and split in two lines. – Ahmed Arif Nov 4 '16 at 11:58
  • @AhmedArif yes there is a separate length (\LTcapwidth for that, as described in the longtable manual) – David Carlisle Nov 4 '16 at 12:06
0

I suggest you use ltablex, which brings the functionalities of longtable to tabularx. Your table will look nicer, in my opinion, if the ‘section titles’ (in capital letters) are left-aligned too:

\documentclass{article}
\usepackage{geometry}%
\usepackage{ltablex, booktabs}

\begin{document}
\small\setlength\tabcolsep{5pt}\renewcommand{\arraystretch}{1.2}
\begin{tabularx}{\linewidth}{ll >{\arraybackslash}X}
  \caption{Pre-Treatment Covariates for Calculating Propensity Scores}\\%
  \toprule
  \rlap{\textbf{Acronym}} & \textbf{Variable Name} & \textbf{Description} \\
  \endfirsthead
  \multicolumn{3}{c}%
  {{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\
  \addlinespace[2ex]
  \textbf{Acronym} & \textbf{Variable Name} & \textbf{Description} \\
  \endhead
  \addlinespace
  \multicolumn{3}{r}{{\footnotesize[Continued on next page]}} \\
  \endfoot
  \endlastfoot
  \midrule
  \multicolumn{3}{l}{\textbf{DETERMINANTS OF SMS ISSUANCE }} \\
  \midrule
  \multicolumn{3}{l}{\textbf{Credit Risk}} \\
  \midrule
  RWATA & Risk Weighted Asset Ratio & Risk Weighted Assets / Total Assets \\
  LLP & Loan Impairment & Loan Impairment Charges / Gross Loans \\
  NPLs & Non-Performing Loans & NPLS / Total Loans \\
  LLP & Loan Loss Provision & Loan Loss Provision / Total Loans \\
  \midrule
  \multicolumn{3}{l}{\textbf{Profitability }} \\
  \midrule
  NIM & Net Interest Margin & Net Interest Income / Total Earning Assets \\
  ROA & Return on Assets & Operating Income / Total Assets \\
  ROE & Return on Equity & Net Income / Total Equity \\
  \midrule
  \multicolumn{3}{l}{\textbf{Funding Structure and Cost }} \\
  \midrule
  LFD & Loans Funded by Deposits & Loans / Customer Deposits\% \\
  FTD & Funding Through Deposits & Customer Deposits / Total Funding excel Derivatives\% \\
  LFST & Loans Funded by Short Term Funding & Net Loans / Short Term Funding \\
  LFLT & Loans Funded by Long Term Funding & Net Loans / Long Term Funding \\
  FCTL & Funding Cost for Total Liabilities & Total Interest Expense / Total Liabilities \\
  FCTD & Funding Cost for Total Deposits & Interest Expense on Deposits / Total Deposits \\
  \midrule
  \multicolumn{3}{l}{\textbf{Liquidity }} \\
  \midrule
  LAFST & Liquid Assets Funded by Short Term Funding & Liquid Assets / Short Term Funding \\
  LAFLT & Liquid Assets Funded by Long Term Funding & Liquid Assets / Long Term Funding \\
  Liq. R & Liquidity Ratio & Cash + Securities / Total Assets \\
  \midrule
  \multicolumn{3}{l}{\textbf{Capital Ratios}} \\
  \midrule
  ER & Equity Ratio & Total Equity / Total Assets \\
  CAR & Capital Adequacy Ratio & (Tier 1 Capital + Tier 2 Capital) / Risk Weighted Assets \\
  \midrule
  \multicolumn{3}{l}{\textbf{LOAN PORTFOLIO}} \\
  \midrule
  LBR & Loans to Banks & Loans to Banks / Total Loans \\
  RMLR & Residential Mortgage Loans Ratio & Residential Mortgage Loans / Total Loans \\
  OMLR & Other Mortgage Loan Ratio & Other Mortgage Loan / Total Loans \\
  CRLR & Consumer \& Retails Loans Ratio & Consumer \& Retails Loans / Total Loans \\
  CCLR & Corporate \& Commercial Loans Ratio & Corporate \& Commercial Loans / Total Loans \\
  OLR & Other Loans Ratio & Other Loans Ratio / Total Loans \\
  LR & Loan Ratio & Total Loans / Total Assets \\
  \midrule
  \multicolumn{3}{l}{\textbf{INSTITUTIONAL CHARACTERISTICS }} \\
  \midrule
  \multicolumn{3}{l}{\textbf{Income and Cost Structure }} \\
  \midrule
  C/I & Cost / Income & Operating Cost / Operating Income \\
  LInc.R & Loan Income Ratio & Interest Income on Loan / Total Loans \\
  LIR & Loan Interest Ratio & Interest Income on Loans / Total Interest Income \\
  OIR & Other Interest Ratio & Other Interest Income / Total Interest Income \\
  IEDR & Interest Expense on Deposits Ratio & Interest Expense on Deposits / Total Interest Expense \\
  OIER & Other Interest Expense Ratio & Other Interest Expense / Total Interest Expense \\
  \midrule
  \multicolumn{3}{l}{\textbf{Solvency }} \\
  \midrule
  D/E & Debt to Equity Ratio & Total Liabilities / Total Equity \\
  D/A & Debt to Assets Ratio & Total Liabilities / Total Assets \\
  ICR & Interest Coverage Ratio & EBIT / Total Interest Expense \\
  \midrule
  \multicolumn{3}{l}{\textbf{Other Institutional Characteristics }} \\
  \midrule
  AG & Assets Growth & Growth of Total Assets\% \\
  LG & Loan Growth & Growth of Gross Loans\% \\
  DPO & Dividend Payout & Total Dividends Paid / Net Income \\
  Size & Size of Bank & Ln (Total Assets) \\
  Rep & Reputation of Bank & Letter of Guarantees / Total Assets \\
  COR & Charge Off Ratio & Net Charge Offs / Total Loans \\
  \bottomrule
  \label{tab:covariates}%
\end{tabularx}%

\end{document} 

enter image description here enter image description here

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.