Text FormattingBad vertical Alignment in two-columned List

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Hermano
Posts: 14
Joined: Wed Apr 06, 2011 9:10 pm

Bad vertical Alignment in two-columned List

Post by Hermano »

Hi,

I want to have two columns with only the first column to be itemized. This works fine but the vertical alignment of my rows is messed up for both columns when I use subscript text (see the fourth row below the limit symbol in attachment). How can I solve this without having this vertical alignment problem between the columns?

This is my code:

Code: Select all

\begin{tabular}{p{0.5\textwidth}p{0.5\textwidth}}
  \begin{itemize} 
    \item [(i)] \hspace{5mm} $\theta_i$,~$Y = L/(2r)$ 
    \item [(ii)] \hspace{5mm} $0 \leq \theta \leq 2\pi$,~$Y = 0$ and $L/r$ 
    \item [(iii)] \hspace{5mm} $0 \leq Y \leq L/r$ 
    \item [(iv)] \hspace{5mm} $0 \leq \theta \leq 2\pi$,~$Y = L/(2r)$ 
  \end{itemize} &
  \begin{itemize} 
    \item [ ] $P = P_t$ (feedholes)
    \item [ ] $P = 1$ (ambient) 
    \item [ ] $\displaystyle P_{\theta = 0} = \lim_{\theta \to 2\pi}{\theta}$ (continuity) 
    \item [ ] $\partial P / \partial Y = 0$ (symmetry) 
  \end{itemize} \\
\end{tabular}
Attachments
itemize-bad-alignment.png
itemize-bad-alignment.png (17.24 KiB) Viewed 6204 times
Last edited by localghost on Mon Sep 02, 2013 11:00 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Bad vertical Alignment in two-columned List

Post by localghost »

A math environment like alignat* from amsmath might be better for this kind of alignment.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}    % loads »amsmath«
\usepackage{xfrac}        % nice looking fractions
\usepackage{lmodern}

\begin{document}
  \begin{alignat*}{5}
    (\text{i})   && \theta_i &,\  Y &&= \sfrac{L}{2r} & P &= P_t & \text{(feedholes)}\\
    (\text{ii})  &&\qquad 0 \leq \theta \leq 2\pi &,\ Y &&= 0 \text{ and } \sfrac{L}{r} & P &= 1 & \text{(ambient)} \\
    (\text{iii}) && 0 \leq Y \leq \sfrac{L}{r} &&&&\qquad P_{\theta=0} &= \lim_{\theta\to 2\pi}{\theta} &\qquad \text{(continuity)} \\
    (\text{iv})  && 0 \leq \theta \leq 2\pi &,\ Y &&= \sfrac{L}{2r} & \sfrac{\partial P}{\partial Y} &= 0 & \text{(symmetry)}
  \end{alignat*}
\end{document}
And by the way, feedback on proposals to many of your other questions is highly appreciated. It would allow to discuss an issue and show that you notice proposals.


Further reading:

Thorsten
Hermano
Posts: 14
Joined: Wed Apr 06, 2011 9:10 pm

Bad vertical Alignment in two-columned List

Post by Hermano »

Dear Thorsten,

Thank you for your answer. In meantime, I solved my problem by using three columns instead of two, while I increased the row height. To this end, I did not have to use the itemize environment in the first column.

This is the code that solved my problem:

Code: Select all

\begin{table}[H]
\renewcommand{\arraystretch}{2}
\centering
\begin{tabular}{rp{5cm}l}
(i) & $\theta_i$,~$Y = L/(2r)$ & $P = P_t$ (feedholes) \\
(ii) & $0 \leq \theta \leq 2\pi$,~$Y = 0$ and $L/r$ & $P = 1$ (ambient) \\
(iii) & $0 \leq Y \leq L/r$ & $\displaystyle P_{\theta = 0} = \lim_{\theta \to 2\pi} P_{\theta}$ (continuity) \\
(iv) & $0 \leq \theta \leq 2\pi$,~$Y = L/(2r)$ & $\partial P / \partial Y = 0$ (symmetry\footnotemark) \\
\end{tabular}
\end{table}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Bad vertical Alignment in two-columned List

Post by localghost »

Think about using the {array} environment for the math stuff instead of {tabular}.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Bad vertical Alignment in two-columned List

Post by Johannes_B »

Using a math-environment to typeset math doesn't just seem like a good idea, it is a good idea. Thorsten knows what he is doing, i would have suggested the same. Why would you use a table (floating environment) for this?

Please also inform yourself how to prepare a Minimal Working Example. This gives the possibiblity to click on open in writelatex directly above the code. This shows the output in seconds, and possible solutions can be tested quickly.

Are you aware of the possibility to number equations automatically in your document?

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply