Featured Book

LaTeX Beginners Guide

Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 14 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Vertically aligning column headings to accommodate a \cline

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

Vertically aligning column headings to accommodate a \cline

Postby dcbob on Sat Apr 24th, 2010

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!

Code: Select all  •  Open in writeLaTeX
\begin{landscape}\footnotesize
\begin{longtable}{lcccccccccc}
\caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
 & \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
 & \multicolumn{2}{c}{Downglides} & \multicolumn{2}{c}{Upglides} & Back & ME /\textipa{\bfseries a}/ & & & Voiced & \\
\cline{2-3}\cline{4-5}
 & Front \Z & Back & Front & Back & Vowel & Length- & ME /\textipa{\bfseries a
}/& & Frica- & \\
Region & Vowels & Vowels & Vowels & Vowels & Fronting & ening & Raising & Rhotics & tives & Aspirates\\
\hline
dcbob
 
Posts: 6
Joined: Mon Dec 21st, 2009

Re: Vertically aligning column headings to accommodate a \cl

Postby gmedina on Sat Apr 24th, 2010

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,...
User avatar
gmedina
 
Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

Re: Vertically aligning column headings to accommodate a \cl

Postby dcbob on Sat Apr 24th, 2010

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.

Code: Select all  •  Open in writeLaTeX
\documentclass{article}

\usepackage[margin=1in, paperwidth=17cm, paperheight=24cm]{geometry}
\usepackage{layout}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{tipx}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{longtable, lscape}
\usepackage{dcolumn}
\usepackage{subfig}
\usepackage{caption}
\usepackage{everysel}
\usepackage{keyval}
\usepackage{ragged2e}
\usepackage{enumerate}

\begin{document}

\newcommand\Z{\rule{0pt}{3ex}}

\begin{landscape}\footnotesize
\begin{longtable}{lcccccccccc}
\caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
 & \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
 & \multicolumn{2}{c}{Downglides} & \multicolumn{2}{c}{Upglides} & Back & ME /\textipa{\bfseries a}/ & & & Voiced & \\
\cline{2-3}\cline{4-5}
 & Front \Z & Back & Front & Back & Vowel & Length- & ME /\textipa{\bfseries a}/& & Frica- & \\
Region & Vowels & Vowels & Vowels & Vowels & Fronting & ening & Raising & Rhotics & tives & Aspirates\\
\hline
Far North \Z & U & O & - & - & - & - & - & [\textipa{\bfseries K}] & - & [\textipa{\bfseries h}], [\textipa{\bfseries wh}] \\
Upper Northwest & U & U & - & - & - & - & - & - & - & [\textipa{\bfseries h}] (O) \\
Cumbria-N. Yorkshire & U & U & O & - & - & - & - & - & - & - \\
Lower Northwest & O & O & O & O & - & - & - & - & - & - \\
Lincolnshire & U & U & - & - & - & - & - & - & - & - \\
Staffordshire & - & - & U & O & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
East Midlands & - & - & U & U & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
West Midlands & O & - & O & - & - & - & O & [\textipa{\bfseries \*r}] $\sim$ [\textipa{\bfseries \:r}] & - & -\\
Central South & O & O & O & O & - & U & - & [\textipa{\bfseries \*r}] & - & - \\
North Anglia & - & - & U & U & - & U & U & - & - & [\textipa{\bfseries h}] \\
Central Southeast & - & - & U & U & - & U & U & - & - & - \\
Southeast Coast & - & - & U & U & - & U & U & [\textipa{\bfseries \*r}] & - & [\textipa{\bfseries h}] (O) \\
Central Southwest & O & - & O & O & - & U & O & [\textipa{\bfseries \:r}] & U & [\textipa{\bfseries h}] (O) \\
Devonshire & O & - & O & - & [\textipa{\bfseries Y:}] & U & - & [\textipa{\bfseries \:r}] & U & - \\
Cornwall & O & - & O & - & - & U & O & [\textipa{\bfseries \:r}] & U & - \\
\hline
\end{longtable}
Note: U - Usual pronunciation of at least one phoneme; O - Occasional pronunciation.\\
\end{landscape}

\end{document
}
dcbob
 
Posts: 6
Joined: Mon Dec 21st, 2009

Re: Vertically aligning column headings to accommodate a \cl

Postby gmedina on Sun Apr 25th, 2010

Hi,

try something like this:

Code: Select all  •  Open in writeLaTeX
\documentclass{article}
\usepackage[margin=1in, paperwidth=17cm, paperheight=24cm]{geometry}
\usepackage{layout}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tipa}
\usepackage{tipx}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{longtable, lscape}
\usepackage{dcolumn}
\usepackage{subfig}
\usepackage{caption}
\usepackage{everysel}
\usepackage{keyval}
\usepackage{ragged2e}
\usepackage{enumerate}
\usepackage{multirow}

\begin{document}

\newcommand\Z{\rule{0pt}{3ex}}

\begin{landscape}\footnotesize
\begin{longtable}{lcccccccccc}
\caption[English Regions and Their Distinctive Features]{English Regions and Their Distinctive Features} \label{regionfeatures}\\
& \multicolumn{2}{c}{Inglides/} & & & & & & & & \\
& \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}} & \\
\cline{2-3}\cline{4-5}
& Front \Z & Back & Front & Back &  & & ME /\textipa{\bfseries a}/& & & \\
Region & Vowels & Vowels & Vowels & Vowels &  & & Raising & Rhotics & & Aspirates\\
\hline
Far North \Z & U & O & - & - & - & - & - & [\textipa{\bfseries K}] & - & [\textipa{\bfseries h}], [\textipa{\bfseries wh}] \\
Upper Northwest & U & U & - & - & - & - & - & - & - & [\textipa{\bfseries h}] (O) \\
Cumbria-N. Yorkshire & U & U & O & - & - & - & - & - & - & - \\
Lower Northwest & O & O & O & O & - & - & - & - & - & - \\
Lincolnshire & U & U & - & - & - & - & - & - & - & - \\
Staffordshire & - & - & U & O & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
East Midlands & - & - & U & U & [\textipa{\bfseries \"u:}] & - & - & - & - & - \\
West Midlands & O & - & O & - & - & - & O & [\textipa{\bfseries \*r}] $\sim$ [\textipa{\bfseries \:r}] & - & -\\
Central South & O & O & O & O & - & U & - & [\textipa{\bfseries \*r}] & - & - \\
North Anglia & - & - & U & U & - & U & U & - & - & [\textipa{\bfseries h}] \\
Central Southeast & - & - & U & U & - & U & U & - & - & - \\
Southeast Coast & - & - & U & U & - & U & U & [\textipa{\bfseries \*r}] & - & [\textipa{\bfseries h}] (O) \\
Central Southwest & O & - & O & O & - & U & O & [\textipa{\bfseries \:r}] & U & [\textipa{\bfseries h}] (O) \\
Devonshire & O & - & O & - & [\textipa{\bfseries Y:}] & U & - & [\textipa{\bfseries \:r}] & U & - \\
Cornwall & O & - & O & - & - & U & O & [\textipa{\bfseries \:r}] & U & - \\
\hline
\end{longtable}
Note: U - Usual pronunciation of at least one phoneme; O - Occasional pronunciation.\\
\end{landscape}

\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,...
User avatar
gmedina
 
Posts: 2313
Joined: Wed Jul 11th, 2007
Location: Colombia

Re: Vertically aligning column headings to accommodate a \cl

Postby dcbob on Sun Apr 25th, 2010

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!
dcbob
 
Posts: 6
Joined: Mon Dec 21st, 2009


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: No registered users and 14 guests