diff options
author | Karl Berry <karl@freefriends.org> | 2014-06-20 18:22:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-06-20 18:22:26 +0000 |
commit | 46407651698b50506037411619e7076d12d39ce3 (patch) | |
tree | 2dc5f53f26a095d29995176a36c6873334921fa2 | |
parent | 038675d76448294d02814f3bee9a575936ade892 (diff) |
ot-tableau (5jun14)
git-svn-id: svn://tug.org/texlive/trunk@34340 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/ot-tableau/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.pdf | bin | 112721 -> 61588 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.tex | 89 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty | 132 |
4 files changed, 175 insertions, 48 deletions
diff --git a/Master/texmf-dist/doc/latex/ot-tableau/README b/Master/texmf-dist/doc/latex/ot-tableau/README index 811ce1af775..353bd3f66ba 100644 --- a/Master/texmf-dist/doc/latex/ot-tableau/README +++ b/Master/texmf-dist/doc/latex/ot-tableau/README @@ -1,3 +1,3 @@ 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: tipa,ifthen,pifont,substr,bbding,suffix, colortbl, arydshln
\ No newline at end of file +Requires packages: xstring, amssymb, bbding, suffix, colortbl, arydshln
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.pdf b/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.pdf Binary files differindex 78047963eb7..d8592691f1d 100644 --- a/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.pdf +++ b/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.pdf diff --git a/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.tex b/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.tex index d4fd375b31e..5a8e2c0023c 100644 --- a/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.tex +++ b/Master/texmf-dist/doc/latex/ot-tableau/ot-tableau.tex @@ -1,9 +1,10 @@ \documentclass{article} -\usepackage{ot-tableau} -\usepackage{fullpage,rotating} +\usepackage[notipa]{ot-tableau} +\usepackage{fullpage,rotating,pifont} \title{The \textsf{ot-tableau} package} +\date{Revised 2014-06-04} \author{Adam Baker} - +\def\eg{e.g.,~} \def\tabl{\textsf{ot-tableau}} \begin{document} @@ -14,10 +15,10 @@ The \tabl\ package makes it easy to create beautiful optimality-theoretic tablea \begin{center} \begin{tableau}{c:c|c} - \inp{\ips{stap}} \const{*Complex} \const{Anchor-IO} \const{Contiguity-IO} - \cand{stap} \vio{*!} \vio{} \vio{} - \cand[\HandRight]{sap} \vio{} \vio{} \vio{*} - \cand{tap} \vio{} \vio{*!} \vio{} + \inp{\ips{stap}} \const{*Complex} \const{Anchor-IO} \const{Contiguity-IO} + \cand{stap} \vio{*!} \vio{} \vio{} + \cand[\Optimal]{sap} \vio{} \vio{} \vio{*} + \cand{tap} \vio{} \vio{*!} \vio{} \end{tableau} \end{center} @@ -25,7 +26,7 @@ The \tabl\ package makes it easy to create beautiful optimality-theoretic tablea \begin{tableau}{c:c|c} \inp{\ips{stap}} \const{*Complex} \const{Anchor-IO} \const{Contiguity-IO} \cand{stap} \vio{*!} \vio{} \vio{} -\cand[\HandRight]{sap} \vio{} \vio{} \vio{*} +\cand[\Optimal]{sap} \vio{} \vio{} \vio{*} \cand{tap} \vio{} \vio{*!} \vio{} \end{tableau} \end{verbatim} @@ -35,7 +36,7 @@ Pertinent features: \item Indicate solid or dashed lines between constraints with \verb+\begin{tableau}{c:c|c}+. A solid line is indicated by a pipe, a dashed line with a colon. \item The input is specified with the \verb+\inp+ command. (Here the \verb+\ips+ macro is being used to render the text using TIPA and put it within slashes.) \item Indicate the constraints with the \verb+\const+ command. -\item Add a candidate with the \verb+\cand+ command. An optional argument can be used to annotate the candidate (like with \HandRight, \verb+\HandRight+) +\item Add a candidate with the \verb+\cand+ command. An optional argument can be used to annotate the candidate (\eg to use \HandLeft, \verb+\cand[\HandLeft]+) \item Violations are indicated with the \verb+\vio+ macro. You need to include these commands even when there are no violations. \item Use of whitespace is optional. Keeping the columns aligned in the source code, though, makes the tableau much easier to edit. \end{itemize} @@ -64,7 +65,7 @@ Pertinent features: \section{Parameters} \subsection{Changing formats} -The default \verb+\cand+ and \verb+\const+ commands typset the argument in IPA (TIPA) and small caps, respectively. Though this is generally appropriate, there are also commands \verb+\cand*+ and \verb+\const*+ that apply no formatting. The following code and tableau illustrate this. +The default \verb+\cand+ and \verb+\const+ commands typeset the argument with TIPA's \verb+\textipa+ command, and small caps, respectively. Though this is generally appropriate, there are also commands \verb+\cand*+ and \verb+\const*+ that apply no formatting. The following code and tableau illustrate this. \begin{center} \begin{tableau}{c|c} @@ -84,10 +85,12 @@ The default \verb+\cand+ and \verb+\const+ commands typset the argument in IPA ( \noindent Usage of \verb+\const*+ is illustrated in the next section. +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, if you invoke the \verb+\ShadingOn+ command before creating the tableau.\footnote{More specifically, \tabl\ will look for the exclamation point. You have to provide the exclamation point.} (There is also \verb+\ShadingOff+ if you wish to turn this feature off for subsequent tableaux in the document; this is the default setting.) This tableau... +\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... \begin{center} \ShadingOn @@ -131,10 +134,10 @@ The alternative is to shade an entire column by using `s' instead of `c' in the You can also mix the approaches, which is illustrated in the code for Table~\ref{large_example}. (That code is not printed in this manual, but it's available in the .tex version of this file.) -You can control the darkness of the shading using a command like \verb+\SetCellShading{0.4}+. A value of 1 corresponds to white, 0 to black. The default is 0.9. +You can control the darkness of the shading using, \eg \verb+\SetCellShading{0.4}+. A value of 1 corresponds to white, 0 to black. The default is 0.9. \subsection{Symbol position} -Some people prefer the ``finger-of-optimality'' to go after the letter. This can be done by using the \verb+\LetterBeforeFinger+ command: +Some people prefer the ``finger-of-optimality'' to go after the letter. This can be done by using the \verb+fingerafter+ package option. For example: \begin{center} \LetterBeforeFinger @@ -148,7 +151,6 @@ Some people prefer the ``finger-of-optimality'' to go after the letter. This can \noindent ...is produced by the following code... \begin{verbatim} - \LetterBeforeFinger \begin{tableau}{c|c} \inp{\ips{ba}} \const{*VcdObs} \const*{\textsc{Ident-IO}-[nas]} \cand{ba} \vio{*!} \vio{} @@ -156,7 +158,26 @@ Some people prefer the ``finger-of-optimality'' to go after the letter. This can \end{tableau} \end{verbatim} -\noindent \verb+\FingerBeforeLetter+ is also available. This is the default. +\subsection{Circled violations} +In one style of tableau, the optimal candidate's violations are circled. You can enabled this with the \verb+circledviolations+ package option. In this case, the optimal candidate must be marked with \verb+\Optimal+. + +\CircledViolationsOn +\begin{center} + \begin{tableau}{c|c} + \inp{\ips{ba}} \const{*VcdObs} \const*{\textsc{Ident-IO}-[nas]} + \cand{ba} \vio{*!} \vio{} + \cand[\Optimal]{pa} \vio{} \vio{*} + \end{tableau} +\end{center} +\CircledViolationsOff + +\begin{verbatim} + \begin{tableau}{c|c} + \inp{\ips{ba}} \const{*VcdObs} \const*{\textsc{Ident-IO}-[nas]} + \cand{ba} \vio{*!} \vio{} + \cand[\Optimal]{pa} \vio{} \vio{*} + \end{tableau} +\end{verbatim} \subsection{Different symbols} Using the optional argument to \verb+\cand+, you can add any annotation to a candidate. The following will be a trip down Memory Lane for some people: @@ -183,6 +204,42 @@ Using the optional argument to \verb+\cand+, you can add any annotation to a can \end{tableau} \end{verbatim} -\noindent For most needs, \verb+\HandRight+ and \verb+\HandLeft+ will be sufficient. +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+: + +\begin{center} + \CircledViolationsOn + \renewcommand\OptimalMarker{$\Cup$} + \renewcommand\ViolationMarker{$+$} + \renewcommand\CircledViolationMarker{$\boxplus$} + \begin{tableau}{c|c} + \inp{\ips{ba}} \const{*VcdObs} \const*{\textsc{Ident-IO}-[nas]} + \cand{ba} \vio{*!} \vio{} + \cand[\Optimal]{ma} \vio{} \vio{*} + \end{tableau} + \CircledViolationsOff +\end{center} + +\begin{verbatim} + \renewcommand\OptimalMarker{$\Cup$} + \renewcommand\ViolationMarker{$+$} + \renewcommand\CircledViolationMarker{$\boxplus$} + + \begin{tableau}{c|c} + \inp{\ips{ba}} \const{*VcdObs} \const*{\textsc{Ident-IO}-[nas]} + \cand{ba} \vio{*!} \vio{} + \cand[\Optimal]{ma} \vio{} \vio{*} + \end{tableau} +\end{verbatim} + +\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. + +\begin{description} +\item[notipa] With this option, the TIPA package will not be loaded, and text in the \verb+\cand+ argument will not be placed in a \verb+\textipa+ command. Use this option if you are using Unicode input for IPA symbols. (\verb+\TipaOn+, \verb+\TipaOff+) +\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+) +\end{description} \end{document} diff --git a/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty b/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty index 1d082ae13ca..063952ec2e0 100644 --- a/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty +++ b/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty @@ -1,61 +1,131 @@ -% Note that tableau requires arydshln, which must be loaded after longtable - -\ProvidesPackage{ot-tableau} - -\RequirePackage{tipa,ifthen,pifont,substr,bbding,suffix} +% Note that ot-tableau requires arydshln, which must be loaded after longtable +\ProvidesPackage[2014-06-04]{ot-tableau} + +% Package option: notipa +\newif\ifottableau@tipa +\DeclareOption{tipa}{\ottableau@tipatrue} +\DeclareOption{notipa}{\ottableau@tipafalse} + +% Package option: circledviolations +\newif\ifottableau@circledviolations +\DeclareOption{circledviolations}{\ottableau@circledviolationstrue} + +% Package option: shadedcells +\newif\ifottableau@shadedcells +\DeclareOption{shadedcells}{\ottableau@shadedcellstrue} + +% Package option: fingerafter +\newif\ifottableau@fingerfirst +\ottableau@fingerfirsttrue +\DeclareOption{fingerafter}{\ottableau@fingerfirstfalse} + +\ExecuteOptions{tipa} % default is tipa +\ProcessOptions\relax + +\RequirePackage{xstring} +\RequirePackage{amssymb} % provides the asterisks +\RequirePackage{bbding} % provides \HandRight, etc. +\RequirePackage{suffix} \RequirePackage{colortbl} \RequirePackage{arydshln} % IPA typesetting macros -\def\ipa#1{\textipa{#1}} -\def\ip#1{[\textipa{#1}]} -\def\ips#1{/\textipa{#1}/} +\def\ipa#1{#1} +\def\ip#1{[#1]} +\def\ips#1{/#1/} +\ifottableau@tipa + \RequirePackage{tipa} + % use TIPA for IPA commands: + \def\ipa#1{\textipa{#1}} + \def\ip#1{[\textipa{#1}]} + \def\ips#1{/\textipa{#1}/} +\fi + +% Control package options inline + +\def\TipaOn{\ottableau@tipatrue} +\def\TipaOff{\ottableau@tipafalse} + +\def\CircledViolationsOn{\ottableau@circledviolationstrue} +\def\CircledViolationsOff{\ottableau@circledviolationsfalse} + +\def\ShadingOn{\ottableau@shadedcellstrue} +\def\ShadingOff{\ottableau@shadedcellsfalse} + +\def\FingerBeforeLetter{\ottableau@fingerfirsttrue} +\def\LetterBeforeFinger{\ottableau@fingerfirstfalse} + + +% Custom Markers +\newcommand\OptimalMarker{\HandRight} +\newcommand\ViolationMarker{$\ast$} +\newcommand\CircledViolationMarker{$\circledast$} % OT tableaux \newcounter{tableaurow} -\newcolumntype{s}{>{\ShadeTheCell}c} +% Keep track of whether the optimal candidate is optimal +\newif\ifottableau@optimal +\def\OptimalOn{\globaldefs=1\ottableau@optimaltrue\globaldefs=0} +\def\OptimalOff{\globaldefs=1\ottableau@optimalfalse\globaldefs=0} +\newcommand{\Optimal}{\OptimalMarker\OptimalOn} +%%%%%%%%%%%%%%%%%%%%%%%%% +%% Cell shading commands -\def\ShadedCells{no} -\def\ShadingOn{\def\ShadedCells{yes}} -\def\ShadingOff{\def\ShadedCells{no}} +% Wholly shaded constraint columns must be specified with the s column type +\newcolumntype{s}{>{\ShadeTheCell}c} \def\CellShading{0.9} \def\SetCellShading#1{\def\CellShading{#1}} \def\ShadeTheCell{\cellcolor[gray]{\CellShading}} - \def\UnshadeTheCell{\cellcolor[gray]{1}} -\def\Excl{no} +\newif\ifottableau@excl +\def\ExclOff{\globaldefs=1\ottableau@exclfalse\globaldefs=0} +\def\ExclOn{\globaldefs=1\ottableau@excltrue\globaldefs=0} -\def\fingerfirst{yes} -\def\FingerBeforeLetter{\def\fingerfirst{yes}} -\def\LetterBeforeFinger{\def\fingerfirst{no}} \newcommand*{\rowletter}{\stepcounter{tableaurow}\alph{tableaurow}. } \newenvironment{tableau}[1]{\setcounter{tableaurow}{0}% \dashlinegap=2pt% - \ifthenelse{\equal{\fingerfirst}{yes}}% - {\begin{tabular}{|r@{\hspace{4pt}}l@{\hspace{3pt}}l||#1|}}%then - {\begin{tabular}{|l@{\hspace{2pt}}r@{\hspace{4pt}}l||#1|}}%else + \ifottableau@fingerfirst + \begin{tabular}{|r@{\hspace{4pt}}l@{\hspace{3pt}}l||#1|} + \else + \begin{tabular}{|l@{\hspace{2pt}}r@{\hspace{4pt}}l||#1|} + \fi% }{\\\hline\end{tabular}} \def\properlines{\ifthenelse{\thetableaurow=0}{\\\hline\hline}{\\\hline}} -\newcommand\cand[2][]{\properlines\ifthenelse{\equal{\fingerfirst}{yes}}{#1&\rowletter}{\rowletter}&\ipa{#2}\gdef\Excl{no}} -\WithSuffix\newcommand\cand*[2][]{\properlines\ifthenelse{\equal{\fingerfirst}{yes}}{#1&\rowletter}{\rowletter}\gdef\Excl{no}} - -\def\vio#1{\ifthenelse{\equal{\Excl}{yes}\and\equal{\ShadedCells}{yes}}{\ShadeTheCell}{}\ifthenelse{\equal{\Excl}{yes}}{}{\IfSubStringInString{!}{#1}{\gdef\Excl{yes}}{\gdef\Excl{no}}}} +\newcommand\cand[2][]{\OptimalOff\properlines% + \ifottableau@fingerfirst \ipa{#1} \else \rowletter \fi% + & + \ifottableau@fingerfirst \rowletter \else \ipa{#1} \fi% + & + \ipa{#2}\ExclOff} + +\WithSuffix\newcommand\cand*[2][]{\OptimalOff\properlines% + \ifottableau@fingerfirst #1 \else \rowletter \fi% + & + \ifottableau@fingerfirst \rowletter \else #1 \fi% + \ExclOff} + +\def\vio#1{&% + \ifottableau@circledviolations + \ifottableau@optimal + \StrSubstitute{#1}{*}{\CircledViolationMarker} + \else + \StrSubstitute{#1}{*}{\ViolationMarker} + \fi + \else + \StrSubstitute{#1}{*}{\ViolationMarker} + \fi + \ifottableau@excl \ifottableau@shadedcells \ShadeTheCell \fi \fi% + \ifottableau@excl \empty \else \IfSubStr{#1}{!}{\ExclOn}{\ExclOff} \fi% + } \newcommand\inp[1]{\hline\multicolumn{3}{|l||}{#1}} \newcommand\const[1]{&\textsc{#1}\UnshadeTheCell} \WithSuffix\newcommand\const*[1]{\UnshadeTheCell} - - -% \begin{tableau}{c:c} -% \inp{input} \constraint{One} \constraint{Two} -% \cand{input} \vio{*!} \vio{*} -% \optcand{inp\super hut} \vio{} \vio{*} -% \end{tableau} |