I’m completely new to tex. My level of ‘expertise’ is currently pasting text into TexShop (I have a Mac) and pressing “Typeset”. I’m hoping someone might be able to help me with a ‘long table’ related question. I want to set some general properties for my longtables so that their top row is always dark grey and so that they’re always horizontally-centred on my pages. I’ve found some documentation on longtables (http://tug.ctan.org/macros/latex/requir ... gtable.pdf), but I don’t yet have the know-how to make sense of it. I'd be very grateful if someone could give me a hand. Below is some code showing where I've got to so far.
James.
Code: Select all
% Type of doc.
\documentclass[a4paper]{book}
% General packages
\usepackage[margin=1in]{geometry}
\usepackage[pdftex]{graphicx}
\usepackage[T1]{fontenc}
\usepackage{pslatex}
\usepackage[english]{babel}
\usepackage{cjhebrew}
\usepackage{parskip}
\usepackage{enumerate}
% Set for tables
\usepackage{colortbl}
\usepackage[table]{xcolor}
\definecolor{lightgray}{gray}{0.95}
\usepackage{longtable,tabu}
\usepackage{array} % for extrarowheight
\renewcommand{\arraystretch}{1.5}
% Start doc.
\begin{document}
% Global font settings
\renewcommand{\rmdefault}{ppl}
\fontencoding{T1}
\fontfamily{ppl}
\fontsize{14}{18}
\selectfont
% Text
\chapter{Preface}
\section{Section 1}
Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here. Lots of text here.
\clearpage
\rowcolors{1}{}{lightgray}
\begin{longtable}{|p{7.5cm}|p{7.5cm}|}
\hline
\multicolumn{1}{|c}{\textbf{Col. 1}} & \multicolumn{1}{|c|}{\textbf{Col. 2}} \\ \hline
Text in Col 1. & Text in Col 2. \\ \hline
Text in Col 1. & Text in Col 2. \\ \hline
Text in Col 1. & Text in Col 2. \\ \hline
Text in Col 1. & Text in Col 2. \\ \hline
Text in Col 1. & Text in Col 2. \\ \hline
\hline
\end{longtable}
\end{document}