LaTeX forum ⇒ Graphics, Figures & TablesVertically aligning column headings to accommodate a \cline

Information and discussion about graphics, figures & tables in LaTeX documents.
dcbob
Posts: 6
Joined: Mon Dec 21, 2009 4:19 pm

Vertically aligning column headings to accommodate a \cline

Postby dcbob » Sat Apr 24, 2010 4:29 pm

I have what I think is a very simple question but I can't find a simple solution: in the following multi-row column headings for a longtable, I have two clines under the second row under columns 2-3 and columns 4-5, and I want to move the rest of the second row (that is, "Back & ME /\textipa{\bfseries a}/ & & & Voiced") down slightly so that there won't be an extra vertical space in column headings 6-11 (due to the space required for the clines under columns 2-5). I would appreciate any advice, and sorry I overlooked this covered elsewhere. Thanks!

  1. \begin{landscape}\footnotesize
  2. \begin{longtable}{lcccccccccc}
  3. \caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
  4. & \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
  5. & \multicolumn{2}{c}{Downglides} & \multicolumn{2}{c}{Upglides} & Back & ME /\textipa{\bfseries a}/ & & & Voiced & \\
  6. \cline{2-3}\cline{4-5}
  7. & Front \Z & Back & Front & Back & Vowel & Length- & ME /\textipa{\bfseries a}/& & Frica- & \\
  8. Region & Vowels & Vowels & Vowels & Vowels & Fronting & ening & Raising & Rhotics & tives & Aspirates\\
  9. \hline

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Sat Apr 24, 2010 10:30 pm

Hi,

