diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/braille |
Initial commit
Diffstat (limited to 'macros/latex/contrib/braille')
-rw-r--r-- | macros/latex/contrib/braille/README | 40 | ||||
-rw-r--r-- | macros/latex/contrib/braille/braille.html | 105 | ||||
-rw-r--r-- | macros/latex/contrib/braille/braille.sty | 534 | ||||
-rw-r--r-- | macros/latex/contrib/braille/braillegif1.gif | bin | 0 -> 63189 bytes | |||
-rw-r--r-- | macros/latex/contrib/braille/braillegif2.gif | bin | 0 -> 53008 bytes | |||
-rw-r--r-- | macros/latex/contrib/braille/grade1.py | 55 | ||||
-rw-r--r-- | macros/latex/contrib/braille/grade2.py | 200 | ||||
-rw-r--r-- | macros/latex/contrib/braille/summary.pdf | bin | 0 -> 57727 bytes | |||
-rw-r--r-- | macros/latex/contrib/braille/summary.tex | 683 |
9 files changed, 1617 insertions, 0 deletions
diff --git a/macros/latex/contrib/braille/README b/macros/latex/contrib/braille/README new file mode 100644 index 0000000000..67580780f1 --- /dev/null +++ b/macros/latex/contrib/braille/README @@ -0,0 +1,40 @@ +Author: +------- + +William Park <opengeometry@yahoo.ca> +September 1998, April 1999 + - original author + +Dominique Unruh <dominique@unruh.de> +March 2001, October 2001 + - major additions + + +Copyright: +---------- + +Copyright 1998-2010 William Park + +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 William Park. + +This work consists of all files listed below: + README -- this file + braille.html -- short description of braille.sty, grade[12].py + braille.sty -- LaTeX2e package for typesetting Braille + braillegif1.gif -- transparent image + braillegif2.gif -- transparent image + grade1.py -- Python script to convert text to Grade 1 Braille + grade2.py -- Python script to convert text to Grade 2 Braille + summary.pdf -- PDF of summary.tex + summary.tex -- list of TeX macros and Braille symbols + diff --git a/macros/latex/contrib/braille/braille.html b/macros/latex/contrib/braille/braille.html new file mode 100644 index 0000000000..061575135b --- /dev/null +++ b/macros/latex/contrib/braille/braille.html @@ -0,0 +1,105 @@ +<html><head><title> +LaTeX2e package for typesetting Braille +</title></head><body bgcolor="whitesmoke"> +<center> +<p><big><big>LaTeX2e package for typesetting Braille</big></big></p> +<p><big>William Park <a href="mailto:opengeometry@yahoo.ca"><opengeometry@yahoo.ca></a></big></p> +<p><big>April 1999</big></p> +</center> +<h2><a name="Sec1">1 Introduction</a></h2> +<p>This package allows user to produce Braille documents on +paper for the blind without knowing Braille which can take years to +learn. Essentially, Python scripts <b>grade1.py</b> and +<b>grade2.py</b> convert ordinary text to grade 1 and 2 braille tags; +then, LaTeX2e package <b>braille.sty</b> takes the tags and prints out +corresponding braille symbols. +<h2><a name="Sec2">2 braille.sty</a></h2> +LaTeX2e package <b>braille.sty</b> defines macros, commands, +and fonts to typeset 6-dot braille symbols. Both Grade 1 and 2 +Braille are supported. All 189 grade 2 contractions are defined; +however, some puctuation symbols are missing simply because I couldn't +find them. List of TeX macros and braille symbols can be found in +<b>summary.tex</b> and <b>summary.pdf</b>. +The full usage is +<xmp>\usepackage[puttinydots,useemptybox]{braille}</xmp> +where <tt>puttinydots</tt> puts <tt>{\tiny.}</tt> at all dot positions +for visual check, and <tt>useemptybox</tt> uses empty braille box +instead of <tt>\hskip</tt>. In addition, 4 macros are available to +the user: +<ul> +<li><tt>\braillebox{}</tt> -- LaTeX picture box used as braille font +<li><tt>\brailleunit</tt> -- <tt>\unitlength</tt> for <tt>\braillebox{}</tt> +<li><tt>\brailledot{}</tt> -- actual dot printed in <tt>\braillebox{}</tt> +<li><tt>\braille{}</tt> -- main user command +</ul> +The command <tt>\braille{}</tt> is used to print braille +"text" or tags which are made up of +<ul> +<li> single characters, such as <tt>a</tt>, <tt>b</tt>, <tt>1</tt>, +<tt>?</tt>, <tt>!</tt> +<li> string enclosed in {}, such as <tt>{this}</tt>, <tt>{every}</tt>, +<tt>{his}</tt>, <tt>{''}</tt> +</ul> +For example, given input text of <tt>I {like} {com}put{er}</tt>, it +will print braille symbols for <i>I</i>, <i>like</i>, <i>com</i>, +<i>p</i>, <i>u</i>, <i>t</i>, <i>er</i>, along with the 2 spaces. +Therefore, you can type braille paragraph just as you would +type normal text paragraph. To print single character, type that +character. To print multi-character contraction, type that string +enclosed in {}. Because of the way TeX processes macro arguments, if +the argument is more than one line, then put at least one space after +newline (<tt>\n</tt>). Spaces at the end of line, and tabs and +newlines everywhere are ignored; but, multiple spaces in between words +collapse to single space. +<p>For example, if you want to insult someone, +<pre> +\usepackage{braille} +\braille{May you live in an interesting time.} +</pre> +will print grade 1 braille, +<p> <img height="72" width="636" src="braillegif1.gif"> +<p>and +<pre>\braille{May {you} live {in} an {in}t{er}e{st}{ing} {time}.}</pre> +will print grade 2 braille, +<p> <img height="72" width="534" src="braillegif2.gif"> +<p>Now, if you can read and write Braille, then you can type +the braille tags manually. But, since my knowledge of Braille is +limited and recent, I wrote Python scripts to generate the braille +tags automatically. +<h2><a name="Sec3">3 grade1.py, grade2.py</a></h2> +<p>Grade 1 Braille is simple character-by-character +translation of text. Most braille tags are the same as text +characters. However, some puctuation markups, such as double and +single quotations, are made up of multi-character string which must be +enclosed in {} in order to be understood by LaTeX. +<p>Grade 2 Braille defines translation of 189 common strings +and where they can be used. Since braille tags here are the same +multi-character string as the text, they must be enclosed in {}. The +complexity of grade 2 is not so much in the replacement of strings, +words, or part of words, but it is in figuring out whether the +replacement can take place. The rules for applying grade 2 +contractions are complicated with many exceptions; sometimes you can +replace it, sometimes you can't. +<p>The Python scripts <b>grade1.py</b> and <b>grade2.py</b> +take ordinary text and generate grade 1 and 2 braille tags as defined +by <b>braille.sty</b>. Since the output is returned all in one line, +the scripts are originally designed to be used from text editor which +can format a long line into multi-line paragraph. The command line +usages are +<dl> +<dd>python grade1.py < <i>text_file</i> > <i>tag_file</i> +<dd>python grade2.py < <i>text_file</i> > <i>tag_file</i> +</dl> +or their usage as python module are +<dl> +<dd><i>string</i> = grade1.convert(<i>string</i>) +<dd><i>string</i> = grade2.convert(<i>string</i>) +</dl> +<h2><a name="Sec4">4 Table of Contents</a></h2> +<ul> +<li> <a href="#Sec1">1 Introduction</a> +<li> <a href="#Sec2">2 braille.sty</a> +<li> <a href="#Sec3">3 grade1.py, grade2.py</a> +<li> <a href="#Sec4">4 Table of Contents</a> +</ul> +</body></html> diff --git a/macros/latex/contrib/braille/braille.sty b/macros/latex/contrib/braille/braille.sty new file mode 100644 index 0000000000..3827121aac --- /dev/null +++ b/macros/latex/contrib/braille/braille.sty @@ -0,0 +1,534 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% braille.sty +% +% William Park <opengeometry@yahoo.ca> +% September 1998, April 1999 +% - original author +% +% Dominique Unruh <dominique@unruh.de> +% March 2001, October 2001 +% - major additions +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Copyright 1998-2010 William Park +% +% 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 William Park. +% +% This work consists of all files listed below: +% README -- this file +% braille.html -- short description of braille.sty, grade[12].py +% braille.sty -- LaTeX2e package for typesetting Braille +% braillegif1.gif -- transparent image +% braillegif2.gif -- transparent image +% grade1.py -- Python script to convert text to Grade 1 Braille +% grade2.py -- Python script to convert text to Grade 2 Braille +% summary.pdf -- PDF of summary.tex +% summary.tex -- list of TeX macros and Braille symbols +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +% Major additions made by Dominique Unruh <dominique@unruh.de> +% March 2001, October 2001 +% - braille yields error, if invalid points are used in \braillbox +% - Option compact causes loading of \braille and tables to be ommitted (saves +% memory) +% - Option 8dots enables 8-dot braille +% - Option mirror mirrors. +% - Options useemptybox, puttinydots, 8dots, mirror can be switched on and off +% inside the document via \ifbraille...true and \ifbraille...false +% - Documentation in the header of braille.sty updated to reflect above +% changes +% - \braille{} command +% - compatible with e-LaTeX's r2l mode. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Author: +% ------- +% William Park <opengeometry@yahoo.ca> +% September 1998, April 1999 +% +% Description: +% ------------ +% +% This package defines macros, commands, and fonts to typeset 6-dot or 8-dot +% braille symbols for the blinds. Both Grade 1 and 2 Braille are supported. +% All 189 Grade 2 contractions are defined; however, some puctuation symbols +% are missing, simply because I couldn't find them. +% +% Normally, +% \usepackage{braille} +% is sufficient. The command \braille{} takes braille "text" which is made up +% of single character or string enclosed in {}. It converts "text" arguments +% into braille tags and calls predefined TeX macros to print out the braille +% symbols. For example, +% \usepackage{braille} +% \braille{I {like} {com}put{er}} +% will print braille symbols for +% 'I', 'like', 'com', 'p', 'u', 't', 'er' +% along with the 2 spaces. +% +% In the argument, whitespaces are processed by TeX in the usual manner. +% Multiple whitespaces (' ', '\t', '\n') collapse to single space. If extra +% spacing is needed, then it must come from outside of \braille{}. +% +% Examples: +% \braille{September {Number}1998} +% \braille{I run L{in}ux Slackw{ar}e {Number}3.3} +% \braille{{Capital}{this} is LaTeX package {for} {braille} {ou}tput.} +% \braille{I {also} wrote Py{th}on script {for} {con}v{er}t{ing} text +% {to}{braille}.} +% +% Therefore, you can type braille paragraph just as you would type normal text +% paragraph. To print single character, type that character. To print +% multi-character contraction, type that string enclosed in {}. +% +% Note that the \braille command assumes English text. Other languages have +% other abbreviations. +% +% +% Options: +% -------- +% +% The package is used as +% \usepackage[puttinydots,useemptybox,compact,8dots]{braille} +% where +% puttinydots -- puts {\tiny.} at all dot positions for visual check +% useemptybox -- uses empty braille box instead of \hskip +% compact -- load only command \braillebox, not \braille (saves memory) +% 8dots -- display 8-dot braille (not used by \braille) +% mirror -- mirrors each braille box (for "printing" braille by hand +% with a needle, use e-LaTeX to get right-to-left writing). +% +% You may activate or deactive inside the document +% puttinydots by \brailleputtinydotstrue resp. \brailleputtinydotsfalse +% useemptybox by \brailleuseemptyboxtrue resp. \brailleuseemptyboxfalse +% 8dots by \brailleeightdotstrue resp. \brailleeightdotsfalse +% mirror by \braillemirrortrue resp. \braillemirrorfalse +% +% Four macros are available to the user: +% \braillebox{} -- LaTeX picture box used as braille font +% \brailleunit -- \unitlength for \braillebox{} +% \brailledot{} -- actual dot printed in \braillebox{} +% \braille{} -- main user command (unless option compact is activated) +% +% Additional vertical space between paragraphs may be necessary, since +% \parskip=0pt is default. \braillebox{} is simple LaTeX picture box +% \begin{picture}(2,3) ... \end{picture} +% containing the actual patterns of dot which are placed with +% \put(0.5,0.5){\brailledot} ... +% The size and shape of braille box and dot can be changed by modifying +% \brailleunit and \brailledot{}, respectively. +% +% +% Other Files: +% ------------ +% +% List of TeX macros and braille symbols defined here is summarized in +% summary.tex -- "Summary of Grade 1 and 2 Braille" +% summary.pdf +% In order to type the braille tags manually, user would have to know Braille. +% To make it easier for people who don't know Braille, I wrote Python scripts +% to convert ordinary ASCII text into grade 1 and 2 braille tags: +% grade1.py -- converts text into grade 1 braille +% grade2.py -- converts text into grade 2 braille +% which behave like any Unix filters. Since my knowledge of Braille is +% limited, there will be errors and omissions. So, check with a braille +% expert. +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{braille} +% With options +% puttinydots = put {\tiny.} at all dot positions +% useemptybox = use empty braille box for space, not \hskip + + +% Usage: \braillebox{12345678} +% Put dot (\brailledot) at positions 1, 2, 3, 4, 5, 6, 7, 8 +% Dot locations: +% 14 +% 25 +% 36 +% 78 +% +\newlength{\brailleunit} % size of box containing one dot +\setlength{\brailleunit}{2mm} +\newcommand{\brailledot}{\circle*{0.6}} + +\newif\ifbrailleputtinydots +\newif\ifbrailleeightdots +\newif\ifbraillecompact +\newif\ifbrailleuseemptybox +\newif\ifbraillemirror + +\DeclareOption{puttinydots}{\brailleputtinydotstrue} +\DeclareOption{8dots}{\brailleeightdotstrue} +\DeclareOption{compact}{\braillecompacttrue} +\DeclareOption{useemptybox}{\brailleuseemptyboxtrue} +\DeclareOption{mirror}{\braillemirrortrue} + +\ProcessOptions + +\newcommand{\braillebox}[1]{{\unitlength=\brailleunit + \ifx\TeXXeTstate\undefined\else\ifnum\TeXXeTstate=0\else\beginL\fi\fi + \kern0.5\unitlength + \ifbrailleeightdots + \raisebox{-0.5\unitlength}[4\unitlength]{% + \begin{picture}(2,4)(0,-1) + \ifbrailleputtinydots\put@tinydots\fi + \put@dot{#1} + \end{picture}}% + \else + \raisebox{-0.5\unitlength}[3\unitlength]{% + \begin{picture}(2,3) + \ifbrailleputtinydots\put@tinydots\fi + \put@dot{#1} + \end{picture}}% + \fi + \kern0.5\unitlength + \ifx\TeXXeTstate\undefined\else\ifnum\TeXXeTstate=0\else\endL\fi\fi}} + +\newcommand{\put@tinydots}{% + \put(0.5,2.5){\makebox[0pt]{\tiny.}} + \put(0.5,1.5){\makebox[0pt]{\tiny.}} + \put(0.5,0.5){\makebox[0pt]{\tiny.}} + \put(1.5,2.5){\makebox[0pt]{\tiny.}} + \put(1.5,1.5){\makebox[0pt]{\tiny.}} + \put(1.5,0.5){\makebox[0pt]{\tiny.}} + \ifbrailleeightdots + \put(0.5,-.5){\makebox[0pt]{\tiny.}}% + \put(1.5,-.5){\makebox[0pt]{\tiny.}}\fi} + +\newcommand{\put@dot}[1]{\@tfor\tempyyy:=#1\do{\ifcase\tempyyy + \PackageError{braille}{Bad dots #1}% + {Can only display dots 1-8}\or + \put(\ifbraillemirror1\else0\fi.5,2.5){\brailledot}\or + \put(\ifbraillemirror1\else0\fi.5,1.5){\brailledot}\or + \put(\ifbraillemirror1\else0\fi.5,0.5){\brailledot}\or + \put(\ifbraillemirror0\else1\fi.5,2.5){\brailledot}\or + \put(\ifbraillemirror0\else1\fi.5,1.5){\brailledot}\or + \put(\ifbraillemirror0\else1\fi.5,0.5){\brailledot}\or + \ifbrailleeightdots\put(\ifbraillemirror1\else0\fi.5,-.5){\brailledot}\else + \PackageError{braille}{Bad dots in #1}{Use option 8dots to use + eight dot braille}\fi\or + \ifbrailleeightdots\put(\ifbraillemirror0\else1\fi.5,-.5){\brailledot}\else + \PackageError{braille}{Bad dots in #1}{Use option 8dots to use + eight dot braille}\fi\else + \PackageError{braille}{Bad dots #1}% + {Can only display dots 1-8}\fi}} + +\ifbraillecompact + +\newcommand\braille[1]{\PackageError{braille}{Command \protect\braille\space + not loaded}{Do not use option compact, then you will get + \protect\braille}} + +\else + +% \newcommand{\braille}[1]{\@tfor\tempxxx:=#1\do{\old@char{\tempxxx}}} +% +% \braille{ab{the} c} runs sequence of predefined command associated +% with each character or string in {}. For example, +% \BRAILLEa\BRAILLEb\BRAILLEthe\BRAILLEc +% Skips all whitespaces. +% +% +% {\obeyspaces\gdef\braille{\begingroup\obeyspaces\@braille}} +% \def\@braille#1{\@tfor\tempxxx:=#1\do{\old@char{\tempxxx}}\endgroup} +% +% Here, each space is dutifully printed with \hskip. However, since +% any previous spaces are removed with \unskip, multiple spaces +% collapse to one space. It still skips \t and \n, though. So, for +% multiple lines, put spaces at the beginning of each line. Spaces +% at the end of line will be ignored. +% +% +% -- Fixed by Dominique: +% +\def\braille{\begingroup + \catcode`\ =12 + \catcode`\^^M=12 + \let\brl@@spc\undefined + \@braille} +\def\@braille#1{\@tfor\tempxxx:=#1\do{\old@char{\tempxxx}% + \let\brl@@spc\brl@spc\let\brl@spc\undefined}\endgroup} + + +% \new@char{new}{commands} define \BRAILLE... command +% \old@char{old} run \BRAILLE... command +% +\newcommand{\new@char}[2]{% + \@ifundefined{BRAILLE#1}% + {\@namedef{BRAILLE#1}{#2}}% + {\@latex@error{Braille symbol for {#1} already defined}\@ehc}% +} +\newcommand{\old@char}[1]{% + \@ifundefined{BRAILLE#1}% + {\@latex@error{Braille symbol for {#1} not defined}\@ehc}% + {\@nameuse{BRAILLE#1}}% +} + + +% \def@char{new}{123456} define one braille code +% \ln@char{old}{new} ln old new +% \ln@@char{olda}{oldb}{new} ln olda+oldb new +% \prefix@char{123456}{old}{new} ln prefix+old new +% \suffix@char{old}{123456}{new} ln old+suffix new +% +\newcommand{\def@char}[2]{\new@char{#1}{\braillebox{#2}}} +\newcommand{\ln@char}[2]{\new@char{#2}{\old@char{#1}}} +\newcommand{\ln@@char}[3]{\new@char{#3}{\old@char{#1}\old@char{#2}}} +\newcommand{\prefix@char}[3]{\new@char{#3}{\braillebox{#1}\old@char{#2}}} +\newcommand{\suffix@char}[3]{\new@char{#3}{\old@char{#1}\braillebox{#2}}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Defines \BRAILLE... +% where ... can be one or more characters. + +% blank space -- Fixed by Dominique: +\newcommand\brl@space{% + \ifx\brl@@spc\undefined + \ifbrailleuseemptybox + \relax\braillebox{}\relax + \else + \unskip\hskip3\brailleunit\relax + \fi\fi + \let\brl@spc\@ne} % 6mm +\new@char{ }{\brl@space} +\catcode`\^^M=12\relax% +\new@char{^^M}{\brl@space}% +\catcode`\^^M=5\relax% + +% Prefix +\def@char{Number}{3456} +\def@char{Letter}{56} +\def@char{Capital}{6} +\ln@@char{Capital}{Capital}{Upper} +\def@char{Italic}{46} + +% Letter and number +\def@char{a}{1} \prefix@char{6}{a}{A} \ln@char{a}{1} +\def@char{b}{12} \prefix@char{6}{b}{B} \ln@char{b}{2} \ln@char{b}{but} +\def@char{c}{14} \prefix@char{6}{c}{C} \ln@char{c}{3} \ln@char{c}{can} +\def@char{d}{145} \prefix@char{6}{d}{D} \ln@char{d}{4} \ln@char{d}{do} +\def@char{e}{15} \prefix@char{6}{e}{E} \ln@char{e}{5} \ln@char{e}{every} +\def@char{f}{124} \prefix@char{6}{f}{F} \ln@char{f}{6} \ln@char{f}{from} +\def@char{g}{1245} \prefix@char{6}{g}{G} \ln@char{g}{7} \ln@char{g}{go} +\def@char{h}{125} \prefix@char{6}{h}{H} \ln@char{h}{8} \ln@char{h}{have} +\def@char{i}{24} \prefix@char{6}{i}{I} \ln@char{i}{9} +\def@char{j}{245} \prefix@char{6}{j}{J} \ln@char{j}{0} \ln@char{j}{just} +\def@char{k}{13} \prefix@char{6}{k}{K} \ln@char{k}{knowledge} +\def@char{l}{123} \prefix@char{6}{l}{L} \ln@char{l}{like} +\def@char{m}{134} \prefix@char{6}{m}{M} \ln@char{m}{more} +\def@char{n}{1345} \prefix@char{6}{n}{N} \ln@char{n}{not} +\def@char{o}{135} \prefix@char{6}{o}{O} +\def@char{p}{1234} \prefix@char{6}{p}{P} \ln@char{p}{people} +\def@char{q}{12345} \prefix@char{6}{q}{Q} \ln@char{q}{quite} +\def@char{r}{1235} \prefix@char{6}{r}{R} \ln@char{r}{rather} +\def@char{s}{234} \prefix@char{6}{s}{S} \ln@char{s}{so} +\def@char{t}{2345} \prefix@char{6}{t}{T} \ln@char{t}{that} +\def@char{u}{136} \prefix@char{6}{u}{U} \ln@char{u}{us} +\def@char{v}{1236} \prefix@char{6}{v}{V} \ln@char{v}{very} +\def@char{w}{2456} \prefix@char{6}{w}{W} \ln@char{w}{will} +\def@char{x}{1346} \prefix@char{6}{x}{X} \ln@char{x}{it} +\def@char{y}{13456} \prefix@char{6}{y}{Y} \ln@char{y}{you} +\def@char{z}{1356} \prefix@char{6}{z}{Z} \ln@char{z}{as} + +% Punctuation +\def@char{,}{2} \ln@char{,}{ea} +\def@char{;}{23} \ln@char{;}{bb} \ln@char{;}{be} +\def@char{:}{25} \ln@char{:}{cc} \ln@char{:}{con} +\def@char{.}{256} \ln@char{.}{$} \ln@char{.}{dd} \ln@char{.}{dis} +\def@char{!}{235} \ln@char{!}{ff} \ln@char{!}{to} +\def@char{(}{2356} \ln@char{(}{)} \ln@char{(}{gg} \ln@char{(}{were} +\def@char{``}{236} \ln@char{``}{?} \ln@char{``}{his} +\def@char{''}{356} \ln@char{''}{by} \ln@char{''}{was} +\def@char{-}{36} \ln@char{-}{com} +\def@char{'}{3} +\def@char{/}{34} +\prefix@char{6}{(}{[} +\suffix@char{)}{3}{]} +\prefix@char{6}{``}{.`} % `...' is same as {.`}...{'.} which is +\suffix@char{''}{3}{'.} % similar to actual braille code. +\ln@@char{in}{in}{*} +\ln@@char{:}{p}{percent} % spell out \% + +% Multi letter +\def@char{and}{12346} +\def@char{for}{123456} +\def@char{of}{12356} +\def@char{the}{2346} +\def@char{with}{23456} + +\def@char{ch}{16} \ln@char{ch}{child} +\def@char{sh}{146} \ln@char{sh}{shall} +\def@char{th}{1456} \ln@char{th}{this} +\def@char{wh}{156} \ln@char{wh}{which} +\def@char{ou}{1256} \ln@char{ou}{out} +\def@char{st}{34} \ln@char{st}{still} % same as / + +\def@char{ar}{345} +\def@char{er}{12456} +\def@char{ed}{1246} +\def@char{gh}{126} +\def@char{ow}{246} + +% Miscellaneous +\def@char{ble}{3456} % same as {Number} +\def@char{ing}{346} +\def@char{in}{35} +\ln@@char{in}{to}{into} +\def@char{en}{26} \ln@char{en}{enough} + +% Final letter contraction +\prefix@char{46}{d}{ound} +\prefix@char{46}{e}{ance} +\prefix@char{46}{n}{sion} +\prefix@char{46}{s}{less} +\prefix@char{46}{t}{ount} + +\prefix@char{56}{e}{ence} +\prefix@char{56}{g}{ong} +\prefix@char{56}{l}{ful} +\prefix@char{56}{n}{tion} +\prefix@char{56}{s}{ness} +\prefix@char{56}{t}{ment} +\prefix@char{56}{y}{ity} + +\prefix@char{6}{n}{ation} +\prefix@char{6}{y}{ally} + +% Initial letter contraction +\prefix@char{45}{u}{upon} +\prefix@char{45}{w}{word} +\prefix@char{45}{th}{those} +\prefix@char{45}{wh}{whose} +\prefix@char{45}{the}{these} + +\prefix@char{456}{c}{cannot} +\prefix@char{456}{h}{had} +\prefix@char{456}{m}{many} +\prefix@char{456}{s}{spirit} +\prefix@char{456}{w}{world} +\prefix@char{456}{the}{their} + +\prefix@char{5}{d}{day} +\prefix@char{5}{e}{ever} +\prefix@char{5}{f}{father} +\prefix@char{5}{h}{here} +\prefix@char{5}{k}{know} +\prefix@char{5}{l}{lord} +\prefix@char{5}{m}{mother} +\prefix@char{5}{n}{name} +\prefix@char{5}{o}{one} +\prefix@char{5}{p}{part} +\prefix@char{5}{q}{question} +\prefix@char{5}{r}{right} +\prefix@char{5}{s}{some} +\prefix@char{5}{t}{time} +\prefix@char{5}{u}{under} +\prefix@char{5}{w}{work} +\prefix@char{5}{y}{young} + +\prefix@char{5}{ch}{character} +\prefix@char{5}{th}{through} +\prefix@char{5}{wh}{where} +\prefix@char{5}{ou}{ought} +\prefix@char{5}{the}{there} + +% Abbreviation for whole word +\new@char{about}{\braille{ab}} +\new@char{above}{\braille{abv}} +\new@char{according}{\braille{ac}} +\new@char{across}{\braille{acr}} +\new@char{after}{\braille{af}} +\new@char{afternoon}{\braille{afn}} +\new@char{afterward}{\braille{afw}} +\new@char{again}{\braille{ag}} +\new@char{against}{\braille{ag{st}}} +\new@char{almost}{\braille{alm}} +\new@char{already}{\braille{alr}} +\new@char{also}{\braille{al}} +\new@char{although}{\braille{al{th}}} +\new@char{altogether}{\braille{alt}} +\new@char{always}{\braille{alw}} +\new@char{because}{\braille{{be}c}} +\new@char{before}{\braille{{be}f}} +\new@char{behind}{\braille{{be}h}} +\new@char{below}{\braille{{be}l}} +\new@char{beneath}{\braille{{be}n}} +\new@char{beside}{\braille{{be}s}} +\new@char{between}{\braille{{be}t}} +\new@char{beyond}{\braille{{be}y}} +\new@char{blind}{\braille{bl}} +\new@char{braille}{\braille{brl}} +\new@char{children}{\braille{{ch}n}} +\new@char{conceive}{\braille{{con}cv}} +\new@char{conceiving}{\braille{{con}cvg}} +\new@char{could}{\braille{cd}} +\new@char{deceive}{\braille{dcv}} +\new@char{deceiving}{\braille{dcvg}} +\new@char{declare}{\braille{dcl}} +\new@char{declaring}{\braille{dclg}} +\new@char{either}{\braille{ei}} +\new@char{first}{\braille{f{st}}} +\new@char{friend}{\braille{fr}} +\new@char{good}{\braille{gd}} +\new@char{great}{\braille{grt}} +\new@char{herself}{\braille{h{er}f}} +\new@char{him}{\braille{hm}} +\new@char{himself}{\braille{hmf}} +\new@char{immediate}{\braille{imm}} +\new@char{its}{\braille{xs}} +\new@char{itself}{\braille{xf}} +\new@char{letter}{\braille{lr}} +\new@char{little}{\braille{ll}} +\new@char{much}{\braille{m{ch}}} +\new@char{must}{\braille{m{st}}} +\new@char{myself}{\braille{myf}} +\new@char{necessary}{\braille{nec}} +\new@char{neither}{\braille{nei}} +\new@char{o'clock}{\braille{o'c}} +\new@char{oneself}{\braille{{one}f}} +\new@char{ourselves}{\braille{{ou}rvs}} +\new@char{paid}{\braille{pd}} +\new@char{perceive}{\braille{p{er}cv}} +\new@char{perceiving}{\braille{p{er}cvg}} +\new@char{perhaps}{\braille{p{er}h}} +\new@char{quick}{\braille{qk}} +\new@char{receive}{\braille{rcv}} +\new@char{receiving}{\braille{rcvg}} +\new@char{rejoice}{\braille{rjc}} +\new@char{rejoicing}{\braille{rjcg}} +\new@char{said}{\braille{sd}} +\new@char{should}{\braille{{sh}d}} +\new@char{such}{\braille{s{ch}}} +\new@char{themselves}{\braille{{the}mvs}} +\new@char{thyself}{\braille{{th}yf}} +\new@char{today}{\braille{td}} +\new@char{together}{\braille{tgr}} +\new@char{tomorrow}{\braille{tm}} +\new@char{tonight}{\braille{tn}} +\new@char{would}{\braille{wd}} +\new@char{your}{\braille{yr}} +\new@char{yourself}{\braille{yrf}} +\new@char{yourselves}{\braille{yrvs}} + +\fi diff --git a/macros/latex/contrib/braille/braillegif1.gif b/macros/latex/contrib/braille/braillegif1.gif Binary files differnew file mode 100644 index 0000000000..2ab7345bce --- /dev/null +++ b/macros/latex/contrib/braille/braillegif1.gif diff --git a/macros/latex/contrib/braille/braillegif2.gif b/macros/latex/contrib/braille/braillegif2.gif Binary files differnew file mode 100644 index 0000000000..5f49902dc9 --- /dev/null +++ b/macros/latex/contrib/braille/braillegif2.gif diff --git a/macros/latex/contrib/braille/grade1.py b/macros/latex/contrib/braille/grade1.py new file mode 100644 index 0000000000..925c2514e8 --- /dev/null +++ b/macros/latex/contrib/braille/grade1.py @@ -0,0 +1,55 @@ +""" +Converts ASCII text to Grade 1 Braille as described in + braille.sty, summary.tex +Essentially, it marks up + {Letter}, {Number}, + {``}...{''} for double quotation which must be typed as ``...'', + {.`}...{'.} for single quotation which must be typed as .`...'., + {percent} +so that the text is acceptable as input to \braille{}. The output is +striped and returned all in one line. + +Usage: +>>> grade1.convert("I like computer") +"I like computer" +>>> grade1.convert("April 1999") +"April {Number}1999" +>>> grade1.convert("I said ``hello'', and she said ``goodbye''.") +"I said {``}hello{''}, and she said {``}goodbye{''}." + +Usage: + python grade1.py < text > tags +""" +import string + +Number = '0123456789' + +def convert(line): + line = string.replace(line, "``", "{``}") # ``...'' + line = string.replace(line, "''", "{''}") + line = string.replace(line, ".`", "{.`}") # .`...'. + line = string.replace(line, "'.", "{'.}") + line = string.replace(line, '%', '{percent}') # % + s, oldi, oldii, skipchars = '', ' ', ' ', 0 + for i in line: + if i == '{': + skipchars = 1 + elif i == '}': + skipchars = 0 + elif skipchars: # skip anything inside {...} + pass + elif oldi in Number and i in 'abcdefghij': + s = s + '{Letter}' + elif i in Number: + if (oldii in Number and oldi in '.-') or (oldi in Number): + pass + else: + s = s + '{Number}' + s, oldi, oldii = s + i, i, oldi + return string.join(string.split(s)) # return all in one line + + +if __name__ == '__main__': + import sys + line = sys.stdin.read() # swallow the whole thing + print convert(line) # may produce extra \n diff --git a/macros/latex/contrib/braille/grade2.py b/macros/latex/contrib/braille/grade2.py new file mode 100644 index 0000000000..91752c0e64 --- /dev/null +++ b/macros/latex/contrib/braille/grade2.py @@ -0,0 +1,200 @@ +""" +Converts ASCII text to Grade 2 Braille tags as described in + braille.sty, summary.tex +Grade 2 has 189 multi-character contractions and rules where they can +be used. It uses grade1.py for final markup. + +Usage: +>>> grade2.convert("I like computer") +"I {like} {com}put{er}" +>>> grade2.convert("April 1999") +"April {Number}1999" +>>> grade2.convert("I said ``hello'', and she said ``goodbye''.") +"I {said} {``}hello{''}, {and} {sh}e {said} {``}goodbye{''}." + +Usage: + python grade2.py < text > tags +""" +import string, re, grade1 + +part_of_word = [ + 'and', 'for', 'of', 'the', 'with', + + 'ch', 'sh', 'th', 'wh', 'ou', 'st', + + 'ar', 'er', 'ed', 'gh', 'ow', + + 'en', 'in', +] +beginning_of_word = [ + 'be', 'com', 'con', 'dis', +] +middle_of_word = [ + 'bb', 'ble', 'cc', 'dd', 'ea', 'ff', 'gg', 'ing', +] +end_of_word = [ + 'ble', 'ing', +] +final_letter_contraction = [ # middle or end of word + 'ound', 'ance', 'sion', 'less', 'ount', + + 'ence', 'ong', 'ful', 'tion', 'ness', 'ment', 'ity', + + 'ation', 'ally', +] +initial_letter_contraction = [ # whole or part of word + 'these', 'those', 'upon', 'whose', 'word', + + 'cannot', 'had', 'many', 'spirit', 'their', 'world', + + 'character', 'day', 'ever', 'father', 'here', 'know', 'lord', + 'mother', 'name', 'one', 'ought', 'part', 'question', 'right', + 'some', 'there', 'through', 'time', 'under', 'where', 'work', + 'young', +] +whole_word = [ + 'and', 'for', 'of', 'the', 'with', + + 'child', 'shall', 'this', 'which', 'out', 'still', + + 'but', 'can', 'do', 'every', 'from', 'go', 'have', 'just', + 'knowledge', 'like', 'more', 'not', 'people', 'quite', 'rather', + 'so', 'that', 'us', 'very', 'will', 'it', 'you', 'as', + + 'be', 'by', 'enough', 'his', 'in', 'into', 'to', 'was', 'were', + + 'about', 'above', 'according', 'across', 'after', 'afternoon', + 'afterward', 'again', 'against', 'almost', 'already', 'also', + 'although', 'altogether', 'always', 'because', 'before', 'behind', + 'below', 'beneath', 'beside', 'between', 'beyond', 'blind', + 'braille', 'children', 'conceive', 'conceiving', 'could', + 'deceive', 'deceiving', 'declare', 'declaring', 'either', 'first', + 'friend', 'good', 'great', 'herself', 'him', 'himself', + 'immediate', 'its', 'itself', 'letter', 'little', 'much', 'must', + 'myself', 'necessary', 'neither', "o'clock", 'oneself', + 'ourselves', 'paid', 'perceive', 'perceiving', 'perhaps', 'quick', + 'receive', 'receiving', 'rejoice', 'rejoicing', 'said', 'should', + 'such', 'themselves', 'thyself', 'today', 'together', 'tomorrow', + 'tonight', 'would', 'your', 'yourself', 'yourselves', +] + + +def begintag(tag, word): + return re.sub('^%s(.)' % tag, r'{%s}\1' % tag, word) + +def middletag(tag, word): + return re.sub('(.)%s(.)' % tag, r'\1{%s}\2' % tag, word) + +def endtag(tag, word): + return re.sub('(.)%s$' % tag, r'\1{%s}' % tag, word) + +def parttag(tag, word): + return string.replace(word, tag, '{' + tag + '}') + + +# Check if word or part of word can be replaced by Grade 2 +# contractions. Returns string with Braille tags. +# +def replace(word): + if word in whole_word + initial_letter_contraction: # whole word + return '{' + word + '}' + + for tag in initial_letter_contraction: # whole or part of word + word = parttag(tag, word) + for tag in final_letter_contraction: # middle or end of word + word = middletag(tag, word) + word = endtag(tag, word) + for tag in beginning_of_word: word = begintag(tag, word) + for tag in end_of_word: word = endtag(tag, word) + for tag in middle_of_word: word = middletag(tag, word) + for tag in part_of_word: word = parttag(tag, word) + + s, braces = '', 0 + for i in word: # remove nested braces + if i == '{': + braces = braces + 1 + if braces == 1: s = s + i + elif i == '}': + braces = braces - 1 + if braces == 0: s = s + i + else: + s = s + i + return s + + +# Check if word, containing [a-zA-Z] only, is all UPPER case. +# +def alluppercase(word): # ^[A-Z]+$ + if len(word) == 0: return 0 + for i in word: + if i not in string.uppercase: return 0 + return 1 + + +# Check if word, containing [a-zA-Z] only, is all lower case. +# +def alllowercase(word): # ^[a-z]+$ + if len(word) == 0: return 0 + for i in word: + if i not in string.lowercase: return 0 + return 1 + + +# Check if word, containing [a-zA-Z] only, is Capitalized. +# +def capitalized(word): # ^[A-Z][a-z]*$ + if len(word) == 0: + return 0 + elif len(word) == 1: + return alluppercase(word[0]) + else: + return alluppercase(word[0]) and alllowercase(word[1:]) + + +def convert(line): + s = '' + for word in re.split('([a-zA-Z]+)', line): + if len(word) <= 1 or word[0] not in string.letters: + s = s + word # no work if not 2 or more letters + elif alluppercase(word): + s = s + '{Upper}' + replace(string.lower(word)) + elif capitalized(word): + w = replace(string.lower(word)) + if w[0] in string.lowercase: + s = s + word[0] + w[1:] # preserve Capital letter + else: + s = s + '{Capital}' + w + else: + s = s + replace(word) + + # manually handle whole word {o'clock} + s = re.sub(r"\bo'clock\b", "{o'clock}", s) + + # whole words {in}, {be}, {enough}, {his}, {was}, {were} + # cannot touch punctuations + s = nopunctuations('{in}', 'in', s) + s = nopunctuations('{be}', 'be', s) + s = nopunctuations('{enough}', '{en}{ou}{gh}', s) + s = nopunctuations('{his}', 'his', s) + s = nopunctuations('{was}', 'was', s) + s = nopunctuations('{were}', 'w{er}e', s) + + # no space after whole words {by}, {into}, {to} + s = re.sub(r'{(by|into|to)}\s+', r'{\1}', s) + + return grade1.convert(s) + + +# Change whole word '{tag}' to 'tag' when touching punctuations +# +def nopunctuations(tag, newtag, s): + s = re.sub(r'(\s|\A)%s([^\s\w{}])' % tag, r'\1%s\2' % newtag, s) + s = re.sub(r'([^\s\w{}])%s(\s|\Z)' % tag, r'\1%s\2' % newtag, s) + s = re.sub(r'([^\s\w{}])%s([^\s\w{}])' % tag, r'\1%s\2' % newtag, s) + return s + + +if __name__ == '__main__': + import sys + line = sys.stdin.read() # swallow the whole thing + print convert(line) # may produce extra \n diff --git a/macros/latex/contrib/braille/summary.pdf b/macros/latex/contrib/braille/summary.pdf Binary files differnew file mode 100644 index 0000000000..ab45bf5fb1 --- /dev/null +++ b/macros/latex/contrib/braille/summary.pdf diff --git a/macros/latex/contrib/braille/summary.tex b/macros/latex/contrib/braille/summary.tex new file mode 100644 index 0000000000..fd3be518d9 --- /dev/null +++ b/macros/latex/contrib/braille/summary.tex @@ -0,0 +1,683 @@ +\documentclass[draft]{article} +\usepackage{fullpage} +\usepackage[puttinydots]{braille} + +\newcommand{\mytable}[1]{% + \enskip\begin{tabular}[t]{r|l} + \hline #1 \hline + \end{tabular}\enskip} + +\newcommand{\mytablewith}[2]{% + \enskip\begin{tabular}[t]{r|l} + \multicolumn{2}{c}{#1} \\ + \hline #2 \hline + \end{tabular}\enskip} + +\newcommand{\mytaglist}[1]{% + \enskip\begin{tabular}[t]{@{}l@{}} + #1 + \end{tabular}\enskip} + + +\begin{document} + +\title{Summary of Grade 1 and 2 Braille} +\author{William Park} +\date{September 1998, April 1999} +\maketitle + + +\section{Braille Alphabets} + +The following is list of \TeX\ macros and Braille symbols contained in +{\tt braille.sty}. The user command \verb+\braille{}+ converts +sequence of tags to Braille symbols. A tag can be one character which +appears as is, or multi characters which must be enclosed with \{\}. +For each tag, a predefined TeX macro is called to print out the +Braille symbols. For example, \verb+\braille{a{the}b}+ prints out +Braille symbols for {\em a}, {\em the}, and {\em b}. + +As usual, \TeX\ collapses multiple spaces to single space, and ignores +spaces at the end of line, and tabs and newlines everywhere. This means +that for multi-line paragraph, there must be at least one space after +newline (\verb+\n+). + +\begin{center} +\mytable{ +\braille{a} & a 1 \\ +\braille{b} & b 2 \\ +\braille{c} & c 3 \\ +\braille{d} & d 4 \\ +\braille{e} & e 5 \\ +\braille{f} & f 6 \\ +\braille{g} & g 7 \\ +\braille{h} & h 8 \\ +\braille{i} & i 9 \\ +\braille{j} & j 0 \\ +\braille{k} & k \\ +\braille{l} & l \\ +\braille{m} & m \\ +\braille{n} & n \\ +\braille{o} & o \\ +} +\mytable{ +\braille{p} & p \\ +\braille{q} & q \\ +\braille{r} & r \\ +\braille{s} & s \\ +\braille{t} & t \\ +\braille{u} & u \\ +\braille{v} & v \\ +\braille{w} & w \\ +\braille{x} & x \\ +\braille{y} & y \\ +\braille{z} & z \\ +\braille{{and}} & \{and\} \\ +\braille{{ar}} & \{ar\} \\ +\braille{{ble}} & \{ble\} \\ +\braille{{ch}} & \{ch\} \\ +} +\mytable{ +\braille{{ed}} & \{ed\} \\ +\braille{{en}} & \{en\} \\ +\braille{{er}} & \{er\} \\ +\braille{{for}} & \{for\} \\ +\braille{{gh}} & \{gh\} \\ +\braille{{in}} & \{in\} \\ +\braille{{ing}} & \{ing\} \\ +\braille{{into}} & \{into\} \\ +\braille{{of}} & \{of\} \\ +\braille{{ou}} & \{ou\} \\ +\braille{{ow}} & \{ow\} \\ +\braille{{sh}} & \{sh\} \\ +\braille{{th}} & \{th\} \\ +\braille{{the}} & \{the\} \\ +\braille{{wh}} & \{wh\} \\ +\braille{{with}} & \{with\} \\ +} +\mytable{ +\braille{,} & , \{ea\} \\ +\braille{;} & ; \{bb\} \{be\} \\ +\braille{:} & : \{cc\} \{con\} \\ +\braille{.} & . \$ \{dd\} \{dis\} \\ +\braille{!} & ! \{ff\} \{to\} \\ +\braille{(} & ( ) \{gg\} \{were\} \\ +\braille{{``}} & \{`\,`\} ? \{his\} \\ +\braille{*} & * \\ +\braille{{''}} & \{'\,'\} \{by\} \{was\} \\ +\braille{'} & ' \\ +\braille{-} & - \{com\} \\ +\braille{/} & / \{st\} \\ +\braille{[} & [ \\ +\braille{]} & ] \\ +\braille{{.`}} & \{.`\} \\ % open single quote (`) +\braille{{'.}} & \{'.\} \\ % close single quote (') +\braille{{percent}} & \{percent\} \\ +} +\end{center} + +Double quotes are specified by the usual \TeX\ notation of 2 +consecutive single quotes (\verb+{``}...{''}+). Single quotes are +specified by 2 character notation (\verb+{.`}...{'.}+) similar to +actual Braille code. This is because apostrophe (') and closing +single quote (') are identical in print and in ASCII text. Also, \% +must be spelled out, because it is an escape character for comment in +\TeX. + + +\section{Prefix Indicator} + +\begin{center} +\mytable{ +\braille{{Capital}} & \{Capital\} \\ +\braille{{Upper}} & \{Upper\} \\ +\braille{{Italic}} & \{Italic\} \\ +} +\mytable{ +\braille{{Number}} & \{Number\} \\ +\braille{{Letter}} & \{Letter\} \\ +} +\end{center} + + +\section{Contraction for Part of Word} + +\begin{center} +\mytablewith{Anywhere}{ +\{and\}&and \\ +\{ar\}&ar \\ +\{ch\}&ch \\ +\{ed\}&ed \\ +\{en\}&en \\ +\{er\}&er \\ +\{for\}&for \\ +\{gh\}&gh \\ +\{in\}&in \\ +} +\mytablewith{Anywhere}{ +\{of\}&of \\ +\{ou\}&ou \\ +\{ow\}&ow \\ +\{sh\}&sh \\ +\{st\}&st \\ +\{th\}&th \\ +\{the\}&the \\ +\{wh\}&wh \\ +\{with\}&with \\ +} +\mytablewith{Beginning}{ +\{be\}&be \\ +\{com\}&com \\ +\{con\}&con \\ +\{dis\}&dis \\ +} +\mytablewith{Middle}{ +\{bb\}&bb \\ +\{ble\}&ble \\ +\{cc\}&cc \\ +\{dd\}&dd \\ +\{ea\}&ea \\ +\{ff\}&ff \\ +\{gg\}&gg \\ +\{ing\}&ing \\ +} +\mytablewith{End}{ +\{ble\}&ble \\ +\{ing\}&ing \\ +} +\end{center} + + +\section{Final Letter Contraction for Middle or End of Word} + +\begin{center} +\mytablewith{Prefix \braillebox{46}}{ +d&ound \\ +e&ance \\ +n&sion \\ +s&less \\ +t&ount \\ +} +\mytablewith{Prefix \braillebox{56}}{ +e&ence \\ +g&ong \\ +l&ful \\ +n&tion \\ +s&ness \\ +t&ment \\ +y&ity \\ +} +\mytablewith{Prefix \braillebox{6}}{ +n&ation \\ +y&ally \\ +} +\end{center} + + +\section{Initial Letter Contraction for Whole or Part of Word} + +\begin{center} +\mytablewith{Prefix \braillebox{45}}{ +\{the\}&these \\ +\{th\}&those \\ +u&upon \\ +\{wh\}&whose \\ +w&word \\ +} +\mytablewith{Prefix \braillebox{456}}{ +c&cannot \\ +h&had \\ +m&many \\ +s&spirit \\ +\{the\}&their \\ +w&world \\ +} +\mytablewith{Prefix \braillebox{5}}{ +\{ch\}&character \\ +d&day \\ +e&ever \\ +f&father \\ +h&here \\ +k&know \\ +l&lord \\ +m&mother \\ +n&name \\ +o&one \\ +\{ou\}&ought \\ +} +\mytablewith{Prefix \braillebox{5}}{ +p&part \\ +q&question \\ +r&right \\ +s&some \\ +\{the\}&there \\ +\{th\}&through \\ +t&time \\ +u&under \\ +\{wh\}&where \\ +w&work \\ +y&young \\ +} +\end{center} + + +\section{Abbreviation for Whole Word} + +\begin{center} +\mytable{ +ab&about \\ +abv&above \\ +ac&according \\ +acr&across \\ +af&after \\ +afn&afternoon \\ +afw&afterward \\ +ag&again \\ +ag\{st\}&against \\ +alm&almost \\ +alr&already \\ +al&also \\ +al\{th\}&although \\ +alt&altogether \\ +alw&always \\ +\{and\}&and \\ +z&as \\ +\{be\}&be \\ +\{be\}c&because \\ +\{be\}f&before \\ +\{be\}h&behind \\ +\{be\}l&below \\ +\{be\}n&beneath \\ +\{be\}s&beside \\ +\{be\}t&between \\ +\{be\}y&beyond \\ +bl&blind \\ +brl&braille \\ +b&but \\ +\{by\}&by \\ +} +\mytable{ +c&can \\ +\{ch\}&child \\ +\{ch\}n&children \\ +\{con\}cv&conceive \\ +\{con\}cvg&conceiving \\ +cd&could \\ +dcv&deceive \\ +dcvg&deceiving \\ +dcl&declare \\ +dclg&declaring \\ +d&do \\ +ei&either \\ +\{en\}&enough \\ +e&every \\ +f\{st\}&first \\ +\{for\}&for \\ +fr&friend \\ +f&from \\ +g&go \\ +gd&good \\ +grt&great \\ +h&have \\ +h\{er\}f&herself \\ +hm&him \\ +hmf&himself \\ +\{his\}&his \\ +imm&immediate \\ +\{in\}&in \\ +\{into\}&into \\ +x&it \\ +} +\mytable{ +xs&its \\ +xf&itself \\ +j&just \\ +k&knowledge \\ +lr&letter \\ +l&like \\ +ll&little \\ +m&more \\ +m\{ch\}&much \\ +m\{st\}&must \\ +myf&myself \\ +nec&necessary \\ +nei&neither \\ +n¬ \\ +o'c&o'clock \\ +\{of\}&of \\ +\{one\}f&oneself \\ +\{ou\}rvs&ourselves \\ +\{ou\}&out \\ +pd&paid \\ +p&people \\ +p\{er\}cv&perceive \\ +p\{er\}cvg&perceiving \\ +p\{er\}h&perhaps \\ +qk&quick \\ +q&quite \\ +r&rather \\ +rcv&receive \\ +rcvg&receiving \\ +rjc&rejoice \\ +} +\mytable{ +rjcg&rejoicing \\ +sd&said \\ +\{sh\}&shall \\ +\{sh\}d&should \\ +s&so \\ +\{st\}&still \\ +s\{ch\}&such \\ +t&that \\ +\{the\}&the \\ +\{the\}mvs&themselves \\ +\{th\}&this \\ +\{th\}yf&thyself \\ +\{to\}&to \\ +td&today \\ +tgr&together \\ +tm&tomorrow \\ +tn&tonight \\ +u&us \\ +v&very \\ +\{was\}&was \\ +\{were\}&were \\ +\{wh\}&which \\ +w&will \\ +\{with\}&with \\ +wd&would \\ +y&you \\ +yr&your \\ +yrf&yourself \\ +yrvs&yourselves \\ +} +\end{center} + +Abbreviation \verb+{in}+ cannot touch any other word or punctuation. +And, abbreviations \verb+{be}+, \verb+{enough}+, \verb+{his}+ +\verb+{was}+, and \verb+{were}+ cannot touch punctuations. + +Abbreviations \verb+{by}+, \verb+{into}+, and \verb+{to}+ must adjoin +next word without a space. But, abbreviations \verb+{and}+, +\verb+{for}+, \verb+{of}+, \verb+{the}+, \verb+{with}+, and letter +\verb+{a}+ can join one another if they occur as consecutive words. + + +\section{List of All Tags} + +\begin{center} +\mytaglist{ +about \\ +above \\ +according \\ +across \\ +after \\ +afternoon \\ +afterward \\ +again \\ +against \\ +ally \\ +almost \\ +already \\ +also \\ +although \\ +altogether \\ +always \\ +ance \\ +and \\ +ar \\ +as \\ +ation \\ +bb \\ +be \\ +because \\ +} +\mytaglist{ +before \\ +behind \\ +below \\ +beneath \\ +beside \\ +between \\ +beyond \\ +ble \\ +blind \\ +braille \\ +but \\ +by \\ +can \\ +cannot \\ +cc \\ +ch \\ +character \\ +child \\ +children \\ +com \\ +con \\ +conceive \\ +conceiving \\ +could \\ +} +\mytaglist{ +day \\ +dd \\ +deceive \\ +deceiving \\ +declare \\ +declaring \\ +dis \\ +do \\ +ea \\ +ed \\ +either \\ +en \\ +ence \\ +enough \\ +er \\ +ever \\ +every \\ +father \\ +ff \\ +first \\ +for \\ +friend \\ +from \\ +ful \\ +} +\mytaglist{ +gg \\ +gh \\ +go \\ +good \\ +great \\ +had \\ +have \\ +here \\ +herself \\ +him \\ +himself \\ +his \\ +immediate \\ +in \\ +ing \\ +into \\ +it \\ +its \\ +itself \\ +ity \\ +just \\ +know \\ +knowledge \\ +less \\ +} +\mytaglist{ +letter \\ +like \\ +little \\ +lord \\ +many \\ +ment \\ +more \\ +mother \\ +much \\ +must \\ +myself \\ +name \\ +necessary \\ +neither \\ +ness \\ +not \\ +o'clock \\ +of \\ +one \\ +oneself \\ +ong \\ +ou \\ +ought \\ +ound \\ +} +\mytaglist{ +ount \\ +ourselves \\ +out \\ +ow \\ +paid \\ +part \\ +people \\ +perceive \\ +perceiving \\ +perhaps \\ +question \\ +quick \\ +quite \\ +rather \\ +receive \\ +receiving \\ +rejoice \\ +rejoicing \\ +right \\ +said \\ +sh \\ +shall \\ +should \\ +sion \\ +} +\mytaglist{ +so \\ +some \\ +spirit \\ +st \\ +still \\ +such \\ +th \\ +that \\ +the \\ +their \\ +themselves \\ +there \\ +these \\ +this \\ +those \\ +through \\ +thyself \\ +time \\ +tion \\ +to \\ +today \\ +together \\ +tomorrow \\ +tonight \\ +} +\mytaglist{ +under \\ +upon \\ +us \\ +very \\ +was \\ +were \\ +wh \\ +where \\ +which \\ +whose \\ +will \\ +with \\ +word \\ +work \\ +world \\ +would \\ +you \\ +young \\ +your \\ +yourself \\ +yourselves \\ +} +\end{center} + + +\section{Examples} + +\sloppy +\begin{itemize} +\item I like computer + + {\bf Grade 1:} I like computer \\ + \braille{I like computer} + + {\bf Grade 2:} I \{like\} \{com\}put\{er\} \\ + \braille{I {like} {com}put{er}} + +\item This document was created with LaTeX running on Linux + + {\bf Grade 1:} + This document was created with LaTeX running on Linux + \\ + \braille{This document was created with LaTeX running on Linux} + + {\bf Grade 2:} + \{Capital\}\{this\} docu\{ment\} \{was\} cr\{ea\}t\{ed\} \{with\} + LaTeX runn\{ing\} on L\{in\}ux + \\ + \braille{{Capital}{this} docu{ment} {was} cr{ea}t{ed} {with} LaTeX + runn{ing} on L{in}ux} + +\item Summary of grade 1 and 2 braille + + {\bf Grade 2:} + Summ\{ar\}y \{of\} grade \{Number\}1 \{and\} \{Number\}2 \{braille\} + \\ + \braille{Summ{ar}y {of} grade {Number}1 {and} {Number}2 {braille}} + +\item William Park + + {\bf Grade 1:} William Park \\ + \braille{William Park} + +\item September 1998 + + {\bf Grade 1:} September \{Number\}1998 \\ + \braille{September {Number}1998} + +\item I do not have to know how to read braille in order to produce + beautifully typeset braille documents. All I have to do is parse + ordinary text into tags for which TeX macros exist. TeX will, + then, print out predefined symbols associated with each tags. + + {\bf Grade 2:} + I \{do\} \{not\} \{have\} \{to\}\{know\} h\{ow\} \{to\}r\{ea\}d + \{braille\} \{in\} ord\{er\} \{to\}produce b\{ea\}uti\{ful\}ly + typeset \{braille\} docu\{ment\}s. All I \{have\} \{to\}\{do\} is + p\{ar\}se ord\{in\}\{ar\}y text \{into\}tags \{for\} \{which\} TeX + macros exist. TeX \{will\}, \{the\}n, pr\{in\}t \{out\} + pr\{ed\}ef\{in\}\{ed\} symbols associat\{ed\} \{with\} ea\{ch\} + tags. + \\ + \braille{I {do} {not} {have} {to}{know} h{ow} {to}r{ea}d {braille} + {in} ord{er} {to}produce b{ea}uti{ful}ly typeset {braille} + docu{ment}s. All I {have} {to}{do} is p{ar}se ord{in}{ar}y text + {into}tags {for} {which} TeX macros exi{st}. TeX {will}, {the}n, + pr{in}t {out} pr{ed}ef{in}{ed} symbols associat{ed} {with} ea{ch} + tags.} + +\end{itemize} + +\end{document} |