Graphics, Figures & TablesLongtable word spacing

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
niklasskold
Posts: 6
Joined: Wed Dec 07, 2016 10:47 pm

Longtable word spacing

Post by niklasskold »

Hi,

I have been working on a longtable to just easily draw up some pros and cons. However the sentences in the cells are very spaced, that is the words are far from each other. Any idea of how to make it look more like a "normal" text? Also I can't seem to center the "Cons" at the top, only works for "Pros"

Code: Select all

\centering
\begin{longtable}{ p{.2\textwidth} | p{.4\textwidth} |p{.40\textwidth} } 

 & \textbf{Pros}  &  \textbf{Cons}    \\   \hline 
\textbf{Short-term private debt} &  & \\ \hline
Commercial bank loan &  
- Minimal collateral and background checks \linebreak
- Minimal investor interference & - Higher interest rates than longer, secured loans\\ \hline
Bank credit line &   - 
Creates a relationship between the two parties \linebreak
- Flexible, once open no reason required for a new loan &   - High fees\\ \hline
Trade credit &   - Enables purchase of inventory when cash levels are low & - Can lead to high costs if not paid in time\\ \hline
Factoring &   - Gives instant access to tied up money in accounts receivable & - Accounts receivable are sold at a discount or include a fee reduction in price\\ \hline
\textbf{Short-term public debt} &  & \\ \hline
Commercial paper & - Generally low interest rate and thus low borrowing cost & - Limited to the largest and most financially sound firms\\ \hline
\textbf{Long-term private debt} & bar & bar\\ \hline
Commercial bank loan (term loans/commercial mortgages) & - Competitive interest rate compared to a short-term loan \linebreak
- Relatively small monthly payments\linebreak
- Minimal investor interference & - Higher interest rate than other comparable public issue of debt\\ \hline
Loan from commercial finance companies & - Credit given to high-risk customers, as opposed to commercial banks &  Notably higher interest rates for taking on higher risks\\ \hline
\textbf{Long-term public debt} & bar & bar\\ \hline
Public bonds and notes & bar & bar\\ \hline
\textbf{Venture Capital} & bar & bar\\ \hline
\textbf{IPO} & - Current owners can spread their risk\linebreak
- Lower cost of capital if company is diversified 
- Reduces leverage & bar\\ \hline
\caption{Your caption here} % needs to go inside longtable environment
\label{tab:myfirstlongtable}
\end{longtable}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Longtable word spacing

Post by Stefan Kottwitz »

Don't use \linebreak in table cells. Use \newline or \\ instead.

With p cells you get full justification in the cells. That's nice, but also could cause gaps in some cases. Further optimization:
  • Better justification by \usepackage{microtype}
  • Giving up justification, use P instead of p:

    \usepackage{array}
    \usepackage{ragged2e}
    \newcolumntype{P}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}
  • Load babel and use T1 font encoding, to ensure proper hyphenation:

    \usepackage[english]{babel}
    \usepackage[T1]{fontenc}
Stefan
LaTeX.org admin
Post Reply