summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/memory
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/memory
Initial commit
Diffstat (limited to 'macros/latex/contrib/memory')
-rw-r--r--macros/latex/contrib/memory/README45
-rw-r--r--macros/latex/contrib/memory/memory.dtx136
-rw-r--r--macros/latex/contrib/memory/memory.ins55
-rw-r--r--macros/latex/contrib/memory/memory.pdfbin0 -> 30008 bytes
4 files changed, 236 insertions, 0 deletions
diff --git a/macros/latex/contrib/memory/README b/macros/latex/contrib/memory/README
new file mode 100644
index 0000000000..625922a8a0
--- /dev/null
+++ b/macros/latex/contrib/memory/README
@@ -0,0 +1,45 @@
+Copyright (C) 2013 by Song Zhiwei <songzw@gmail.com>
+
+The package memory.sty provides an easy way to declare object or array
+containers. If you are considering to use an auxiliary file, you really
+need this package rather than the heavy I/O manipulation.
+
+Usage:
+
+ 1. Declares a data variable in local scope or global scope.
+
+ \newdata{<local variable name>}
+ \newdata*{<global variable name>}
+
+ e.g. \newdata{Person} % Note: no backslash for variable declaration
+ \newdata*{Time} % Note: \Time is declared in global scope
+
+ 2. Uses = or := to set value. The := version sets expanded value to variable.
+
+ 1) Sets value as a single variable
+
+ \Person = {Song Zhiwei} % Note: add backslash for declared variable
+ \Time := \today % Note: set the expanded result of \today to \Time
+
+ 2) Sets value as an array.
+
+ \Person[1] = {28.3}
+
+ 3) Sets value as a multiple dimensional array.
+
+ \Time[2,5,\thesection] = \today % Note: the value will be saved globally
+ % for the global variable
+
+ 4) Sets value as an object.
+
+ \Person[description] = {A Chinese gentleman.}
+ \Person[hair] = {black}
+
+ 3. Gets values.
+
+ \Person % Song Zhiwei
+ \Time % May 13, 2013
+ \Person[1] % 28.3
+ \Time[2,5,\thesection] % May 13, 2013
+ \Person[description] % A Chinese gentleman.
+ \Person[hair] % black
diff --git a/macros/latex/contrib/memory/memory.dtx b/macros/latex/contrib/memory/memory.dtx
new file mode 100644
index 0000000000..537757498b
--- /dev/null
+++ b/macros/latex/contrib/memory/memory.dtx
@@ -0,0 +1,136 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2013 by Song Zhiwei <songzw@gmail.com>
+% -----------------------------------------------------------
+%
+% This file may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX
+% version 2006/05/20 or later.
+%
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\ProvidesFile{memory.dtx}
+%</driver>
+%<memory>\NeedsTeXFormat{LaTeX2e}[2003/12/01]
+%<memory>\ProvidesPackage{memory}
+%<*memory>
+ [2013/05/13 v1.2 containers for data of object and array in LaTeX]
+%</memory>
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{memory}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\OnlyDescription
+\begin{document}
+ \DocInput{memory.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{69}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \changes{v1.2}{2013/05/13}{Uses := to set the expanded value to a variable}
+% \changes{v1.1}{2013/05/11}{Reports warning when redeclaring a variable}
+% \changes{v1.0}{2013/05/10}{Initial version}
+%
+% \GetFileInfo{memory.dtx}
+%
+% \DoNotIndex{}
+%
+% \title{The \textsf{memory} package\thanks{This document
+% corresponds to \textsf{memory}~\fileversion, dated \filedate.}}
+% \author{Song Zhiwei\\\texttt{songzw@gmail.com}}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% The package memory.sty provides an easy way to declare object or array
+% containers.
+% If you are considering to use an auxiliary file, you really need
+% this package rather than the heavy I/O manipulation.
+%
+% \section{Usage}
+% \newcommand\MyDescribeMacro[1]{\marginpar{\raggedleft\strut\MacroFont#1}}
+% \DescribeMacro{\newdata\marg{variable}}
+% \DescribeMacro{\newdata*\marg{variable}}
+% These macros declare data variables locally and globally, respectively.
+% The value for star version is also saved globally.
+% \begin{verbatim}\newdata{Person} % Note: no backslash for the variable declaration
+%\newdata*{Time}\end{verbatim}\newdata{Person} \newdata*{Time}
+% Uses = or := to set value. The := version sets the expanded value to variable.
+% \MyDescribeMacro{\textbackslash\meta{var}\oarg{p}=\marg{value}}%
+% \MyDescribeMacro{\textbackslash\meta{var}\oarg{p}:=\marg{value}}\\[0.5em]
+% -- Sets value as a single variable.
+% \begin{verbatim}\Person = {Song Zhiwei} % Note: add backslash for declared variable
+%\Time := \today\end{verbatim}
+% \Person = {Song Zhiwei} \Time := \today
+% -- Sets value as an array.
+% \begin{verbatim}\Person[1] = {28.3}\end{verbatim}\Person[1] = {28.3}
+% -- Sets value as a multiple dimensional array.
+% \begin{verbatim}\Time[2,5,\thesection] = {13 May 2013}\end{verbatim}
+% \Time[2,5,\thesection] = {13 May 2013}
+% -- Sets value as an object.
+% \begin{verbatim}\Person[description] = {A Chinese gentleman.}
+%\Person[hair] = {black}\end{verbatim}
+% \Person[description] = {A Chinese gentleman.}
+% \Person[hair] = {black}
+% -- Gets values.
+% \MyDescribeMacro{\textbackslash\meta{variable}\oarg{p}}
+% \begin{center}\newcommand\VRule{\rule[-0.2em]{0.4pt}{1.2em}}
+% \verb|\Person|\hfill\VRule\quad\makebox[12em][l]{\Person}\\
+% \verb|\Time|\hfill\VRule\quad\makebox[12em][l]{\Time}\\
+% \verb|\Person[1]|\hfill\VRule\quad\makebox[12em][l]{\Person[1]}\\
+% \verb|\Time[2,5,\thesection]|\hfill\VRule\quad\makebox[12em][l]{\Time[2,5,\thesection]}\\
+% \verb|\Person[description]|\hfill\VRule\quad\makebox[12em][l]{\Person[description]}\\
+% \verb|\Person[hair]|\hfill\VRule\quad\makebox[12em][l]{\Person[hair]}
+% \end{center}
+%
+% \StopEventually{}
+\def\set@memory#1#2=#3{\if#1*\expandafter\gdef\csname#2\endcsname{#3}%
+ \else\expandafter\def\csname#2\endcsname{#3}\fi}
+\def\eset@memory#1#2=#3{\if#1*\expandafter\xdef\csname#2\endcsname{#3}%
+ \else\expandafter\edef\csname#2\endcsname{#3}\fi}
+\def\etest@memory#1#2:{\@ifnextchar={\eset@memory{#1}{#2}}
+ {\csname #2\endcsname:}}
+\def\data@memory#1#2{\@ifnextchar={\set@memory{#1}{@#2@memory}}
+ {\@ifnextchar:{\etest@memory{#1}{@#2@memory}}
+ {\csname @#2@memory\endcsname}}}
+\def\array@memory#1#2[#3]{\data@memory{#1}{#2@#3}}
+\def\newdata@memory#1#2{\@ifundefined{#2}
+ {\if#1*\expandafter\gdef\csname#2\endcsname{\@ifnextchar[
+ {\array@memory{#1}{#2}}{\data@memory{#1}{#2}}}%
+ \else \expandafter\def\csname#2\endcsname{\@ifnextchar[
+ {\array@memory{#1}{#2}}{\data@memory{#1}{#2}}}\fi}
+ {\PackageWarningNoLine{memory}{`#2' already defined.
+ Macro `newdata' ignored!}}}
+\def\newdata{\@ifnextchar*{\newdata@memory}{\newdata@memory{}}}
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/memory/memory.ins b/macros/latex/contrib/memory/memory.ins
new file mode 100644
index 0000000000..5bc4e75388
--- /dev/null
+++ b/macros/latex/contrib/memory/memory.ins
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2013 by Song Zhiwei <songzw@gmail.com>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX
+%% version 2006/05/20 or later.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/memory}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2013 by Song Zhiwei <songzw@gmail.com>
+
+This file may be distributed and/or modified under the conditions of
+the LaTeX Project Public License, either version 1.3c 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 32
+
+and version 1.3c or later is part of all distributions of LaTeX
+version 2006/05/20 or later.
+
+\endpreamble
+
+\generate{\file{memory.sty}{\from{memory.dtx}{memory}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* memory.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file memory.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/macros/latex/contrib/memory/memory.pdf b/macros/latex/contrib/memory/memory.pdf
new file mode 100644
index 0000000000..5a6e3b478a
--- /dev/null
+++ b/macros/latex/contrib/memory/memory.pdf
Binary files differ