0

I like to type up my travel plans. As I'm starting to learn LaTeX, I thought I'd use it. It took a bit of experimenting to discover that I needed to define both utf8x and libertine to get the euro symbol to appear.

I have three tabular sections, each of which contains equivalent information.

  1. Can I force all three tables (or at least the first two) to have columns of the same widths?
  2. Can I make the times (first and third columns) be fairly tight to the following station names (second and fourth columns)?
  3. Why is the final table indented?

I'm just learning, so I'm willing to consider any and all suggestions for improvement aside from my main questions (e.g., should I be using article at all?).

\documentclass[a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{libertine}
\usepackage[margin=0.5in]{geometry}
\pagenumbering{gobble}
\begin{document}
\title{Drachenwald Summer Coronation}
\date{16th - 18th June 2017}
\maketitle

\section*{Travel from Tullamore}

Ticket collection number: XXX XXXXXXXX \\
Booking number: XXXXXXXX \\
Booking status: Confirmed

\subsection*{Payment Details}

\begin{tabular}{ l l l r }
Payment method & Reference     & Status    & Amount \\
CC3DS          & XXXXXXXX-XXXX & Confirmed & €49.96 \\
CC3DS          & XXXXXXXX-XXXX & Failed    & €49.96
\end{tabular}

\subsection*{Friday, 16th June: Tullamore to Drogheda}

\begin{tabular}{ l l l l l r l }
18:48 & Tullamore       & 19:54 & Dublin Heuston    & A717 Coach A Seat 41 & €11.49 & Flexible \\
20:50 & Dublin Connolly & 21:29 & Drogheda MacBride & A136 Coach D Seat 08 & €11.79 & Flexible
\end{tabular}

\subsection*{Sunday, 18th June: Drogheda to Tullamore}

\subsubsection*{Booked Ticket}

\begin{tabular}{ l l l l l r l }
14:40 & Drogheda MacBride & 15:15 & Dublin Connolly & A145 Coach D Seat 44 & €11.79 & Flexible \\
16:35 & Dublin Heuston    & 17:31 & Tullamore       & A706 Coach E Seat 16 & €11.49 & Flexible \\
\end{tabular}

\subsubsection*{Other Options}
As the ticket is flexible, later travel options are available:

\begin{tabular}{l l l l l}
15:45 & Drogheda MacBride & 16:39 & Dublin Connolly & Commuter to Dublin Pearse \\
18:30 & Dublin Heuston    & 19:31 & Tullamore       & InterCity to Westport \\
\\
17:47 & Drogheda MacBride & 18:42 & Dublin Connolly & Commuter to Dublin Pearse \\
20:30 & Dublin Heuston    & 21:24 & Tullamore       & InterCity to Galway Ceannt
\end{tabular}

\end{document}

This question has been largely answered in comments (not sure why people do that). The modified code (below) looks neat and tidy. However, some questions remain:

  1. This works only because the time columns (first and third) happen to work out at the same widths. If I were travelling in the morning (three-digit time rather than four-digit), this may not be the case. In that case, would I have to manually set widths there, too?
  2. It seems messy to have to set the widths manually each time. If I wanted to change the widths, I'd have to edit each table. (Not actually a problem here, with only three tables on a single-page document, but I'm trying to learn best practices, whatever they are, and this doesn't feel right.) Is there any way to tell LaTeX that a later table should simply match up with an earlier table?

Here's what I've got now. It has the changes suggested in the comments, and also a manual linebreak each side of the last table, to set it off from the surrounding paragraphs.

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{libertine}
\usepackage[margin=0.5in]{geometry}
\pagenumbering{gobble}
\begin{document}
\title{Drachenwald Summer Coronation}
\date{16th - 18th June 2017}
\maketitle

\section*{Travel from Tullamore}

Ticket collection number: XXX XXXXXXXX \\
Booking number: XXXXXXXX \\
Booking status: Confirmed

\subsection*{Payment Details}

\begin{tabular}{ l l l r }
Payment method & Reference     & Status    & Amount \\
CC3DS          & XXXXXXXX-XXXX & Confirmed & €49.96 \\
CC3DS          & XXXXXXXX-XXXX & Failed    & €49.96
\end{tabular}

\subsection*{Friday, 16th June: Tullamore to Drogheda}

\begin{tabular}{ l p{4cm} l p{4cm} l r l }
18:48 & Tullamore       & 19:54 & Dublin Heuston    & A717 Coach A Seat 41 & €11.49 & Flexible \\
20:50 & Dublin Connolly & 21:29 & Drogheda MacBride & A136 Coach D Seat 08 & €11.79 & Flexible
\end{tabular}

\subsection*{Sunday, 18th June: Drogheda to Tullamore}

\subsubsection*{Booked Ticket}

\begin{tabular}{ l p{4cm} l p{4cm} l r l }
14:40 & Drogheda MacBride & 15:15 & Dublin Connolly & A145 Coach D Seat 44 & €11.79 & Flexible \\
16:35 & Dublin Heuston    & 17:31 & Tullamore       & A706 Coach E Seat 16 & €11.49 & Flexible \\
\end{tabular}

\subsubsection*{Other Options}

As the ticket is flexible, later travel options are available:

\noindent
\\
\begin{tabular}{l p{4cm} l p{4cm} l}
15:45 & Drogheda MacBride & 16:39 & Dublin Connolly & Commuter to Dublin Pearse \\
18:30 & Dublin Heuston    & 19:31 & Tullamore       & InterCity to Westport \\
\\
17:47 & Drogheda MacBride & 18:42 & Dublin Connolly & Commuter to Dublin Pearse \\
20:30 & Dublin Heuston    & 21:24 & Tullamore       & InterCity to Galway Ceannt
\end{tabular}
\\

The location for the event is Newgrange Lodge. This is located just a moment’s walk from the Brú na Bóinne visitors centre, which is the gateway to Newgrange. Newgrange is a passage tomb that was built during the Neolithic period around 3200 BC, and is older than Stonehenge and the Egyptian pyramids.

The train and bus stations in Drogheda {\bf do not} have taxi ranks. Booking ahead is recommended. If you like to use an app, the local taxis use mytaxi. The site is 7.5km from Drogheda, and a taxi costs about €20.

\end{document}
  • Have a look at this and this. – TeXnician Jun 10 '17 at 17:09
  • 2
    you don't need utf8x or libertine, the standard utf8 option should be sufficient, or you can use \texteuro libertine is fine if that's the font you want but you don't need it for euro, most font families will have that. l and r columns adapt to the content, but if you want specified width use p{3cm} columns and then they will be the same in each table – David Carlisle Jun 10 '17 at 17:13
  • Regarding the indentation: Most classes do indent the first line of a paragraph (and the tabular-environment is considered part of a paragraph). Use \noindent to prevent paragraph indentation before the paragraph you want to be not indented (just above the \begin{tabular} in this case). – Skillmon Jun 10 '17 at 17:37
  • @DavidCarlisle. Setting the station name columns to \p{3cm} does seem to work. (Actually, I used p{4cm}, just to accentuate the relationship between the time and the station by pushing everything else further apart.) But presumably that relies on the fact that the time columns happen to work out at much the same width in all three tables. If my outward travels were in the morning (three-digit numbers instead of four), would this still work? – TRiG Jun 10 '17 at 17:40
  • you can set the widths of all of the columns – David Carlisle Jun 10 '17 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.