LaTeX forum ⇒ Text FormattingBad vertical Alignment in two-columned List Topic is solved

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

Bad vertical Alignment in two-columned List

Postby Hermano » Mon Sep 02, 2013 9:09 pm

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:
  1. \begin{tabular}{p{0.5\textwidth}p{0.5\textwidth}}
  2. \begin{itemize}
  3. \item [(i)] \hspace{5mm} $\theta_i$,~$Y = L/(2r)$
  4. \item [(ii)] \hspace{5mm} $0 \leq \theta \leq 2\pi$,~$Y = 0$ and $L/r$
  5. \item [(iii)] \hspace{5mm} $0 \leq Y \leq L/r$
  6. \item [(iv)] \hspace{5mm} $0 \leq \theta \leq 2\pi$,~$Y = L/(2r)$
  7. \end{itemize} &
  8. \begin{itemize}
  9. \item [ ] $P = P_t$ (feedholes)
  10. \item [ ] $P = 1$ (ambient)
  11. \item [ ] $\displaystyle P_{\theta = 0} = \lim_{\theta \to 2\pi}{\theta}$ (continuity)
  12. \item [ ] $\partial P / \partial Y = 0$ (symmetry)
  13. \end{itemize} \\
  14. \end{tabular}
Attachments
itemize-bad-alignment.png
itemize-bad-alignment.png (17.24 KiB) Viewed 3802 times
Last edited by localghost on Mon Sep 02, 2013 11:00 pm, edited 1 time in total.
Reason: Image resized for better view on small screens (see Board Rules).

Tags:

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Sep 02, 2013 11:27 pm

A math environment like alignat* from amsmath might be better for this kind of alignment.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{mathtools} % loads »amsmath«
  4. \usepackage{xfrac} % nice looking fractions
  5. \usepackage{lmodern}
  6.  
  7. \begin{document}
  8. \begin{alignat*}{5}
  9. (\text{i}) && \theta_i &,\ Y &&= \sfrac{L}{2r} & P &= P_t & \text{(feedholes)}\\
  10. (\text{ii}) &&\qquad 0 \leq \theta \leq 2\pi &,\ Y &&= 0 \text{ and } \sfrac{L}{r} & P &= 1 & \text{(ambient)} \\
  11. (\text{iii}) && 0 \leq Y \leq \sfrac{L}{r} &&&&\qquad P_{\theta=0} &= \lim_{\theta\to 2\pi}{\theta} &\qquad \text{(continuity)} \\
  12. (\text{iv}) && 0 \leq \theta \leq 2\pi &,\ Y &&= \sfrac{L}{2r} & \sfrac{\partial P}{\partial Y} &= 0 & \text{(symmetry)}
  13. \end{alignat*}
  14. \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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby Hermano » Mon Sep 02, 2013 11:58 pm

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:

  1. \begin{table}[H]
  2. \renewcommand{\arraystretch}{2}
  3. \centering
  4. \begin{tabular}{rp{5cm}l}
  5. (i) & $\theta_i$,~$Y = L/(2r)$ & $P = P_t$ (feedholes) \\
  6. (ii) & $0 \leq \theta \leq 2\pi$,~$Y = 0$ and $L/r$ & $P = 1$ (ambient) \\
  7. (iii) & $0 \leq Y \leq L/r$ & $\displaystyle P_{\theta = 0} = \lim_{\theta \to 2\pi} P_{\theta}$ (continuity) \\
  8. (iv) & $0 \leq \theta \leq 2\pi$,~$Y = L/(2r)$ & $\partial P / \partial Y = 0$ (symmetry\footnotemark) \\
  9. \end{tabular}
  10. \end{table}

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Tue Sep 03, 2013 12:05 am

Think about using the {array} environment for the math stuff instead of {tabular}.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
Johannes_B
Site Moderator
Posts: 4102
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Sep 03, 2013 8:35 am

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.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests