texlive[56283] Master/texmf-dist: lua-physical (7sep20)
commits+karl at tug.org
commits+karl at tug.org
Mon Sep 7 23:20:24 CEST 2020
Revision: 56283
http://tug.org/svn/texlive?view=revision&revision=56283
Author: karl
Date: 2020-09-07 23:20:24 +0200 (Mon, 07 Sep 2020)
Log Message:
-----------
lua-physical (7sep20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/lualatex/lua-physical/README.md
trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.pdf
trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.tex
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testData.lua
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDefinition.lua
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDimension.lua
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testNumber.lua
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testQuantity.lua
trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testUnit.lua
trunk/Master/texmf-dist/scripts/lua-physical/physical.lua
Removed Paths:
-------------
trunk/Master/texmf-dist/scripts/lua-physical/physical-init.lua
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/README.md 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/README.md 2020-09-07 21:20:24 UTC (rev 56283)
@@ -2,9 +2,9 @@
Author: Thomas Jenni
-Version: 1.0.1
+Version: 1.0.2
-Date: 2020-09-05
+Date: 2020-09-07
License: MIT
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.tex 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/lua-physical.tex 2020-09-07 21:20:24 UTC (rev 56283)
@@ -89,9 +89,9 @@
keywordstyle=\ttfamily\bfseries\color{black},
basicstyle=\ttfamily\footnotesize,
commentstyle=\itshape\color{gray},
+ columns=flexible,
stringstyle=\ttfamily,
tabsize=2,
- numbers=right,
showstringspaces=false,
breaklines=true,
breakindent=30pt,
@@ -152,7 +152,7 @@
\lstset{language=[LaTex]Tex}
-\title{The \textsc{lua-physical} library \\\ \\\normalsize Version 1.0.1}
+\title{The \textsc{lua-physical} library \\\ \\\normalsize Version 1.0.2}
\author{Thomas Jenni}
\date{\today}
\maketitle
@@ -184,7 +184,6 @@
The following \LaTeX{} preamble loads the |lua-physical| package and creates a macro |\q| for printing physical quantities.
\nopagebreak
\begin{lstlisting}[language=Tex, caption=basic preamble, label=lst:basic preamble]
- \usepackage{lua-physical}
\usepackage{siunitx}
% configure siunitx
@@ -244,9 +243,9 @@
\end{luacode}
A car travels $\q{s}$ in $\q{t}$. calculate its velocity.
-$$
+\begin{align}
v=\frac{s}{t} = \frac{\q{s}}{\q{t}} = \uuline{\q{v}}
-$$
+\end{align}
\end{lstlisting}
\begin{luacode}
@@ -258,9 +257,9 @@
\leftbar
A car travels $\q{s}$ in $\q{t}$. Calculate its velocity.
-$$
+\begin{align}
v=\frac{s}{t} = \frac{\q{s}}{\q{t}} = \uuline{\q{v}}
-$$
+\end{align}
\endleftbar
In the above listing~\ref{lst:Car Velocity}, the variable |s| stands for displacement and has the unit meter |_m|, the variable |t| stands for time and is given in seconds |_s|. If mathematical operations are done on them, new physical quantities are created. In the problem above, the velocity |v| is calculated by dividing |s| by |t|. The instance |v| has the derived unit \si{\m\per\s}. By using the macro |\q{}| all quantities can be printed to the \LuaLaTeX{} code directly.
@@ -284,12 +283,12 @@
Find the volume of a rectangular cuboid with lengths $\q{a}$,
$\q{b}$ and $\q{c}$.
-$$
+\begin{align}
V= a \cdot b \cdot c
= \q{a} \cdot \q{b} \cdot \q{c}
= \q{V}
= \uuline{\q{V:to(_dm^3)}}
-$$
+\end{align}
\end{lstlisting}
\begin{luacode}
@@ -302,12 +301,12 @@
\leftbar
Find the volume of a rectangular cuboid with lengths $\q{a}$, $\q{b}$ and $\q{c}$.
-$$
+\begin{align}
V= a \cdot b \cdot c
= \q{a} \cdot \q{b} \cdot \q{c}
= \q{V}
= \uuline{\q{V:to(_dm^3)}}
-$$
+\end{align}
\endleftbar
@@ -395,9 +394,9 @@
The package supports uncertainty propagation. To create a number with an uncertainty, an instance of |physical.Number| has to be created, see listing~\ref{lst:rectangular area}. It has to be remembered, that |N| is a alias for |physical.Number|. The first argument of the constructor |N(mean, uncertainty)| is the mean value and the second one the uncertainty of the measurement. If the proposed preamble \ref{lst:basic preamble} is used, the uncertainty is by default seperated from the mean value by a plus-minus sign.
For the uncertainty propagation the gaussian formula
-$$
+\begin{align}
\Delta f = \sqrt{ \left(\frac{\partial f}{x_1} \cdot \Delta x_1\right)^2 + \dots + \left(\frac{\partial f}{x_n} \cdot \Delta x_2 \right)^2 }
-$$
+\end{align}
is used. This formula is a good estimation for the uncertainty $\Delta f$, if the quantities $x_1, \dots, x_n$ the function $f$ depends on, have no correlation. Further, the function $f$ has to change linear, if quantities $x_i$ are changed in the range of their uncertainties.
@@ -411,11 +410,11 @@
\end{luacode}
Calculate the area of a rectangle with lengths $\q{a}$ and $\q{b}$.
-$$
+\begin{align}
A = a \cdot b
= \q{a} \cdot \q{b}
= \uuline{\q{A}}
-$$
+\end{align}
\end{lstlisting}
\begin{luacode}
@@ -427,11 +426,11 @@
\leftbar
Calculate the area of a rectangle with lengths $\q{a}$ and $\q{b}$.
-$$
+\begin{align}
A = a \cdot b
= \q{a} \cdot \q{b}
= \uuline{\q{A}}
-$$
+\end{align}
\endleftbar
@@ -450,11 +449,11 @@
\end{luacode}
An ideal gas ($\q{n}$) has a pressure of $\q{p}$ and a temperature of $\q{T}$. Calculate the volume of the gas.
-$$
+\begin{align}
V=\frac{ \q{n} \cdot \q{_R} \cdot \q{(T + _degC_0):to(_K)} }{ \q{p} }
= \q{V}
= \uuline{\q{V}}
-$$
+\end{align}
\end{lstlisting}
@@ -470,10 +469,10 @@
\leftbar
An ideal gas ($\q{n}$) has a pressure of $\q{p}$ and a temperature of $\q{T}$. Calculate the volume of the gas.
-$$
+\begin{align}
V=\frac{ \q{n} \cdot \q{(_R*N(1,0.001)):to(_J/(_mol*_K))} \cdot \q{(T + _degC_0):to(_K)} }{ \q{p} }
= \uuline{\q{V}}
-$$
+\end{align}
\endleftbar
This example shows, that the result has only two digits. If more digits are needed, the uncertainties of the given quantities should be smaller.
@@ -2036,9 +2035,9 @@
\method{Q}{sinh(q)}
\begin{quote}
Returns the value of the hyperbolic sine function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\sinh(x) = 0.5 \cdot e^x - 0.5 / e^x \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -2067,9 +2066,9 @@
\method{Q}{cosh(q)}
\begin{quote}
Returns the value of the hyperbolic cosine function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\cosh(x) = 0.5 \cdot e^x + 0.5 / e^x \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -2097,9 +2096,9 @@
\method{Q}{tanh(q)}
\begin{quote}
Returns the value of the hyperbolic tangent function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}} \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -2128,9 +2127,9 @@
\method{Q}{asinh(q)}
\begin{quote}
Returns the value of the inverse hyperbolic sine function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\text{asinh}(x) = \ln\left( x + \sqrt{x^2 + 1} \right) \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -2159,9 +2158,9 @@
\method{Q}{acosh(q)}
\begin{quote}
Returns the value of the inverse hyperbolic cosine function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\text{acosh}(x) = \ln\left( x + \sqrt{x^2 - 1} \right) \quad, x > 1 \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -2190,9 +2189,9 @@
\method{Q}{atanh(q)}
\begin{quote}
Returns the value of the inverse hyperbolic tangent function of the given quantity. The quantity has to be dimensionless. Since Lua doesn't implement the hyperbolic functions, the following formula is used
- $$
+ \begin{align}
\text{atanh}(x) = \ln\left( \frac{1 + x}{1 - x} \right) \quad, -1 < x < 1 \quad.
- $$
+ \end{align}
\begin{description}
\item |q| : |Q|, |N|, |number|\\
@@ -3053,6 +3052,8 @@
\newpage
\section{Change History}
+V1.0.2 \quad (2020/09/07) Minor release. Path issues resolved. Docs corrected.
+
V1.0.1 \quad (2020/09/05) Minor release. Files renamed.
V1.0 \quad (2020/09/03) First official release.
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testData.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testData.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testData.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDefinition.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDefinition.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDefinition.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
local N = physical.Number
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDimension.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDimension.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testDimension.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
local D = physical.Dimension
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testNumber.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testNumber.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testNumber.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
local N = physical.Number
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testQuantity.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testQuantity.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testQuantity.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
local N = physical.Number
Modified: trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testUnit.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testUnit.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/doc/lualatex/lua-physical/test/testUnit.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -24,7 +24,7 @@
local lu = require("luaunit")
-package.path = "../?.lua;" .. package.path
+package.path = "../physical/?.lua;" .. package.path
local physical = require("physical")
local D = physical.Dimension
Deleted: trunk/Master/texmf-dist/scripts/lua-physical/physical-init.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lua-physical/physical-init.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/scripts/lua-physical/physical-init.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -1,53 +0,0 @@
---[[
-
-lua-physical
-
-Author: Thomas Jenni
-Version: 1.0.1
-Date: 2020-09-05
-
-License: MIT
-
-Copyright (c) 2020 Thomas Jenni
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-]]--
-
-local current_folder = (...):gsub('%.physical%-init$', '')
-
--- Source: http://kiki.to/blog/2014/04/12/rule-5-beware-of-multiple-files/
-
-local Dimension = require(current_folder .. '.physical-dimension')
-local Unit = require(current_folder .. '.physical-unit')
-local Quantity = require(current_folder .. '.physical-quantity')
-local Number = require(current_folder .. '.physical-number')
-
-require(current_folder .. '.physical-definition')
-
-local Data = require(current_folder .. '.physical-data')
-
-local m = {
- Dimension = Dimension,
- Unit = Unit,
- Number = Number,
- Quantity = Quantity,
- Data = Data
-}
-
-return m
\ No newline at end of file
Modified: trunk/Master/texmf-dist/scripts/lua-physical/physical.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lua-physical/physical.lua 2020-09-07 13:51:37 UTC (rev 56282)
+++ trunk/Master/texmf-dist/scripts/lua-physical/physical.lua 2020-09-07 21:20:24 UTC (rev 56283)
@@ -1 +1,51 @@
-return require((...) .. '.physical-init')
\ No newline at end of file
+--[[
+
+lua-physical
+
+Author: Thomas Jenni
+Version: 1.0.2
+Date: 2020-09-07
+
+License: MIT
+
+Copyright (c) 2020 Thomas Jenni
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+]]--
+
+-- Source: http://kiki.to/blog/2014/04/12/rule-5-beware-of-multiple-files/
+
+local Dimension = require('physical-dimension')
+local Unit = require('physical-unit')
+local Quantity = require('physical-quantity')
+local Number = require('physical-number')
+
+require('physical-definition')
+
+local Data = require('physical-data')
+
+local m = {
+ Dimension = Dimension,
+ Unit = Unit,
+ Number = Number,
+ Quantity = Quantity,
+ Data = Data
+}
+
+return m
\ No newline at end of file
More information about the tex-live-commits
mailing list.