please post complete, compilable code and not just snippets (we are willing to help, but most of us don't want to waste time).
1,1,2,3,5,8,13,21,34,55,89,144,233,...

Link:
BBcode:
HTML:
Hide post links
Show post links

dcbob
Posts: 6
Joined: Mon Dec 21, 2009 4:19 pm

Postby dcbob » Sat Apr 24, 2010 10:56 pm

Apologies for the oversight. Below is complete, compilable code for the table, including all the \usepackage commands in the original file (which is a complete book). Again, I have two clines under the second row of a table under columns 2-3 and columns 4-5, and I want to move the rest of the second row (that is, "Back & ME /\textipa{\bfseries a}/ & & & Voiced") down slightly so that there won't be an extra vertical space in column headings 6-11 (due to the space required for the clines under columns 2-5). Thanks very much for your help.

  1. \documentclass{article}
  2.  
  3. \usepackage[margin=1in, paperwidth=17cm, paperheight=24cm]{geometry}
  4. \usepackage{layout}
  5. \usepackage[T1]{fontenc}
  6. \usepackage{textcomp}
  7. \usepackage{amsmath}
  8. \usepackage{amsfonts}
  9. \usepackage{amssymb}
  10. \usepackage{tipa}
  11. \usepackage{tipx}
  12. \usepackage{tabularx}
  13. \usepackage{graphicx}
  14. \usepackage{longtable, lscape}
  15. \usepackage{dcolumn}
  16. \usepackage{subfig}
  17. \usepackage{caption}
  18. \usepackage{everysel}
  19. \usepackage{keyval}
  20. \usepackage{ragged2e}
  21. \usepackage{enumerate}
  22.  
  23. \begin{document}
  24.  
  25. \newcommand\Z{\rule{0pt}{3ex}}
  26.  
  27. \begin{landscape}\footnotesize
  28. \begin{longtable}{lcccccccccc}
  29. \caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
  30. & \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
  31. & \multicolumn{2}{c}{Downglides} & \multicolumn{2}{c}{Upglides} & Back & ME /\textipa{\bfseries a}/ & & & Voiced & \\
  32. \cline{2-3}\cline{4-5}
  33. & Front \Z & Back & Front & Back & Vowel & Length- & ME /\textipa{\bfseries a}/& & Frica- & \\
  34. Region & Vowels & Vowels & Vowels & Vowels & Fronting & ening & Raising & Rhotics & tives & Aspirates\\
  35. \hline
  36. Far North \Z & U & O & - & - & - & - & - & [\textipa{\bfseries K}] & - & [\textipa{\bfseries h}], [\textipa{\bfseries wh}] \\
  37. Upper Northwest & U & U & - & - & - & - & - & - & - & [\textipa{\bfseries h}] (O) \\
  38. Cumbria-N. Yorkshire & U & U & O & - & - & - & - & - & - & - \\
  39. Lower Northwest & O & O & O & O & - & - & - & - & - & - \\
  40. Lincolnshire & U & U & - & - & - & - & - & - & - & - \\
  41. Staffordshire & - & - & U & O & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
  42. East Midlands & - & - & U & U & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
  43. West Midlands & O & - & O & - & - & - & O & [\textipa{\bfseries \*r}] $\sim$ [\textipa{\bfseries \:r}] & - & -\\
  44. Central South & O & O & O & O & - & U & - & [\textipa{\bfseries \*r}] & - & - \\
  45. North Anglia & - & - & U & U & - & U & U & - & - & [\textipa{\bfseries h}] \\
  46. Central Southeast & - & - & U & U & - & U & U & - & - & - \\
  47. Southeast Coast & - & - & U & U & - & U & U & [\textipa{\bfseries \*r}] & - & [\textipa{\bfseries h}] (O) \\
  48. Central Southwest & O & - & O & O & - & U & O & [\textipa{\bfseries \:r}] & U & [\textipa{\bfseries h}] (O) \\
  49. Devonshire & O & - & O & - & [\textipa{\bfseries Y:}] & U & - & [\textipa{\bfseries \:r}] & U & - \\
  50. Cornwall & O & - & O & - & - & U & O & [\textipa{\bfseries \:r}] & U & - \\
  51. \hline
  52. \end{longtable}
  53. Note: U - Usual pronunciation of at least one phoneme; O - Occasional pronunciation.\\
  54. \end{landscape}
  55.  
  56. \end{document}

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Sun Apr 25, 2010 1:35 am

Hi,

try something like this:

  1. \documentclass{article}
  2. \usepackage[margin=1in, paperwidth=17cm, paperheight=24cm]{geometry}
  3. \usepackage{layout}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{textcomp}
  6. \usepackage{amsmath}
  7. \usepackage{amsfonts}
  8. \usepackage{amssymb}
  9. \usepackage{tipa}
  10. \usepackage{tipx}
  11. \usepackage{tabularx}
  12. \usepackage{graphicx}
  13. \usepackage{longtable, lscape}
  14. \usepackage{dcolumn}
  15. \usepackage{subfig}
  16. \usepackage{caption}
  17. \usepackage{everysel}
  18. \usepackage{keyval}
  19. \usepackage{ragged2e}
  20. \usepackage{enumerate}
  21. \usepackage{multirow}
  22.  
  23. \begin{document}
  24.  
  25. \newcommand\Z{\rule{0pt}{3ex}}
  26.  
  27. \begin{landscape}\footnotesize
  28. \begin{longtable}{lcccccccccc}
  29. \caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
  30. & \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
  31. & \multicolumn{2}{c}{Downglides} & \multicolumn{2}{c}{Upglides} & \multirow{3}{*}{\parbox{1cm}{\vskip4pt\centering Back Vowel Fronting}} & \multirow{3}{*}{\parbox{1cm}{\vskip4pt\centering ME /\textipa{\bfseries a} Lengthening}}/ & & & \multirow{3}{*}{\parbox{1cm}{\vskip4pt\centering Voiced Fricatives}} & \\
  32. \cline{2-3}\cline{4-5}
  33. & Front \Z & Back & Front & Back & & & ME /\textipa{\bfseries a}/& & & \\
  34. Region & Vowels & Vowels & Vowels & Vowels & & & Raising & Rhotics & & Aspirates\\
  35. \hline
  36. Far North \Z & U & O & - & - & - & - & - & [\textipa{\bfseries K}] & - & [\textipa{\bfseries h}], [\textipa{\bfseries wh}] \\
  37. Upper Northwest & U & U & - & - & - & - & - & - & - & [\textipa{\bfseries h}] (O) \\
  38. Cumbria-N. Yorkshire & U & U & O & - & - & - & - & - & - & - \\
  39. Lower Northwest & O & O & O & O & - & - & - & - & - & - \\
  40. Lincolnshire & U & U & - & - & - & - & - & - & - & - \\
  41. Staffordshire & - & - & U & O & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
  42. East Midlands & - & - & U & U & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
  43. West Midlands & O & - & O & - & - & - & O & [\textipa{\bfseries \*r}] $\sim$ [\textipa{\bfseries \:r}] & - & -\\
  44. Central South & O & O & O & O & - & U & - & [\textipa{\bfseries \*r}] & - & - \\
  45. North Anglia & - & - & U & U & - & U & U & - & - & [\textipa{\bfseries h}] \\
  46. Central Southeast & - & - & U & U & - & U & U & - & - & - \\
  47. Southeast Coast & - & - & U & U & - & U & U & [\textipa{\bfseries \*r}] & - & [\textipa{\bfseries h}] (O) \\
  48. Central Southwest & O & - & O & O & - & U & O & [\textipa{\bfseries \:r}] & U & [\textipa{\bfseries h}] (O) \\
  49. Devonshire & O & - & O & - & [\textipa{\bfseries Y:}] & U & - & [\textipa{\bfseries \:r}] & U & - \\
  50. Cornwall & O & - & O & - & - & U & O & [\textipa{\bfseries \:r}] & U & - \\
  51. \hline
  52. \end{longtable}
  53. Note: U - Usual pronunciation of at least one phoneme; O - Occasional pronunciation.\\
  54. \end{landscape}
  55.  
  56. \end{document}


The idea was to use \multirow (from the multirow package) for the problematic columns to merge three cells; a final adjustment was required and I used \vskip.

Of course, change the width of the \parbox commands (I used 1cm) and the length used for the \vskip (I used 4pt).
1,1,2,3,5,8,13,21,34,55,89,144,233,...

Link:
BBcode:
HTML:
Hide post links
Show post links

dcbob
Posts: 6
Joined: Mon Dec 21, 2009 4:19 pm

Postby dcbob » Sun Apr 25, 2010 2:19 pm

That did the trick. I had not previously understood the use of either /multirow or /parbox, but this is a very useful illustration of both. As you suggested, I had to change the width of one the \parbox commands to 1.1cm) and the length of \vskip to 5pt, but now the table looks exactly as I intended. The thesis is now ready to submit - thanks very much for your help!

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Bing [Bot] and 5 guests