% !TeX TS-program = lualatex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% File transcript.tex
%%
%% Documentation of transcript
%%
%% This file is part of the transcript LaTeX package
%%
%% Author:
%% ================
%% Juergen Spitzmueller <juergen@spitzmueller.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer of this work is Juergen Spitzmueller.
%%
%% Code repository and issue tracker: https://codeberg.org/jspitz/transcript
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Note: * this requires LaTeX 2025/06 at least!
\DocumentMetadata{
	lang=en-US,
	tagging=on,
	pdfstandard={UA-2}
}
\documentclass[american]{article}

\usepackage[osf]{libertine}
\usepackage[mono=true,sans=false,serif=false,TT={Scale=0.75}]{dejavu-otf}
\usepackage{unicode-math}
\setmathfont{Libertinus Math}

\usepackage{transcript}

\usepackage{url}
\usepackage[bookmarks=true,
			bookmarksnumbered=false,
			bookmarksopen=false,
			breaklinks=false,
			pdfborder={0 0 0},
			backref=false,
			colorlinks=false
]{hyperref}
\hypersetup{%
	pdftitle={The transcript manual},
	pdfauthor={Jürgen Spitzmüller},
	pdfkeywords={latex,linguistics}
}

\usepackage{microtype}

% Tweak the TOC (make it more compact)
\usepackage{tocloft}
\setlength{\cftbeforesecskip}{0pt}
\renewcommand{\cfttoctitlefont}{\normalsize\bfseries}
\renewcommand{\cftsecfont}{\small}
\renewcommand{\cftsecpagefont}{\small}
\renewcommand{\cftsubsecfont}{\small}
\renewcommand{\cftsubsecpagefont}{\small}
\renewcommand{\cftsubsubsecfont}{\footnotesize}
\renewcommand{\cftsubsubsecpagefont}{\footnotesize}
\tocloftpagestyle{empty}

\setcounter{tocdepth}{1}

\usepackage{babel}

\usepackage{listings}
\lstset{%
	language={[LaTeX]TeX},
	basicstyle=\small\ttfamily,
	keywordstyle=\ttfamily\bfseries,
	commentstyle=\ttfamily\itshape,
	stringstyle=\ttfamily,
	tabsize=4,
	frame=single}

