summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-10-26 00:55:25 +0000
committerKarl Berry <karl@freefriends.org>2011-10-26 00:55:25 +0000
commit74d5eba1f2b1707bfc98e257fa5fb2010db8ab25 (patch)
treeb62527850994265e1c2a2af6dde7c9e4e651964b /Master/texmf-dist
parent7ed807ef29f1caa222e89efe7542cf969725c79a (diff)
new latex package tram (25oct11)
git-svn-id: svn://tug.org/texlive/trunk@24395 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/tram/README12
-rw-r--r--Master/texmf-dist/doc/latex/tram/tram-doc.pdfbin0 -> 26324 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tram/tram-doc.tex32
-rw-r--r--Master/texmf-dist/fonts/source/public/tram/tram.mf82
-rw-r--r--Master/texmf-dist/tex/latex/tram/tram.sty140
5 files changed, 266 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/tram/README b/Master/texmf-dist/doc/latex/tram/README
new file mode 100644
index 00000000000..1b03b8f6567
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tram/README
@@ -0,0 +1,12 @@
+__________________
+The tram package
+
+This package implements tram environment that can be used
+for producing tram boxes in LaTeX.
+
+______________
+Vafa Khalighi
+vafaklg@gmail.com
+
+Copyright 2011
+Distributed under the LaTeX Project Public License
diff --git a/Master/texmf-dist/doc/latex/tram/tram-doc.pdf b/Master/texmf-dist/doc/latex/tram/tram-doc.pdf
new file mode 100644
index 00000000000..573ed32d6c3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tram/tram-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tram/tram-doc.tex b/Master/texmf-dist/doc/latex/tram/tram-doc.tex
new file mode 100644
index 00000000000..4e4c4cac3b2
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tram/tram-doc.tex
@@ -0,0 +1,32 @@
+\documentclass{article}
+\usepackage[left=2.5cm,right=2.5cm,bottom=2.5cm,top=2.5cm]{geometry}
+\usepackage{bidicode}
+\usepackage{tram}
+\title{The \textsf{tram} Package}
+\author{Vafa Khalighi}
+\begin{document}
+\maketitle
+\textsf{tram.sty} provides the \texttt{tram} environment for typesetting tram boxes. Tram is a collection of heaps of tiny dots that you can put it in different parts of your document to decorate/emphasize your text. To tramize our text, we use \texttt{tram} environment which has the following syntax:
+\begin{BDef}
+\LBEG{tram}\OptArg{\Larga{integer}}\\
+\ldots\ \Larga{text} \ldots\\
+\LEND{tram}
+\end{BDef}
+Where \Larga{integer} is the optional argument and $0\leq\langle integer\rangle\leq1535$. Specifying \Larga{integer} changes the overall shapes of dots. If your text is more than one line, then you should use \Lcs{parbox} command or \texttt{minipage} environment:
+
+\bigskip
+\begin{lstlisting}
+%\begin{tram}[209]
+%\parbox{0.94\linewidth}{%
+%Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+%}
+%\end{tram}
+\end{lstlisting}
+
+\bigskip
+\begin{tram}[209]
+\parbox{0.94\linewidth}{%
+Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+}
+\end{tram}
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/fonts/source/public/tram/tram.mf b/Master/texmf-dist/fonts/source/public/tram/tram.mf
new file mode 100644
index 00000000000..163ffbec601
--- /dev/null
+++ b/Master/texmf-dist/fonts/source/public/tram/tram.mf
@@ -0,0 +1,82 @@
+%%
+%% This is file `tram.mf',
+
+%%
+%% __________________________________
+%% Copyright © 2011 Vafa Khalighi
+%%
+%% License information appended.
+%%
+%%
+
+
+font_identifier:="tram";
+mode_setup;
+em#:=10pt#;
+fctrs [1] = 0.25;
+fctrs [2] = 0.30;
+fctrs [3] = 0.35;
+fctrs [4] = 0.40;
+fctrs [5] = 0.45;
+fctrs [6] = 0.50;
+fctrs [7] = 0.60;
+fctrs [8] = 0.75;
+bwd = 0.1;
+for i = 1 step 1 until 16:
+ penwd [i] = bwd;
+ bwd := bwd * 1.2;
+endfor;
+picture bpic,cpic;
+boolean badpen;
+ch:=0; cnt:=10;
+
+for peni = 1 step 1 until 16:
+ pen_x#:=penwd [peni] * pt#;
+ for fctri = 1 step 1 until 8:
+ wd#:=(1.5*1/(fctrs [fctri]))*pen_x#;
+ define_pixels(pen_x, wd);
+ badpen := false;
+ if pen_x < 1.0 : pen_x := 1.0; badpen := true; fi
+ cpic:=nullpicture;
+ fw := 5pt# / wd#; fw := round (fw + 0.5); if fw < 1 : fw := 1; fi;
+ fw := 2fw; % showvariable pen_x; showvariable fw; showvariable wd;
+ beginchar(ch,fw*wd#,fw*wd#,0);
+ x1:=0; x2:=x1; x3:=(1+.5wd); x4:=x3;
+ y1:=.5wd; y2:=(y1+wd); y3:=(y1-.5wd); y4:=(y3+wd);
+ if badpen or (wd < 2.99) :
+ x1 := x2 := 0.wd; y1 := y2 := 0.5wd;
+ fi;
+ fill fullcircle scaled pen_x shifted(z1);
+ fill fullcircle scaled pen_x shifted(z2);
+ if not badpen or (wd > 3) :
+ fill fullcircle scaled pen_x shifted(z3);
+ fill fullcircle scaled pen_x shifted(z4);
+ fi;
+ bpic:=currentpicture;
+ for i = 1 step 1 until fw - 1:
+ currentpicture:=currentpicture + bpic shifted (i*wd, 0);
+ endfor;
+ bpic:=currentpicture;
+ for i = 2 step 2 until fw - 1:
+ currentpicture:=currentpicture + bpic shifted (0, i*wd);
+ endfor;
+ endchar;
+ ch := ch + 1;
+ endfor; %%% fctri
+endfor; %%% peni
+end;
+%%
+%% Copyright © 2011 by Vafa Khalighi <vafaklg@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Vafa Khalighi.
+%%
+%%
+%%
+%%
+%%
+%% End of file `tram.mf'.
diff --git a/Master/texmf-dist/tex/latex/tram/tram.sty b/Master/texmf-dist/tex/latex/tram/tram.sty
new file mode 100644
index 00000000000..68b195ed2bd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tram/tram.sty
@@ -0,0 +1,140 @@
+%%
+%% This is file `tram.sty',
+
+%%
+%% __________________________________
+%% Copyright © 2011 Vafa Khalighi
+%%
+%% License information appended.
+%%
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tram}[2011/10/25 v0.1 tram boxes in LaTeX]
+
+\newcount\mabnayeteramgozari
+\newdimen\@fas
+\newcount\@ater
+\newcount\@peter
+\newbox\@ketram
+\newbox\@metram
+
+\def\sotoneteram{\noalign\bgroup\@ifnextchar[{\@setram}{\@setram[\mabnayeteramgozari]}}
+
+\def\@setram[#1]#2{\@tainteram{#1}\@@setram[#2]}
+
+\def\@@setram[#1-#2]#3{%
+\global\@ater#1\relax\global\advance\@ater\m@ne
+\ifnum\@ater<0 \global\let\@temptokena\@terameyek\else\global\let\@temptokena\@teramedo\fi
+\global\@peter#2\relax\global\advance\@peter-\@ater
+\setbox\@ketram\hbox{\ghalameteram\teramemabna}%
+\@tempdimb\ht\@ketram \advance\@tempdimb\dp\@ketram
+\global\@fas\ht\@arstrutbox \global\advance\@fas\dp\@arstrutbox
+\global\@fas #3\@fas
+\@tempdima=\@fas \@tempcnta\@tempdima \divide\@tempcnta \@tempdimb
+\advance\@tempdima-\@tempcnta\@tempdimb
+\ifdim\@tempdima<8\p@ \advance\@tempcnta\@ne\fi
+\@tempdima \@tempcnta\@tempdimb
+\setbox\@ketram\vbox to \@tempdima{\cleaders\box\@ketram\vfill}%
+\global\setbox\@ketram\vbox to \@fas{\vss\box\@ketram\vss}\egroup\@temptokena}
+
+
+
+
+\def\@terameyek{\multispan\@ater&\@teramedo}
+
+\def\@teramedo{\multispan\@peter\unskip\@ifnextchar[{\@terameseh}{\@ifteramchahar}}
+
+\def\@ifteramchahar{\@ifnextchar>{\@teramechahar}{\@teramechahar>\z@,\z@<}}
+
+
+
+
+\def\@terameseh[#1]{\@tempdima #1\relax\@tempcnta \@tempdima \advance\@tempcnta 200\relax
+\divide\@tempcnta \wd\@ketram \@tempdimb \@tempcnta\wd\@ketram
+\setbox\@ketram\hbox to \@tempdimb{\cleaders\box\@ketram\hfill}%
+\hfill\box\@ketram\hfill\cr\noalign{\vskip-\@fas}}
+
+
+
+\def\@teramechahar>#1,#2<{\kern#1\cleaders\box\@ketram\hfill
+\kern#2\relax\cr\noalign{\vskip-\@fas}}
+
+
+
+
+
+\def\@tainteram#1{\count@=#1\relax \@tempcnta=\count@
+\divide\@tempcnta by 128
+\edef\@tramstep{\ifcase \@tempcnta 482\or 579\or 694\or 833\or 913\or
+1000 \or 1095\or 1200\or 1440\or 1728\or 2074\else 2488\fi}%
+\multiply\@tempcnta by 128 \advance\count@-\@tempcnta
+\font\ghalameteram=tram scaled \@tramstep
+\chardef\teramemabna=\count@}
+
+
+
+
+\newenvironment{tram}[1][\mabnayeteramgozari]
+{\@tainteram{#1}\setbox\@ketram\hbox\bgroup\ignorespaces}
+{\egroup\setbox\@ketram\vbox{\box\@ketram\vskip\z@}%
+\setbox\@metram\vbox{\@teramdarabad{\wd\@ketram}{\ht\@ketram}}
+\dimen@=\ht\@ketram
+\ifdim\dimen@>\ht\@metram \dimen@=\ht\@metram\fi
+\setbox\@ketram\vbox to \dimen@{\vss\box\@ketram\vss}%
+\setbox\@metram\vbox to \dimen@{\vss\box\@metram\vss}%
+\dimen@=\wd\@ketram
+\ifdim\dimen@>\wd\@metram \dimen@=\wd\@metram\fi
+\setbox\@ketram\hbox to \dimen@{\hss\box\@ketram\hss}%
+\setbox\@metram\hbox to \dimen@{\hss\box\@metram\hss}%
+\wd\@metram\z@
+\ht\@metram\z@
+\dp\@metram\z@
+\hbox to \dimen@{\box\@metram\box\@ketram}}
+
+
+
+
+
+\def\@teramdarabad#1#2{{%%
+\chardef\behbeh=0
+\dimendef\arzebeh=0
+\dimendef\ertebeh=3
+\dimendef\dimen@=4
+\countdef\tadaar=0
+\countdef\tadar=1
+\setbox\behbeh=\hbox{\ghalameteram\teramemabna}
+\arzebeh=\wd\behbeh
+\ertebeh=\ht\behbeh
+\dimen@#1\relax
+\tadaar\dimen@
+\dimen@#2\relax
+\tadar\dimen@
+\divide\tadaar by \arzebeh
+\divide\tadar by \ertebeh
+\dimen@#2\relax
+\advance\dimen@-\tadar\ertebeh
+\ifdim\dimen@<8\p@ \advance\tadar 2\fi
+\dimen@#1\relax
+\advance\dimen@-\tadaar\arzebeh
+\ifdim\dimen@<8\p@ \advance\tadaar 2\fi
+\hbox{\offinterlineskip
+\hbox to \tadaar\arzebeh{\cleaders%
+\vbox{\vbox to \tadar\ertebeh{\cleaders\hbox{\copy\behbeh}\vfil}}%%
+\hfil}}}}
+
+\endinput
+%%
+%% Copyright © 2011 by Vafa Khalighi <vafaklg@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Vafa Khalighi.
+%%
+%%
+%%
+%%
+%%
+%% End of file `tram.sty'.