summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/textglos/textglos.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-28 22:15:25 +0000
committerKarl Berry <karl@freefriends.org>2013-05-28 22:15:25 +0000
commit4fb72bd444427c82b80f3bada18ea00ff9f8be57 (patch)
treec646f1b3e2063d6539030e75ac931d6edc28ef1a /Master/texmf-dist/tex/latex/textglos/textglos.sty
parente419c0c89b5d20699307d32913bda2c4318e78da (diff)
textglos (28may13)
git-svn-id: svn://tug.org/texlive/trunk@30788 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/textglos/textglos.sty')
-rw-r--r--Master/texmf-dist/tex/latex/textglos/textglos.sty101
1 files changed, 101 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/textglos/textglos.sty b/Master/texmf-dist/tex/latex/textglos/textglos.sty
new file mode 100644
index 00000000000..4a17f97f348
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/textglos/textglos.sty
@@ -0,0 +1,101 @@
+%%
+%% This is file `textglos.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% textglos.dtx (with options: `package')
+%% This is a generated file.
+%%
+%% ----------------------------------------------------------------
+%% textglos --- A package to typeset inline linguistic examples.
+%% E-mail: natalie.a.weber@gmail.com
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%%
+%%
+%% Copyright 2013 by Natalie Weber
+%%
+%% 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 Natalie Weber.
+%%
+%% This work consists of the files textglos.dtx and textglos.ins
+%% and the derived files textglos.sty and textglos.pdf.
+%%
+\NeedsTeXFormat{LaTeX2e}[1996/10/24]%
+\ProvidesPackage{textglos}%
+ [2012/06/27 v1.0 textglos package for inline linguistic glossing]%
+\IfFileExists{graphicx}{\RequirePackage{graphicx}}{}%
+\global\long\def\tlist@if@empty@nTF #1{%
+\expandafter\ifx\expandafter\\\detokenize{#1}\\%
+\expandafter\@firstoftwo%
+\else%
+\expandafter\@secondoftwo%
+\fi%
+}%
+\@ifpackageloaded{graphicx}{%
+ \newcommand{\shorteq}{%
+ \settowidth{\@tempdima}{-}% Width of hyphen
+ \resizebox{1.5\@tempdima}{\height}{=}%
+ }%
+}{}%
+ \def\nbrhyph{\textup{\hbox{-}}}%
+ \ifx\shorteq\relax
+ \def\nbreq{\textup{\hbox{=}}}%
+ \else
+ \def\nbreq{\textup{\hbox{\shorteq}}}%
+ \fi
+ \def\nbrpunct#1{%
+ \bgroup
+ \catcode`\-=\active
+ \catcode`\==\active
+ \scantokens{\let-\nbrhyph
+ \let=\nbreq#1\ignorespaces}
+ \egroup
+ }%
+\providecommand*{\gl}[1]{`#1'}%
+\def\lingexample#1#2{% #1 = name, #2 = template
+ \@lingsub(#1)#2\@nil % \@nil as delimiter
+ \expandafter\gdef\csname #1\endcsname{% \def\name
+ \@ifnextchar[{\@lingexample(#1)}{\@lingexample(#1)[]}%
+ }%
+}%
+
+\def\@lingsub(#1)#2X#3\@nil{%
+ \expandafter\gdef\csname @@lingsub@#1\endcsname##1{\nbrpunct{#2##1#3}}%
+}%
+\def\@lingexample(#1)[#2]{\@ifnextchar[%
+ {\@@lingexample(#1)[#2]}{\@@lingexample(#1)[][#2]}%
+}%
+\def\@@lingexample(#1)[#2][#3]#4{%
+ \ifmmode
+ $\tlist@if@empty@nTF{#2}{}{#2~}%
+ {\csname @@lingsub@#1\endcsname{#4}}%
+ \tlist@if@empty@nTF{#3}{}{ \gl{#3}}$%
+ \else
+ \tlist@if@empty@nTF{#2}{}{\lingprestyle{{#2}}}%
+ {\csname @@lingsub@#1\endcsname{#4}}%
+ \tlist@if@empty@nTF{#3}{}{\lingpoststyle{{#3}}}%
+ \fi
+}%
+\providecommand{\lingprestyle}[1]{#1~}
+\providecommand{\lingpoststyle}[1]{ \gl{#1}}
+\lingexample{xo}{\ensuremath{<}X\ensuremath{>}}
+\lingexample{xt}{[X]} % use \lingexample{xt}{\tipaencoding[X]}
+ % if you want IPA
+\lingexample{xm}{/X/}
+\lingexample{xv}{\itshape X}
+\lingexample{xh}{*X} % use \lingexample{xh}{*\textit\bgroup X\egroup}
+ % if you want italicized