% markup
\newcommand*\jmacro[1]{\textbf{\texttt{#1}}}
\newcommand*\jenv[1]{\textbf{\texttt{#1}}}
\newcommand*\jcsmacro[1]{\jmacro{\textbackslash{#1}}}
\newcommand*\joption[1]{\textbf{\texttt{#1}}}
\newcommand*\jfmacro[1]{\texttt{#1}}
\newcommand*\jfenv[1]{\texttt{#1}}
\newcommand*\jfcsmacro[1]{\jfmacro{\textbackslash{#1}}}
\newcommand*\jparam[1]{⟨#1⟩}

% Strings
\newcommand*{\trs}{\textsf{transcript}}
\newcommand*{\Trs}{\textsf{Transcript}}

%
% Titling
%
\def\pversion{Version 1.0}
\def\pdate{December 4, 2026}

\title{\textbf{The \trs\ Package\\\Large Typesetting Conversation}}
\author{J\"urgen Spitzm\"uller\thanks{Please report issues via \protect\url{https://codeberg.org/jspitz/transcript}}}

\date{\pversion, \pdate}

\begin{document}

\maketitle

\begin{abstract}
\noindent This package provides an environment and some helper macros to typeset
conversation transcripts as used in conversation analysis and interactional
linguistics. The package employs a tabbing-like interface to align turns and
turn overlaps appropriately (without the need to manually set and steer tabs).
Other features include numbered captions, automatic line numbers,
fancy cross references, labels, interlinear translation and a list of transcripts.

Although the author has most experience with the GAT\,2
transcription convention \cite{gat2}, the package is not tied to a specific convention.
The package also supports the generation of semantically tagged PDF/UA-2.
\end{abstract}

\medskip
\tableofcontents


\section{Introduction}\label{sec:intro}

This is the documentation for \MakeLowercase{\pversion}
of \trs\ (\pdate), which is a \LaTeX\ package providing macros
for typesetting conversation transcripts as common in interactional
linguistics and conversation analysis.

Conversation transcripts are graphic representations of spoken interaction.
They display, in a conventionalized form, an interactional flow, segmented
in \emph{turns}, including intonation, pauses, overlaps, etc., for analytical purposes
(in fact, transcripts are themselves already part of the analysis).

Here is an example of such a transcript, employing the GAT\,2 \cite{gat2}
conventions:

\begin{transcript}[caption={A World of Pain},
	               postcaption={Speakers: WAL = Walter Sobchak, SMO = Smokey, DUD = The Dude},
	               posttext={(The Big Lebowski, 1998, 00:25:15--00:26:10)},
	               linenumbers, widestactor=DUD, widestnumber=10, padzeros, actorsep=:]
\Turn{WAL}  °hh <<f> \Up !O!ver the line.>\\
            (0.6)
\Turn{SMO}  \Up huh?\\
            (0.4)
\Turn{WAL}  i'm \Up SORry smokey;\\
            you were \Up !O!ver the line that's a \OL{foul.}
\Turn{SMO}                                       \OL*{bull}!SHIT!;\\
            mark it \Up EIGHT \OL{dude.~~}
\Turn{WAL}                   \OL*{ex\Up CUSE} me;\\
            (0.3)
            <<len> mark it \Up !ZE!ro.>\\
            (0.5)\\
            next !FRAME!.
\Turn{SMO}  \OL{°h bullshit walter~}
\Turn{WAL}  \OL*{<\/<f> \Up !SMO!key this} is not 'nam;\\
            this is \Up BOWLing there are !RULES!.>
\Turn{DUD}  <<p, all> hey walter come on\_>\OL[=]{it's just\_}
\Turn{WAL}                                 \OL*[=]{you mark} that frame an \Up EIGHT-\\
            and you're entering a world of PAIN.\\
            (0.7)
\Turn{SMO}  i'm \Up NOT \OL{marking it ze:ro-}
\Turn{WAL}             \OL*{<<ff> a world of} \Dn !PAIN!::.>
\end{transcript}
%
Typesetting such transcripts with \LaTeX\ is not straightforward, since
the required alignment and layout cannot be done easily with
classic \LaTeX\ means. This package addresses this gap.


\section{General approach and use}\label{sec:use}

To use \trs, load the package as usual by adding the command 
\begin{lstlisting}
\usepackage[<options>]{transcript}
\end{lstlisting}
to your document preamble.

\subsection*{Package options}

The package has the following options to customize its behavior.
These can be either passed as optional argument when loading the package (see above) or via the command
\begin{lstlisting}[moretexcs={TranscriptOptions}]
\TranscriptOptions{<options>}
\end{lstlisting}
%
which can be used anywhere in the preamble or body of the document and will
apply to all subsequent transcripts unless they change options locally.

\subsubsection*{Spacing options}

\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{beforeenv=\jparam{length}}] Default: \verb|\topsep|\\
		Defines the vertical distance before the \jenv{transcript} environment.
	\item[\joption{afterenv=\jparam{length}}] Default: \verb|\topsep|\\
		Defines the vertical distance after the \jenv{transcript} environment.
	\item[\joption{belowcaptionskip=\jparam{length}}] Default: \verb|0.25\baselineskip|\\
		Defines the vertical distance between the caption and the transcript.
	\item[\joption{abovepostcaptionskip=\jparam{length}}] 
	    Default: \verb|0pt|\\
	    Defines the vertical distance between the caption and the optional post caption text.
	\item[\joption{aboveposttextskip=\jparam{length}}] 
	    Default: \verb|0.25\baselineskip|\\
	    Defines the vertical distance between the transcript and the optional post text.
	\item[\joption{widestnumber=\jparam{number}}]
		Default: empty\\
		Sets the widest line number for proper alignment. Since
		a monospaced font is used (by default), only the number
		of digits matters here (so \verb|100| is equal to \verb|387|).
	\item[\joption{lnskip=\jparam{length}}]
		Default: \verb|0.75em|\\
		Defines the horizontal distance after line numbers.
	\item[\joption{widestactor=\jparam{text}}]
		Default: \verb|X|\\
		Defines the widest actor (interlocutor) in the transcript for proper alignment.
		Since a monospaced font is used (by default), only the number of letters matters here.
	\item[\joption{actorskip=\jparam{length}}]
		Default: \verb|0.75em|\\
		Defines the horizontal distance after (inter)actor.
\end{description}


\subsubsection*{Font setting options}

\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{font=\jparam{font setting}}] Default: \verb|\ttfamily|\\
		Sets the font of the transcript text.
	\item[\joption{captionfont=\jparam{font setting}}]
	    Default: \verb|\rmfamily|\\
		Sets the font of the transcript caption.
	\item[\joption{captionlabelfont=\jparam{font setting}}]
		Default: \joption{captionfont} + \verb|\bfseries|\\
		Sets the font of the transcript caption label.
	\item[\joption{postcaptionfont=\jparam{font setting}}]
		Default: same as \joption{captionfont}\\
		Sets the font of the optional post caption text.
	\item[\joption{posttextfont=\jparam{font setting}}]
		Default: same as \joption{captionfont}\\
		Sets the font of the optional post text.
	\item[\joption{lnfont=\jparam{font setting}}]
		Default: same as \joption{font}\\
		Sets the font of the line numbers.
	\item[\joption{actorfont=\jparam{font setting}}]
		Default: same as \joption{font}\\
		Sets the font for the (inter)actor.
	\item[\joption{trlfont=\jparam{font setting}}]
		Default: \joption{font} + \verb|\itshape|\\
		Sets the font for the interlinear translation.
\end{description}


\subsubsection*{Line numbering options}

\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{linenumbers=\jparam{true|false}}]
	    Default: \verb|false|\\
		Activates automatic line numbers.
	\item[\joption{padzeros=\jparam{true|false}}]
		Default: \verb|false|\\
		If \verb|true|, zeros are prepended to the line numbers if
		they have less digits than \joption{widestnumber}.
	\item[\joption{padref=\jparam{true|false}}]
		Default: \verb|true|\\
		If \verb|true| (and \joption{padzeros} is active), leading zeros are
		also preserved in cross-references to transcript lines. Set to
		\verb|false| if line numbers in prose references should appear without
		leading zeros while remaining zero-padded in the transcript margin.
\end{description}
%
For spacing of line numbers, refer to the \emph{spacing options} above.

\subsubsection*{String and delimiter options}

\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{transcriptname=\jparam{text}}] 
		Default: \emph{Transcript}\\
		Sets the name of the transcript as used for caption label.
	\item[\joption{transcriptsname=\jparam{text}}]
		Default: \emph{Transcripts}\\
		Sets the plural form of \joption{transcriptname} as used by
		\jcsmacro{tref} and \textsf{zref-clever}.
	\item[\joption{listtranscriptname=\jparam{text}}] 
		Default: \emph{List of Transcripts}\\
		Sets the header of the list of transcripts.
	\item[\joption{linename=\jparam{text}}]
		Default: \verb|l.|\\
		Sets the singular prefix used for line references in \jcsmacro{tlref}
		and \textsf{zref-clever}.
		
		Note: If \textsf{zref-clever} is loaded, its own localized line strings are used
		unless linename/linesname is explicitly set.
	\item[\joption{linesname=\jparam{text}}]
		Default: \verb|ll.|\\
		Sets the plural prefix used for multi-line references in \jcsmacro{tlref}
		and \textsf{zref-clever}.
		
		Note: If \textsf{zref-clever} is loaded, its own localized line strings are used
		unless linename/linesname is explicitly set.
	\item[\joption{actorsep=\jparam{text}}]
		Default: empty\\
		Define a separator (e.g., \verb|:|) following the (inter)actor.
	\item[\joption{refsep=\jparam{separator}}]
		Default: \verb|\nobreakspace|\\
		Sets the separator inserted between \joption{transcriptname}/\joption{transcriptsname}
		and the transcript number in \jcsmacro{tref} (and \textsf{zref-clever}).
	\item[\joption{linerefsep=\jparam{separator}}]
		Default: \verb|\,|\\
		Sets the separator inserted between \joption{linename}/\joption{linesname}
		and the line number in \jcsmacro{tlref} (and \textsf{zref-clever}).
	\item[\joption{olstart=\jparam{text}}]
		Default: \verb|[|\\
		Define the starting character of overlaps.
	\item[\joption{olend=\jparam{text}}]
		Default: \verb|]|\\
		Define the terminating character of overlaps.
\end{description}

\subsubsection*{Typography options}
\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{texligatures=\jparam{true|false}}]
		Default: \verb|false|\\
		By default, standard \TeX\ ligatures (such as \verb|<<| \textrightarrow\ \guillemotleft,
		\verb|>>| \textrightarrow\ \guillemotright\ or \verb|--| \textrightarrow\ --, 
		which are usually not desired
		in transcripts) are disabled inside the \jenv{transcript} environment across
		both Unicode and classic engines. Set to
		\verb|true| if you want standard \TeX\ ligatures to remain active.
\end{description}


\section{The transcript environment}\label{sec:transenv}

The main environment which you use in order to input transcripts is
\begin{lstlisting}
\begin{transcript}[<options>]
...
\end{transcript}
\end{lstlisting}
%
This will switch to the transcript context, using the options either globally or locally set. The list of options this environment takes is identical to the global options described in sec.~\ref{sec:use}, with the exception of \joption{listtranscriptname}, which can only be set globally.

Also, the environment provides for the following additional options which only make sense for individual transcripts:
\begin{description}
	\setlength\itemsep{0pt}
	\item[\joption{caption=\jparam{text}}]
	      Here you set the caption of the current transcript.
	\item[\joption{label=\jparam{id}}]
	      Adds a label if you want to refer to the transcript.
	\item[\joption{postcaption=\jparam{text}}]
	      Here you might set additional text which is printed
	      on its own line (and maybe with a different font) below the caption (e.g., additional contextualization information).
	\item[\joption{posttext=\jparam{text}}]
	      Here you might set additional text which is printed
	      on its own line (and maybe with a different font) below the transcript (e.g., additional remarks).
	\item[\joption{startln=\jparam{number}}]
	      Default: \verb|1|\\
	      The line number this transcript starts with if \joption{linenumbers} is true.
\end{description}
%
Within the \jenv{transcript} environment, the following macros are provided for proper setup:
\begin{description}
	\setlength\itemsep{0pt}
	\item[\jcsmacro{Turn\{<actor>\}}]
	     starts a new turn of the given actor. This automatically also
	     starts a new line in the transcript.
	\item[\jcsmacro{OL[<pretext>]\{<text>\}}]
	     marks a passage that overlaps with a following. It automatically inserts the delimiters
	     (\verb|[| and \verb|]| by default) and records the horizontal position of start and end.
	     
	     The optional argument can be used to place text right before
	     the opening delimiter, so you might use \verb|\OL[=]{overlap}|
	     to get a latched overlap, \verb|=[overlap]|.
	     
	     Multiple overlaps might occur sequentially within a single multi-line turn.
	     Each \jcsmacro{OL} records its start and end positions in sequence.
	\item[\jcsmacro{OL*[<pretext>]\{<text>\}}]
	     marks a passage that overlaps with a previous (as defined by \jcsmacro{OL}).
	     It automatically inserts the delimiters (\verb|[| and \verb|]| by default) and aligns with the former
	     overlapping passage. For the optional argument, see the description of \verb|\OL| above.
	     
	     If multiple overlaps have been recorded within a turn, subsequent \jcsmacro{OL*} commands align to
	     those recorded positions in matching order.
	\item[\jcsmacro{OLS[<pretext>]}]
		marks the begin of a longer overlapping passage.
		It automatically inserts the starting delimiter (\verb|[| by default) and records the horizontal position of start.
		This is preferrable to \jcsmacro{OL} for overlaps that run over a single turn.
		For the optional argument, see the description of \verb|\OL| above.
		
		Multiple overlaps might occur sequentially within a single multi-line turn.
		Each \jcsmacro{OLS} records its start position in sequence.
	\item[\jcsmacro{OLS*[<pretext>]}]
		automatically inserts the starting delimiter (\verb|[| by default) and aligns with the former
		overlapping passage. 
		This is preferrable to \jcsmacro{OL*} for overlaps that run over a single turn.
		For the optional argument, see the description of \verb|\OL| above.
		
		If multiple overlaps have been recorded within a turn, subsequent \jcsmacro{OLS*} commands align to
		those recorded positions in matching order.
	\item[\jcsmacro{OLE}]
		marks the end of a longer overlapping passage.
		It automatically inserts the ending delimiter (\verb|]| by default) and records the horizontal position of end.
		This is preferrable to \jcsmacro{OL} for overlaps that run over a single turn.
		
		Multiple overlaps might occur sequentially within a single multi-line turn.
		Each \jcsmacro{OLE} pair records its end position in sequence.
	\item[\jcsmacro{OLE*}]
		automatically inserts the ending delimiter (\verb|]| by default) and and aligns with the end of the former
		overlapping passage. 
		This is preferrable to \jcsmacro{OL*} for overlaps that run over a single turn.
		
		If multiple overlaps have been recorded within a turn, subsequent \jcsmacro{OLE*} commands align to
		those recorded positions in matching order.
	\item[\jcsmacro{TrSkip\{<number>\}}]
	     adds an ellipsis \texttt{[\ldots\unkern]} on its own line
	     and increases the line number for subsequent lines to the number
	     given in the argument.
	\item[\jcsmacro{TTR\{<text>\}}]
	     starts an interlinear translation (on its own line) typeset in the
	     font defined for such translations. Use \verb|\\*| for manual line breaks within such translations.
\end{description}
%
Note that within the environment, lines are not broken automatically, so
you need to break them manually if they come out too long.
In order to do so, there are two options:
\begin{description}
	\setlength\itemsep{0pt}
	\item[\jcsmacro{\textbackslash}]
	    starts a new line within a turn. The new line gets its own line number 	and is aligned properly.
	\item[\jcsmacro{\textbackslash*}]
		same as the above but does not add a new line number. This is for line breaks which are only necessary for print.
\end{description}


\section{Special symbols}

The following convenience commands for frequently used symbols are provided within the \jenv{transcript}
environment:
\begin{description}
	\setlength\itemsep{0pt}
	\item[\jcsmacro{Up}] An upwards pointing arrow (\texttt{\textuparrow}).
	\item[\jcsmacro{Dn}] A downwards pointing arrow (\texttt{\textdownarrow}).
	\item[\jcsmacro{Mark}] A rightwards pointing arrow (\texttt{\textrightarrow})
	                     placed in the left margin next to the current line.
	                     This is often used to highlight particular lines.
	                     The command can be used anywhere in that line.
\end{description}
%
The following simple example showcases these macros:
\begin{transcript}[caption={Arrows}]
	\Turn{A} We go \Up UP and \Dn down,
	\Turn{B} \Mark and THIS line is marked.
\end{transcript}
%
The code is:
\begin{lstlisting}[moretexcs={Turn,Up,Dn,Mark}]
\begin{transcript}[caption={Arrows}]
	\Turn{A} We go \Up UP and \Dn down,
	\Turn{B} \Mark and THIS line is marked.
\end{transcript}
\end{lstlisting}


\section{Cross-reference convenience macros}

To refer to a transcript or individual line numbers in your text, you can use
standard \verb|\ref|, which will produce a simple numeric reference to the transcript
(via the ID set in the \joption{label} option) or the line in which a \verb|\label|
command has been placed.

For more fancy references, \trs\ provides the convenience macros \jcsmacro{tref} and
\jcsmacro{tlref}.
Both accept either a single label or a comma-separated list
of labels (with starred variants \jcsmacro{tref*} and \jcsmacro{tlref*}
suppressing hyperlinks):
%
\begin{description}
	\setlength\itemsep{0pt}
	\item[\jcsmacro{tref\{label\}}] outputs ``Transcript 1'', using \joption{transcriptname}.
	        If multiple transcripts are referred to (\verb|\tref{label,label2}|), the plural
			\joption{transcriptsname} is used, the numbers are separated by comma or \emph{and}.
	\item[\jcsmacro{tlref\{label\}}] outputs ``l.\,1'', using \joption{linename}.
			This automatically preserves zero-padding unless \joption{padref=false} is set;
			passing multiple comma-separated line labels (e.g., \verb|\tlref{label,label1}|)
			switches to	the plural prefix (\joption{linesname}).
\end{description}
%
If the \textsf{zref-clever} package \cite{zref-clever} is loaded, \trs\ automatically registers
the \texttt{transcript} and \texttt{tsline} counters with it, so \verb|\zcref|
can be used directly (and \jcsmacro{tref}/\jcsmacro{tlref} delegate to
\verb|\zcref| under the hood, including range compression and localization specifics
which aren't supported by \trs\ out of the box).


\section{Examples}

\subsection{Basic example}

Here is the most simple application (without caption):

\begin{transcript}
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
%
This has been coded as
\begin{lstlisting}[moretexcs={Turn}]
\begin{transcript}
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
\end{lstlisting}

\subsection{Line numbers}

If we want line numbers, we do
\begin{lstlisting}[moretexcs={Turn}]
\begin{transcript}[linenumbers]
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
\end{lstlisting}
%
and get:
\begin{transcript}[linenumbers]
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
%
In the following example, we employ some line number options to get started at a particular number
and add padding zeros. We also add a caption and an actor separator:
\begin{transcript}[linenumbers,
	               startln=33,
	               widestnumber=100,
	               padzeros,
	               actorsep={:},
	               caption={First encounters}]
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
%
The code for this is:
\begin{lstlisting}[moretexcs={Turn}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   actorsep={:},
                   caption={First encounters}]
	\Turn{A} HEy did you SEE the TRANScript package?
	\Turn{B} YEs i DID;
\end{transcript}
\end{lstlisting}


\subsection{Adjust alignment}

If lines are being broken by \verb|\\| or \verb|\\*|, it is important to specify
the widest actor for proper alignment, as we do here:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={When the line breaks}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst been reLEAsed,
	\Turn{Mary} YEs i DID;
\end{transcript}
%
The code for this is:
\begin{lstlisting}[moretexcs={Turn}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={When the line breaks}]
    \Turn{Paul} HEy did you SEE the TRANScript package?\\
                It has JUst been reLEAsed,
    \Turn{Mary} YEs i DID;
\end{transcript}
\end{lstlisting}

\subsection{Overlaps}

Now let's have a look at overlaps. As explained in sec.~\ref{sec:transenv},
the \jcsmacro{OL} and \jcsmacro{OL*} macros are provided for precisely this essential task.
Here is an example:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Overlaps}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,}
	\Turn{Mary}             \OL*{YEs i DID;}
\end{transcript}
%
This has been coded as follows:
\begin{lstlisting}[moretexcs={Turn,OL}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Overlaps}]
    \Turn{Paul} HEy did you SEE the TRANScript package?\\
                It has JUst \OL{been reLEAsed,}
    \Turn{Mary}             \OL*{YEs i DID;}
\end{transcript}
\end{lstlisting}
%
Note that the alignment by blanks here is done simply for the alignment
in the input. It is not necessary for output alignment (\LaTeX\ eats multiple spaces anyway).

Having written that, if the second overlap is longer than the first, you need to add spaces
in the first to adjust its length to the second, as in
\begin{lstlisting}[moretexcs={Turn,OL}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Adjusted overlaps}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
\end{transcript}
\end{lstlisting}
%
in order to get:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Adjusted overlaps}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
\end{transcript}
%
If multiple blanks for adjustment are needed, as in the example, multiple simple spaces do not work
(since, as elaborated above, \LaTeX\ eats or `gobbles' them). Use protected spaces (\verb|~|)
(as we did in the example) or normal spaces (\verb*|\ |) in this case.

Multiple overlaps within a turn are supported, \trs\ sequentially processes them:
\begin{lstlisting}[moretexcs={Turn,OL}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Multiple overlaps within a turn}]
	\Turn{Paul} HEy did you SEE the \OL{new reLEAse} of that\\*
	            \OL{TRANscript} package we talked aBOUT?
	\Turn{Mary}                     \OL*{uh HUH;~~~}\\*
		        \OL*{YEs i DID;~~}
\end{transcript}
\end{lstlisting}
%
This prints as expected:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Multiple overlaps within a turn}]
	\Turn{Paul} HEy did you SEE the \OL{new reLEAse} of that\\*
	            \OL{TRANscript} package we talked aBOUT?
	\Turn{Mary}                     \OL*{uh HUH;~~~}\\*
	            \OL*{YEs i DID;~~}
\end{transcript}
%
For longer overlaps extending across line breaks or multiple turns, use
\jcsmacro{OLS} and \jcsmacro{OLS*} to mark the start as well as
\jcsmacro{OLE} and \jcsmacro{OLE*} to mark the end of the overlapping stretch:
\begin{lstlisting}[moretexcs={Turn,OLS,OLE}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Multi-line overlaps}]
	\Turn{Paul} HEy did you SEE the \OLS TRANScript package
	\Turn{Mary}                     \OLS*YEs i have SEEN it
	\Turn{Paul} that has JUst been reLEAsed,\OLE
	\Turn{Mary} and i LIKE it a LOT;\OLE*
\end{transcript}
\end{lstlisting}
%
to get:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Multi-line overlaps}]
	\Turn{Paul} HEy did you SEE the \OLS TRANScript package
	\Turn{Mary}                     \OLS*YEs i have SEEN it
	\Turn{Paul} that has JUst been reLEAsed,\OLE
	\Turn{Mary} and i LIKE it a LOT;\OLE*
\end{transcript}


\subsection{Omissions}

If parts of your transcripts are to be omitted, use the \jcsmacro{TrSkip}
macro as demonstrated here:
\begin{lstlisting}[moretexcs={Turn,OL,TrSkip}]
\begin{transcript}[linenumbers,
		           startln=33,
		           widestnumber=100,
		           padzeros,
		           widestactor={Mary},
		           actorsep={:},
		           caption={Omissions}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
		        It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
	\TrSkip{44}
	\Turn{Mary} but i will stICK to what i knOW;
\end{transcript}
\end{lstlisting}
%
The result is:
\begin{transcript}[linenumbers,
		           startln=33,
		           widestnumber=100,
		           padzeros,
		           widestactor={Mary},
		           actorsep={:},
		           caption={Omissions}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	           It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
	\TrSkip{44}
	\Turn{Mary} but i will stICK to what i knOW;
\end{transcript}

\subsection{Postcaption and posttext}

The \joption{postcaption} option can be used to add additional text under the caption on its own line:
\begin{lstlisting}[moretexcs={Turn,OL,TrSkip}]
\begin{transcript}[linenumbers,
		           startln=33,
		           widestnumber=100,
		           padzeros,
		           widestactor={Mary},
		           actorsep={:},
		           caption={Postcaption},
		           postcaption={Conversation of Paul and Mary in a bar}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
		        It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
\end{transcript}
\end{lstlisting}
%
The result is:
\begin{transcript}[linenumbers,
		           startln=33,
		           widestnumber=100,
		           padzeros,
		           widestactor={Mary},
		           actorsep={:},
		           caption={Postcaption},
		           postcaption={Conversation of Paul and Mary in a bar}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,~~~~~}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
\end{transcript}
%
Similar to \joption{postcaption}, \joption{posttext} adds an explanatory note or source reference below
the transcript:
\begin{lstlisting}[moretexcs={Turn}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Post-transcript note},
                   posttext={Recorded on November 24, 2026.}]
	\Turn{Paul} HEy did you SEE the TRANScript package?
	\Turn{Mary} YEs i DID;
\end{transcript}
\end{lstlisting}
%
This comes out as follows:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Post-transcript note},
                   posttext={Recorded on November 24, 2026.}]
	\Turn{Paul} HEy did you SEE the TRANScript package?
	\Turn{Mary} YEs i DID;
\end{transcript}


\subsection{Labels and cross references}

In order to refer to a transcript in your text, assign a label via the \joption{label} option:
\begin{lstlisting}[moretexcs={Turn,OL}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={A labelled conversation},
                   label={foo}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,~~~~~}\label{bar}
	\Turn{Mary}             \OL*{YEs i have SEEN it;}
\end{transcript}
\end{lstlisting}
%
in order to get:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={A labelled conversation},
                   label={foo}]
	\Turn{Paul} HEy did you SEE the TRANScript package?\\
	            It has JUst \OL{been reLEAsed,~~~~~}\label{bar}
	\Turn{Mary}            \OL*{YEs i have SEEN it;}
\end{transcript}
%
Then refer to it via \verb|\transcriptname~\ref{foo}|: \transcriptname~\ref{foo}.
You can also refer to single lines if automatic line numbers are enabled.
Just place a \verb|\label| somewhere in that line (as we have done in the above
example in line~\ref{bar}) and add a \verb|\ref| to it (which is how the line
reference in the previous parenthesis has been done).

Using the convenience macros of \trs, we could also write \verb|\tref{foo}| to the same effect:
\tref{foo}, as well as \verb|\tlref{bar}|, generating \tlref{bar}.



\subsection{Interlinear translations}

The last thing to showcase here are interlinear translations. These can be done
comfortably by means of the \jcsmacro{TTR} macro:
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Interlinear translations}]
	\Turn{Paul} HEy hast du das tranSCRIPT paket geSEHN?
	       \TTR{HEy did you SEE the TRANScript package?}\\
	            Es wurde \OL{geRADe verÖFFentlicht,}
	       \TTR{It has \OL*{JUst been reLEAsed,}}
	\Turn{Mary}        \OL*{ja HAB ich gesEHN;}
	       \TTR{       \OL*{YEs i have SEEN it;}}
\end{transcript}
%
The code for this is:
\begin{lstlisting}[moretexcs={Turn,TTR,OL}]
\begin{transcript}[linenumbers,
                   startln=33,
                   widestnumber=100,
                   padzeros,
                   widestactor={Mary},
                   actorsep={:},
                   caption={Interlinear translations}]
	\Turn{Paul} HEy hast du das tranSCRIPT paket geSEHN?
	       \TTR{HEy did you SEE the TRANScript package?}\\
	            Es wurde \OL{geRADe verÖFFentlicht,}
	       \TTR{It has  \OL*{JUst been reLEAsed,}}
	\Turn{Mary}         \OL*{ja HAB ich gesEHN;}
	       \TTR{        \OL*{YEs i have SEEN it;}}
\end{transcript}
\end{lstlisting}
%
Note here how translation is interspersed with the original line,
that is manual line breaks (\verb|\\| or \verb|\\*|) are only done
within an original line (or with \verb|\\*| within the translation
line, if needed), as the \jcsmacro{TTR} command itself starts a new line.

If a line break occurs in a turn that has a translation, do it \emph{after}
the translation of that line (as in the example above).


\section{List of Transcripts}

In order to output a list of transcripts, use the command
\begin{lstlisting}[moretexcs={listoftranscripts}]
\listoftranscripts
\end{lstlisting}
%
The output for the transcripts used in this manual is:

\listoftranscripts

\noindent Observe how the caption-less transcripts are only listed by their numbers.


\section{Finger-painting transcript line positions}

Since the \jenv{transcript} environment employs a (modified)
\jenv{tagging} environment, there are also commands for manually
recording and navigating to positions on the transcript line (or tab stops,
in \jenv{tabbing} terminology). These are akin to the commands known
from \jenv{tabbing} (or the \textsf{Tabbing} package) but with its own syntax
(that, like \textsf{Tabbing}, do not interfere with \LaTeX's diacritic macros):
\begin{description}
	\setlength\itemsep{0pt}
	\item[\jcsmacro{TLP=}] records the current position in the transcript line.
	\item[\jcsmacro{TLP>}] moves the following text to the next recorded position in
	                       the line (relative to the current position).
	\item[\jcsmacro{TLP<}] moves the following text to the previous recorded position in
	                       the line (relative to the current position).
	\item[\jcsmacro{TLP+}] indents the following line to the next recorded position.
	\item[\jcsmacro{TLP-}] unindents the following line to the previous recorded position (if available).
	\item[\jcsmacro{TLP'}] moves everything to the left of \jcsmacro{TLP'} (within the current column)
	                       so that it ends right at the previous recorded position.
	                       This is commonly used for right-aligning numbers or labels in a column.
	\item[\jcsmacro{TLP`}] moves everything after \jcsmacro{TLP`} all the way to the right margin
	                       of the page/line. It must be the last command on that line (before \verb|\\|
	                       or \verb|\\*|).
\end{description}
%
The \jcsmacro{OL} macros internally also use these mechanisms, so the commands above might be used for
correction if the automatic position comes out wrong.


\section{Tagged PDF}

\Trs\ supports \LaTeX's tagging facilities to provide for accessible (PDF/UA-1 and
PDF/UA-2 compliant) output.\footnote{PDF tagging needs to be enabled via
	\jcsmacro{DocumentMetadata} and validated with a suitable tool such as \textsf{veraPDF}.
	Please refer to the \textsf{tagpdf} documentation \cite{tagpdf} for details.}

As far as tagging is concerned, the \jenv{transcript} environment differs significantly from
the standard \jenv{tabbing} or \jenv{Tabbing} environments on which it builds
for the print output.
Although \jenv{tabbing} and \jenv{Tabbing} do produce sensibly tagged output,
the output is not suitable for conversation transcripts.
\Trs\ is adapted for this purpose.

In what follows, we document how transcripts are being tagged.


\subsection{Structure tree mapping}

Each \jenv{transcript} environment is represented as a semantic \texttt{<Table>}
element rather than an artificial list structure (which standard \jenv{tabbing}
or \jenv{Tabbing} would produce via \jenv{trivlist}):

\begin{itemize}
	\setlength\itemsep{0pt}
	\item \textbf{Caption (\texttt{<Caption>}):} The transcript heading is tagged
			as a \texttt{<Caption>} inside the \texttt{<Table>}. If \texttt{postcaption}
			is specified, it is wrapped in a nested \texttt{<Div>} within the \texttt{<Caption>}.
	\item \textbf{Headerless Grid:} No \texttt{<THead>} or \texttt{<TH>} header row
			is emitted, avoiding redundant column announcements on braille displays and
			screen readers while navigating turns.
	\item \textbf{Transcript Lines (\texttt{<TR>}):} Each primary transcript line
			(started by \verb|\Turn| or \verb|\\|), skipped-line indicator (\verb|\TrSkip|),
			and interlinear translation (\verb|\TTR|) forms its own table row (\texttt{<TR>}).
	\item \textbf{Columns (\texttt{<TD>}):}
	\begin{enumerate}
		\item \emph{Line number and margin mark:} Emitted in the first \texttt{<TD>}
				(containing the line number if \texttt{linenumbers=true} and/or the
				\texttt{\textrightarrow} symbol if \verb|\Mark| is used on that line;
				empty otherwise and in \verb|\TTR| rows).
		\item \emph{Actor:} Emitted in the second \texttt{<TD>} (empty on
				continuation lines introduced with \verb|\\| or in \verb|\TTR| rows).
		\item \emph{Utterance and Overlaps:} On primary transcript lines (started by
				\verb|\Turn| or \verb|\\|), non-overlapping utterance segments and
				overlapping speech (\verb|\OL| / \verb|\OL*| as well as multi-line
				stretches delimited by \verb|\OLS| and \verb|\OLE|) are placed into separate
				\texttt{<TD>} cells so assistive technologies can distinguish simultaneous
				talk from surrounding speech. Overlaps occurring within continuation lines
				(\verb|\\*|) remain inside the active cell of the wrapped turn.
	\end{enumerate}
	\item \textbf{Continuation Lines (\texttt{\textbackslash\textbackslash*}):}
			Visual line breaks marked with \verb|\\*| keep both the current \texttt{<TR>}
			and the active \texttt{<TD>} open, allowing wrapped turns to be read as a
			single uninterrupted unit. Visual indentation padding is marked as an
			\texttt{Artifact}.
		\item \textbf{Post-Transcript Text (\texttt{<P>}):} If \texttt{posttext} is specified,
			it is emitted immediately after the closing \texttt{</Table>} tag and tagged as a
			standard paragraph (\texttt{<P>}), keeping supplementary notes outside the tabular grid.
	
\end{itemize}

\subsection{Dynamic column spanning and auxiliary file passes}

Because rows containing overlaps (\verb|\OL|) split the utterance into multiple
\texttt{<TD>} cells while regular rows contain a single utterance cell,
\texttt{transcript} records the maximum column count and cell-boundary positions
per transcript in the \texttt{.aux} file. Remaining cells in shorter rows
automatically receive the appropriate \texttt{/ColSpan} table attribute so that
every \texttt{<TR>} spans an identical number of columns.

\textbf{Note:} Two \LaTeX\ compilation runs are required whenever transcript
structures or overlap counts change so that \texttt{/ColSpan} attributes
stabilize across the \texttt{.aux} file.




\section{Revision history}

\raggedright
\begin{itemize}
	\item 2026-12-04 (v.\,1.0): Initial release.
\end{itemize}


\begin{thebibliography}{99}
	\setlength\itemsep{0pt}
	\bibitem{zref-clever} Fidalgo, Gustavo Barros: \emph{The zref-clever package}. \url{https://ctan.org/pkg/zref-clever}.
	\bibitem{tagpdf} Fischer, Ulrike: \emph{The tagpdf package}. \url{https://ctan.org/pkg/tagpdf}.
	\bibitem{gat2} Selting, Margret, Peter Auer, Dagmar Barth-Weingarten, Jörg Bergmann, Pia Bergmann, Karin Birkner,
	               Elizabeth Couper-Kuhlen, Arnulf Deppermann, Peter Gilles, Susanne Günthner, Martin Hartung,
	               Friederike Kern, Christine Mertzluﬀt, Christian Meyer, Miriam Morek, Frank Oberzaucher, Jörg Peters,
	               Uta Quasthoff, Wilfried Schütte, Anja Stukenbrock \& Susanne Uhmann. 2009.
	               Gesprächsanalytisches Transkriptionssystem 2 (GAT 2). \emph{Gesprächsforschung: Online-Zeitschrift zur verbalen
	               Interaktion} 10. 353--402. \url{http://www.gespraechsforschung-ozs.de/heft2009/px-gat2.pdf}.
\end{thebibliography}

\end{document}

