Generalvertically aligning text of an interview so it looks good

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
labiculum
Posts: 3
Joined: Wed Jun 25, 2008 2:11 pm

vertically aligning text of an interview so it looks good

Post by labiculum »

Hello there!

I'm a German student of English, and new in this forum. In the course of my studies I've made quite some use of LaTeX for term papers and the like, always relying on the grand default options of the package. Because of my affiliation with the Humanities I have never needed the more sophisticated features of LaTeX.

Nevertheless, now I am faced with a minor problem. And as simple as it may seem, I cannot find a workable solution for me: I am to transcribe an interview (a testimony recorded by the Shoah Foundation), and I want the result to look nice. Typing all the text is not a problem but how can I tell LaTeX to align it similar to an interview in a magazine?

At the moment each line begins with the name of the interviewer/interviewee, followed by a colon and a tab. After the tab I write down the person's statement. Then I insert an empty line and begin to write down the next name and statement. I want the names to appear below each other, aligned as in a table row, then a little whitespace, an then the row of statements flush left to a common, imagined, vertical line. That way names and statements would appear clearly separated. The thing is, I don't know how to do it without having to use a whole lot of markup. That's also why I'd rather not use the tabbing environment, littering my document with special characters at beginning, middle and end of every question or answer.

I hope my explanation's not too confused. Thanks for your help!
--Sebastian

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

vertically aligning text of an interview so it looks good

Post by localghost »

I'm not sure whether we are talking about horizontal or vertical alignment. But I worked out something in my laboratory that should match your ideas. Just define a new list environment in the preamble of your document.

Code: Select all

\newenvironment{xlist}[1]{%
  \begin{list}{}{%
    \settowidth{\labelwidth}{#1}
    \setlength{\labelsep}{0.5cm}
    \setlength{\leftmargin}{\labelwidth}
    \addtolength{\leftmargin}{\labelsep}
    \setlength{\rightmargin}{0pt}
    \setlength{\parsep}{0.5ex plus0.2ex minus0.1ex}
    \setlength{\itemsep}{0ex plus0.2ex}
    }
  }
{\end{list}}
This list has one parameter that determines the width of the label. I give you an example how to fill the list with contents.

Code: Select all

\documentclass[BCOR13mm,DIV15]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[ngerman,english]{babel}
\usepackage{txfonts}
\usepackage{blindtext}

\newenvironment{xlist}[1]{%
  \begin{list}{}{%
    \settowidth{\labelwidth}{#1}
    \setlength{\labelsep}{0.5cm}
    \setlength{\leftmargin}{\labelwidth}
    \addtolength{\leftmargin}{\labelsep}
    \setlength{\rightmargin}{0pt}
    \setlength{\parsep}{0.5ex plus0.2ex minus0.1ex}
    \setlength{\itemsep}{0ex plus0.2ex}
    }
  }
{\end{list}}

\begin{document}
  \begin{xlist}{Interviewee}
    \item[Interviewer:] \blindtext
    \item[Interviewee:] \blindtext
    \item[Interviewer:] \blindtext
    \item[Interviewee:] \blindtext
  \end{xlist}
\end{document}
The parameter for the xlist environment should always contain the longest name in the list of persons who participate in that interview. These names are then aligned to the right. You will see the effect very much better when typesetting your text. This is all of automatism I can offer. It goes without saying that you are free in the choice of the name for the new environment. In case of further questions, feel free to ask.

You can find further information about the used packages as well as their documentations on the servers of the CTAN (Comprehensive TeX Archive Network).


Best regards and welcome to the board
Thorsten¹
labiculum
Posts: 3
Joined: Wed Jun 25, 2008 2:11 pm

vertically aligning text of an interview so it looks good

Post by labiculum »

localghost wrote:I'm not sure whether we are talking about horizontal or vertical alignment. But I worked out something in my laboratory that should match your ideas.
It's a bit of both, I would say.

At first, thanks a lot for your time, figuring this out for me. Unfortunately, I have a follow-up question to ask. Part of this may be due to that I don't understand all the parameters you used in the newenvironment definition. I hope I'm not bothering you with this; it's just that I haven't gotten into such advanced (La)TeX usage, yet.

I attached a commented .tex file with an extract of the interview text, so you can get an impression of what I am trying to do. I guess the description of my problem was not too clumsy because the new environment you propose does just what I imagined. Except that the alignment does not work with all the possible parameters for xlist (I thought I'd stick to the name). The text is slightly misaligned in the resulting .pdf file. Depending on the parameter, either the first line of every statement is indented or some of the abbreviations on the name side jut out of the rest of the text corpus.

You have to look closely for that but as a perfectionist I do. You know, I would like to have names and statements (each in their "column") aligned left, so that the corpus appears to have clean vertical borders. If there are other ways to influence the reworked list environment, I would have no problems specifying a certain value for xlist. For example, half an inch from the left side of the name column to the left side of the statement column would be a good measure. I don't wanna use long names anyway because I consider typesetting the whole text with the twocolumn option once it's finished.

That's all for now. Again, thank you for reading this.

PS: I use TeX Live with Kile 1.9.3 on Ubuntu 7.10.
Attachments
interview.tex
(4.06 KiB) Downloaded 403 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

vertically aligning text of an interview so it looks good

Post by Juanjo »

labiculum wrote: the alignment does not work with all the possible parameters for xlist (I thought I'd stick to the name). The text is slightly misaligned in the resulting .pdf file. Depending on the parameter, either the first line of every statement is indented or some of the abbreviations on the name side jut out of the rest of the text corpus..
As localghost said, the argument of xlist should always contain the longest name. In your attached file, you put "ES:" in the argument, which is sligthly shorter than "GL:". This is the cause of the misalignments you observed.

I next propose a new version of xlist which simplifies things a little bit and satisfies one of your additional requirements (left alignment of names):

Code: Select all

\newenvironment{xlist}[1][\rule{0.75 cm}{0cm}]{%
  \begin{list}{}{%
    \settowidth{\labelwidth}{#1:}
    \setlength{\labelsep}{0.5cm}
    \setlength{\leftmargin}{\labelwidth}
    \addtolength{\leftmargin}{\labelsep}
    \setlength{\rightmargin}{0pt}
    \setlength{\parsep}{0.5ex plus 0.2ex minus 0.1ex}
    \setlength{\itemsep}{0 ex plus 0.2ex}
    \renewcommand{\makelabel}[1]{##1:\hfil}
    }
  }
{\end{list}}
Let us observe that the argument is no longer mandatory, but optional. If you omit it, the environment reserves 0.75 cm for the names (this is the width of the rule specified by \rule{0.75 cm}{0cm}). Likewise, the colon is automatically added to each name, so you shouldn't type it. I attached your file interview.tex, which shows the usage of this version of xlist. It also contains a graphic which mimics Figure 6.3 in Lamport's book "LaTeX: A document preparation system". I hope this may help you to understand the meaning of the parameters involved in the formatting of lists and to modify xlist to fit your needs.
Attachments
interview.tex
(8.69 KiB) Downloaded 696 times
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
labiculum
Posts: 3
Joined: Wed Jun 25, 2008 2:11 pm

Re: vertically aligning text of an interview so it looks good

Post by labiculum »

Wow! I really mean it. Thank you a hundred times, both of you. I never could have done that myself but with the additional tweaks it looks just the way I wanted it to. Plus, I have a flexible environment I can reuse. Thanks also for the visual explanation. It does make sense after looking at it for about an hour :D

Did I mention that the text looks absolutely gorgeous now? Yay!
Post Reply