Skip to content

Commit 931299f

Browse files
committed
Polishing for 1.1
1 parent 23641cc commit 931299f

3 files changed

Lines changed: 29 additions & 17 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
all: datax.zip README.html
44

55
datax.zip: datax.pdf datax.dtx datax.ins README.md
6-
mkdir datax
6+
mkdir -p datax
77
cp $^ datax/
88
7z a $@ datax
99

1010
datax.pdf : datax.dtx datax.sty
1111
pdflatex -file-line-error -interaction=nonstopmode $<
1212

13-
datax.sty : datax.ins
14-
pdflatex -file-line-error -interaction=nonstopmode $<
13+
datax.sty : datax.ins datax.dtx
14+
pdflatex -file-line-error $<
1515

1616
README.html: README.md
17-
md2html $<
17+
md2html $< > $@
1818

1919
clean :
2020
$(RM) -rd datax

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@ LaTeX document
1616
The calculated length was \(a=\datax{a}\).
1717
```
1818

19+
## Copyright and license
20+
Copyright 2020 David Gustavsson
21+
22+
This package may be distributed and/or modified under the
23+
conditions of the LaTeX Project Public License, either
24+
version 1.3 of this license or (at your option) any later
25+
version. The latest version of this license is in:
26+
27+
http://www.latex-project.org/lppl.txt
28+
29+
and version 1.3 or later is part of all distributions of
30+
LaTeX version 2005/12/01 or later.

datax.dtx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@
1717
% \iffalse
1818
%<package>\NeedsTeXFormat{LaTeX2e}[2020/02/02]
1919
%<package>\ProvidesPackage{datax}
20-
%<package> [2020/11/16 v1.1 data import into LaTeX]
20+
%<package> [2020/11/17 v1.1 data import into LaTeX]
2121
%<package>\RequirePackage{pgfkeys}
2222
%<package>\RequirePackage{pgfopts}
23-
%<package>\ProcessPgfPackageOptions{/packageoptions}
24-
%
2523
%
2624
%<*driver>
27-
\begin{filecontents}{data.tex}
25+
\begin{filecontents}{datax-example-data.tex}
2826
\pgfkeyssetvalue{/datax/s}{A literal string}
2927
\pgfkeyssetvalue{/datax/x}{\num{2.4}}
3028
\pgfkeyssetvalue{/datax/c}{\SI{3e8}{\meter\per\second}}
3129
\end{filecontents}
3230
\documentclass{ltxdoc}
33-
\usepackage{datax}
31+
\usepackage[dataxfile=datax-example-data.tex]{datax}
3432
\usepackage{booktabs}
3533
\usepackage{siunitx}
3634
\usepackage[hidelinks]{hyperref}
@@ -44,7 +42,7 @@
4442
%</driver>
4543
% \fi
4644
%
47-
%\CheckSum{16}
45+
%\CheckSum{19}
4846
%
4947
% \CharacterTable
5048
% {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
@@ -103,9 +101,7 @@
103101
%
104102
% \section{Interactions}
105103
% Technically, \textsf{datax} only needs a data file consisting of a number of assignments:
106-
%
107104
% |\pgfkeyssetvalue{/datax/|\meta{tag}|}{|\meta{value}|}|
108-
%
109105
% but of course the entire point of the package is automation. For this, you need an interaction plugin for your script
110106
% language. If your language is not listed below, you might need to write this plugin for yourself, or request it.
111107
% \begin{center}
@@ -122,10 +118,9 @@
122118
%
123119
% \begin{macrocode}
124120
\pgfkeys{ %
125-
/packageoptions/.cd, %
126-
dataxfile/.store in = \dataxfile, %
127-
dataxfile = data.tex, %
121+
/packageoptions/dataxfile/.initial=data.tex, %
128122
}
123+
\ProcessPgfPackageOptions{/packageoptions}
129124

130125
\pgfkeys{ %
131126
/datax/.is family, datax, %
@@ -138,7 +133,12 @@
138133
}, %
139134
}
140135

141-
\InputIfFileExists{\dataxfile}{}{\PackageWarning{Cannot read file `\dataxfile' }}
136+
\def\dataxfile{./\pgfkeysvalueof{/packageoptions/dataxfile}}
137+
\InputIfFileExists{%
138+
\dataxfile
139+
}{}{
140+
\PackageWarning{datax}{Cannot read file `\dataxfile'}
141+
}
142142
% \end{macrocode}
143143
% \begin{macro}{\datax}
144144
% Include datum from the specified data file.
@@ -147,7 +147,7 @@
147147
\pgfkeysifdefined{/datax/#1}{ %
148148
\pgfkeysvalueof{/datax/#1} %
149149
}{ %
150-
\PackageWarning{datax}{Data value `#1' undefined }\textbf{??} %
150+
\PackageWarning{datax}{Data value `#1' undefined}\textbf{??} %
151151
} %
152152
}
153153
% \end{macrocode}

0 commit comments

Comments
 (0)