From 81e0ea0aefd06549bf9156ae575029f14f852154 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 29 Apr 2018 22:35:31 +0000
Subject: langsci (27apr18)

git-svn-id: svn://tug.org/texlive/trunk@47487 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/xelatex/langsci/langsci-optional.sty       | 82 +++++++++++++++++-----
 1 file changed, 66 insertions(+), 16 deletions(-)

(limited to 'Master/texmf-dist/tex/xelatex/langsci/langsci-optional.sty')

diff --git a/Master/texmf-dist/tex/xelatex/langsci/langsci-optional.sty b/Master/texmf-dist/tex/xelatex/langsci/langsci-optional.sty
index 6f634b03e5c..369b9f5292a 100644
--- a/Master/texmf-dist/tex/xelatex/langsci/langsci-optional.sty
+++ b/Master/texmf-dist/tex/xelatex/langsci/langsci-optional.sty
@@ -214,33 +214,26 @@
 % Note: The 2nd Argument of the \ulp command is filled in by experience - if you are not familiar with the command, you should experiment a bit. Usually, five tildes are enough, but be sure to check the outcome. 
 % \ule is meant to be the last word in a phrase that is underlined. Therefore, \ule does not have an extra length.
 \usepackage[normalem]{ulem} 
+\usepackage{calc}
+\newlength{\fulllength}
 \newcommand{\ulp}[2]{%#1: stuff to underline, #2: extra length to skip the whitespace between to components
   \settowidth{\LSPTmp}{#1}%
   % several boxes are need to assure that words with ascending and descending letters are underlined at the same 
   % level, leading to the impression of a continuous stroke
   \parbox[t]{\LSPTmp}{ %restrict first box to the length of first argument
-      \settowidth{\LSPTmp}{#1#2} %inner box is larger than outerbox, so underlining will extend beyond length of outer box
+      \settowidth{\fulllength}{\parbox{\LSPTmp}{~}\parbox{#2mm}{~}} %inner box is larger than outerbox, so underlining will extend beyond length of outer box
       %             align parbox to bottom
       %              |           mbox to prevent hyphenation
-      \uline{\parbox[b]{\LSPTmp}{\mbox{#1#2}}}
+      \uline{\parbox[b]{\fulllength}{\mbox{#1}}}
     }
 }
 
 \newcommand{\ule}[1]{%#1: stuff to underline, no extra length
-  \ulp{#1}{}
+  \ulp{#1}{0}
   }
   
   
 
-\usepackage{newfile}  
-\newoutputstream{colorfigures}
-\openoutputfile{\jobname.clr}{colorfigures}
-\addtostream{colorfigures}{Note the offset incurred by the frontmatter!}
-\newenvironment{colorfigure}{\begin{figure}\addtostream{colorfigures}{\thepage}}{\end{figure}} 
-
-\AtEndDocument{
- \closeoutputstream{colorfigures}
-}
 
 \newcommand{\longrule}{\rule{1em}{.3pt}}
 \usepackage{colortbl} 
@@ -275,6 +268,47 @@
 
 \newcommand{\noabstract}{\vspace*{-2\baselineskip}} %for chapters without abstract
 
+\newcommand{\rephrase}[2]{{\color{yellow!30!black}#2}\todo{replaced `#1'}}
+
+\newcommand{\missref}[2][]{\todo[#1]{missing reference #2}}
+
+\newenvironment{indentquote}[1]%
+  {\list{}{\leftmargin=#1\rightmargin=0pt}\item[]}%
+  {\endlist}
+  
+  
+\newcommand{\phonrule}[3]{#1 $\to$ #2 / #3}
+\newcommand{\featurebox}[1]{$\left[\begin{tabular}{>{\scshape}c}#1\end{tabular}\right]$}
+
+
+\definecolor{RED}{cmyk}{0.05,1,0.8,0}
+
+%connect two elements with lines
+\newcommand{\connect}[2]{%
+  \tikz[overlay,remember picture]{%
+    \draw[-,thick] (#1) -- (#2) node   {};  %
+  }
+} 
+
+\newcommand{\examplesroman}{
+  \let\eachwordone=\upshape
+  \exfont{\upshape}
+}
+\newcommand{\examplesitalics}{
+  \let\eachwordone=\itshape
+  \exfont{\itshape}
+}
+
+\newenvironment{modquote}[1][6mm]% slightly less indented quote for hyphenation issues
+  {\list{}{\leftmargin=#1\rightmargin=0mm}\item[]}%
+  {\endlist}
+  
+%%%%%%%%%%%%%%%%%%%%
+%%%%           %%%%%
+%%%%   PLOTS   %%%%%
+%%%%           %%%%%
+%%%%%%%%%%%%%%%%%%%%
+
 \newcommand{\barplot}[4]{%
   \begin{tikzpicture}
     \begin{axis}[
@@ -295,7 +329,23 @@
     \end{axis} 
   \end{tikzpicture} 
 }
-
-\newcommand{\rephrase}[2]{{\color{yellow!30!black}#2}\todo{replaced `#1'}}
-
-\newcommand{\missref}[2][]{\todo[#1]{missing reference #2}}
\ No newline at end of file
+\usepackage{pgfmath,pgfplotstable}
+\newcommand{\langsciplot}[2]{%% experimental
+        \pgfplotstablegetcolsof{#1.csv}
+        \pgfmathsetmacro{\langscicsvlength}{\pgfplotsretval-1}
+        \begin{tikzpicture}[trim axis right,trim axis left]
+            \begin{axis}[
+                    #2,
+                    xtick=data,
+                    axis lines*=left,
+                    nodes near coords,
+                    ymin=0,
+                    width=\textwidth]
+            \foreach \i in {0,...,\langscicsvlength} {
+                \addplot[
+                    /pgf/number format/read comma as period
+                    ] table [x index={0},y index={\i}] {#1.csv};
+            }
+            \end{axis}    
+        \end{tikzpicture}
+}
\ No newline at end of file
-- 
cgit v1.2.3

