summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ot-tableau
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-24 03:01:24 +0000
committerNorbert Preining <norbert@preining.info>2021-05-24 03:01:24 +0000
commit5f0d648973cab5784f4bdb361bbe261b60493432 (patch)
tree8d52d91ad042d654b138e7ce1b7b87b85b837b11 /macros/latex/contrib/ot-tableau
parentf1261b349e875b842745b63258c3e338cb1fe3bf (diff)
CTAN sync 202105240301
Diffstat (limited to 'macros/latex/contrib/ot-tableau')
-rw-r--r--macros/latex/contrib/ot-tableau/README11
-rw-r--r--macros/latex/contrib/ot-tableau/ot-tableau.pdfbin84456 -> 65650 bytes
-rw-r--r--macros/latex/contrib/ot-tableau/ot-tableau.sty61
-rw-r--r--macros/latex/contrib/ot-tableau/ot-tableau.tex13
4 files changed, 66 insertions, 19 deletions
diff --git a/macros/latex/contrib/ot-tableau/README b/macros/latex/contrib/ot-tableau/README
index 588e69e6af..059cc0f56c 100644
--- a/macros/latex/contrib/ot-tableau/README
+++ b/macros/latex/contrib/ot-tableau/README
@@ -1,3 +1,10 @@
-This material is subject to the LaTeX Project Public License. See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the details of that license.
-Requires packages: xstring, amssymb, bbding, suffix, colortbl, rotating, hhline,tabu
+
+
+The package makes it easy to create beautiful optimality-theoretic tableaux. The LaTeX source is visually very similar to a formatted tableau, which makes working with the source code painless (well, less painful). A variety of stylistic variants are available to suit personal taste.
+
+The package is maintained by Adam Baker (adam@adambaker.org).
+
+This material is subject to the LaTeX Project Public License. See http://www.latex-project.org/lppl.txt for the details of that license.
+
+Requires packages: xstring, amssymb, bbding, suffix, colortbl, rotating, hhline (optionally), arydshln, tipa (optionally)
diff --git a/macros/latex/contrib/ot-tableau/ot-tableau.pdf b/macros/latex/contrib/ot-tableau/ot-tableau.pdf
index bbda62b020..46a08bd942 100644
--- a/macros/latex/contrib/ot-tableau/ot-tableau.pdf
+++ b/macros/latex/contrib/ot-tableau/ot-tableau.pdf
Binary files differ
diff --git a/macros/latex/contrib/ot-tableau/ot-tableau.sty b/macros/latex/contrib/ot-tableau/ot-tableau.sty
index 84528124dc..3d2ac05907 100644
--- a/macros/latex/contrib/ot-tableau/ot-tableau.sty
+++ b/macros/latex/contrib/ot-tableau/ot-tableau.sty
@@ -1,4 +1,21 @@
-\ProvidesPackage{ot-tableau}[2017/07/23]
+%% ot-tableau.sty
+%% Copyright 2021 Adam Baker
+%
+% 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 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Adam Bker.
+%
+% This work consists of the files ot-tableau.sty and ot-tableau.tex.
+
+\ProvidesPackage{ot-tableau}[2021-05-19]
% Package option: notipa
\newif\ifottableau@tipa
@@ -9,6 +26,11 @@
\newif\ifottableau@circledviolations
\DeclareOption{circledviolations}{\ottableau@circledviolationstrue}
+% Package option: usehhline
+\newif\ifottableau@usehhline
+\ottableau@usehhlinefalse % default to false
+\DeclareOption{usehhline}{\ottableau@usehhlinetrue}
+
% Package option: shadedcells
\newif\ifottableau@shadedcells
\DeclareOption{shadedcells}{\ottableau@shadedcellstrue}
@@ -29,8 +51,13 @@
\RequirePackage{rotating}
% fancy table and lines
-\RequirePackage{hhline,tabu}
-\newtabulinestyle { dashed=.5pt on 1.5pt off 1.5pt }
+% 2021-05-19: Removing hhline, which makes the nice lines, because hhline conflicts with arydshln
+\ifottableau@usehhline
+ \RequirePackage{hhline}
+\else
+\fi
+
+\RequirePackage{arydshln}
% IPA typesetting macros
\def\ipa#1{#1}
@@ -91,25 +118,34 @@
% Automatic row lettering
\newcommand*{\rowletter}{\stepcounter{tableaurow}\alph{tableaurow}. }
-% https://tex.stackexchange.com/questions/382843/using-the-tabu-environment-within-a-conditional-within-newenvironment
+
+
+
\newenvironment{tableau}[1]{\setcounter{tableaurow}{0}%
\gdef\ConstraintString{#1}
\StrSubstitute{#1}{s}{c}[\NoS]
\StrCount{\NoS}{c}[\ConstraintCount]%
+ \ifottableau@usehhline
+ \gdef\TopOrBottomLine{\hhline{---||*{\ConstraintCount}{-|}}}
+ \gdef\DoubleLine{\hhline{---||*{\ConstraintCount}{-|}}}
+ \else
+ \gdef\TopOrBottomLine{\hline}
+ \gdef\DoubleLine{\hline\hline}
+ \fi
\ifottableau@fingerfirst % finger first: this is the default
\expandafter\@firstoftwo
\else % finger second
\expandafter\@secondoftwo
\fi
- {\begin{tabu}{|r@{\hspace{4pt}}l@{\hspace{3pt}}l||#1|}} % finger first
- {\begin{tabu}{|l@{\hspace{2pt}}r@{\hspace{4pt}}l||#1|}} % finger second
- \hhline{|---||*{\ConstraintCount}{-|}}
- }{\\\hhline{|---||*{\ConstraintCount}{-|}}\end{tabu}}
-
+ {\begin{tabular}{|r@{\hspace{4pt}}l@{\hspace{3pt}}l||#1|}} % finger first
+ {\begin{tabular}{|l@{\hspace{2pt}}r@{\hspace{4pt}}l||#1|}} % finger second
+ \TopOrBottomLine
+ }{\\\TopOrBottomLine\end{tabular}}
+
% draw two lines after the constraints, one line elsewhere
\def\properlines{\ifthenelse{\thetableaurow=0}%
- {\\\hhline{:===::*{\ConstraintCount}{=:}}}%
- {\\\hhline{|---||*{\ConstraintCount}{-|}}}}
+ {\\\DoubleLine}%
+ {\\\TopOrBottomLine}}
\newcommand\cand[2][]{\OptimalOff\properlines%
\ifottableau@fingerfirst \ipa{#1} \else \rowletter \fi%
@@ -142,6 +178,3 @@
\newcommand\const[1]{&\textsc{#1}\UnshadeTheCell}
\WithSuffix\newcommand\const*[1]{&#1\UnshadeTheCell}
-
-% 2017-07-22: This doesn't work for some reason if it's toward the top of the file
-\newcolumntype{:}{|[dashed]}
diff --git a/macros/latex/contrib/ot-tableau/ot-tableau.tex b/macros/latex/contrib/ot-tableau/ot-tableau.tex
index e63c9c43aa..0eba320896 100644
--- a/macros/latex/contrib/ot-tableau/ot-tableau.tex
+++ b/macros/latex/contrib/ot-tableau/ot-tableau.tex
@@ -1,8 +1,10 @@
\documentclass{article}
\usepackage[notipa]{ot-tableau}
+% use the usehhline option to use the hhline for prettier lines (which currently does not work)
+%\usepackage[notipa,usehhline]{ot-tableau}
\usepackage{fullpage,pifont}
\title{The \textsf{ot-tableau} package}
-\date{Revised 2017-07-23}
+\date{Revised 2021-05-19}
\author{Adam Baker}
\def\eg{e.g.,~}
\def\tabl{\textsf{ot-tableau}}
@@ -88,6 +90,7 @@ The default \verb+\cand+ and \verb+\const+ commands typeset the argument with TI
If you are using Unicode input for your phonetic symbols, use the package option \verb+notipa+ to disable TIPA.
\subsection{Controlling cell shading}
+
There are two systems in use for shading OT tableaux. One system is to shade cells in a row after the crucial violation. The other system is to shade an entire column, if the associate constraint generates no crucial violations.
\tabl\ will do cell-shading automatically with the \verb+shadedcells+ package option.\footnote{More specifically, \tabl\ will look for the exclamation point. You have to provide the exclamation point.} This tableau...
@@ -204,8 +207,7 @@ Using the optional argument to \verb+\cand+, you can add any annotation to a can
\end{tableau}
\end{verbatim}
-You can mark the optimal candidate with the \verb+\Optimal+ command. This
-By default, \tabl\ typesets \textsf{bbding}'s \verb+\HandRight+ symbol (\HandRight), which I find to be the most attractive. \tabl\ also replaces asterisks with the more attractive asterisks in \textsf{amssymb}. You can replace these symbols with others if you wish, using \verb+\renewcommand+:
+You can mark the optimal candidate with the \verb+\Optimal+ command. By default, \tabl\ typesets \textsf{bbding}'s \verb+\HandRight+ symbol (\HandRight), which I find to be the most attractive. \tabl\ also replaces asterisks with the more attractive asterisks in \textsf{amssymb}. You can replace these symbols with others if you wish, using \verb+\renewcommand+:
\begin{center}
\CircledViolationsOn
@@ -232,6 +234,10 @@ By default, \tabl\ typesets \textsf{bbding}'s \verb+\HandRight+ symbol (\HandRig
\end{tableau}
\end{verbatim}
+\subsection{Prettier lines}
+\textbf{As of 2021-05-19:} A conflict between \verb+hhline+ and \verb+arydshln+ means that it's not possible to have the prettier tableau lines that \verb+hhline+ offers. (Extra whitespace is introduced above the first line.) It's possible that this will be fixed in the future, in which case you can get the prettier lines back with the \verb+usehhline+ package option, e.g., \verb+\usepackage[notipa,usehhline]{ot-tableau}+.
+
+
\section{Package Options}
It makes the most sense to set these options as package options, but if you want to change the settings in the middle of the documents, you can use the commands indicated in parentheses.
@@ -240,6 +246,7 @@ It makes the most sense to set these options as package options, but if you want
\item[circledviolations] Circle the optimal candidate's constraint violations. The optimal candidate must be identified with \verb+\cand[\Optimal]+. (\verb+\CircledViolationsOn+, \verb+\CircledViolationsOff+)
\item[shadedcells] Shade cells for a constraint that follow the candidate's fatal violation. (\verb+\ShadingOn+, \verb+\ShadingOff+)
\item[fingerafter] Place the finger-of-optimality after the letter rather than before it. (\verb+\FingerBeforeLetter+, \verb+\LetterBeforeFinger+)
+\item[usehhline] Use the \verb+hhline+ package to draw prettier tableau lines. (As of 2021-05-19, a package conflict means that the lines are not actually prettier. Hopefully this will be fixed in the future and we can go back to pretty lines!)
\end{description}
\end{document}