CTAN Comprehensive TeX Archive Network

Direc­tory macros/latex/contrib/dynamicnumber

README.md

Dy­namic Num­ber

What is it?

Dy­namic Num­ber dy­nam­i­cally type­sets val­ues gen­er­ated in dif­fer­ent kinds of scripts in through the use of sym­bolic links. The aim is to re­duce er­rors re­sult­ing from out-of-date num­bers by di­rectly set­ting them in the num­ber gen­er­at­ing file and im­port­ing a sym­bolic link in the source file.

It can be used to im­port not only nu­mer­i­cal val­ues into , but even strings and pieces of code are pos­si­ble. The main repos­i­tory is lo­cated in this repos­i­tory.

At­ten­tion The sym­bolic links men­tioned here are NOT re­lated in any kind to the sym­bolic links used in UNIX sys­tems. See ex­am­ple be­low to see what is meant with a sym­bolic link.

In­stal­la­tion

Depend­ing on your de­sires, one or more might not be ap­pli­ca­ble. All the sup­ported lan­guages have a file in the languages folder. Cur­rently only MATLAB and Python are sup­ported to pro­duce Dy­namic Num­ber (dn) list files (also called sym­bolic link lists).

Cur­rently the pack­age is also avail­able on CTAN. This is the pre­ferred way of in­stalling pack­ages. You can thus down­load it us­ing your favourite pack­age man­ager. The in­struc­tions be­low are thus ob­so­lete.

MATLAB

Add the nec­es­sary func­tions to MATLAB's path.

  1. Clone the di­rec­tory in your MATLAB folder (Documents/MATLAB).
  2. Now the con­tents should be in Documents/MATLAB/DynamicNumber.
  3. Open MATLAB.
  4. Set path to in­clude the cloned folder. The Set path can be found in the File menu on older MATLAB in­stal­la­tions or HOME, En­vi­ron­ment in newer in­stal­la­tions.

Python

In­stall with pip: sudo pip install dynamicnumber

Quick start

us­age is very straight­for­ward. Load the pack­age with \usepackage{dynamicnumber} and next load a sym­bolic link lists with \dnreadfile{list}. Now you can start us­ing your dy­namic vari­ables with \dnget{variable}.

More in­for­ma­tion and ad­di­tional com­mands can be found in the doc­u­men­ta­tion.

At­ten­tion! Do not at­tempt to cre­ate a pgfkey with the name dynamicnumber, it will con­flict with the in­ter­nal work­ings of the pack­age.

MATLAB and Python

Create a sym­bolic link lists with the dn() com­mand, then add sym­bolic links with the add-method.

The add-method re­quires at least 2 ar­gu­ments: the sym­bolic link name and a value (ei­ther nu­mer­i­cal or string). The op­tional third can spec­ify a unit for the value. The sym­bolic link will be stored to type­set both num­ber and unit in a nice way, with the units pack­age (\unit{<value}{<unit>}).

Ex­am­ple (in Python, MATLAB code is al­most iden­ti­cal)

# Some computations and sensor readout to predict temperature tomorrow:
temperature = 23.4
temp_predictions = dn('TemperaturePredictions')
temp_predictions.add('tomorrow',temparture,'C') # or \\Celcius instead of C

Note!: If you wish to use spe­cial com­mands such as \Celcius or \metre, your need to be care­ful with the use of the back­slash. In MATLAB you only need to add one back­slash be­cause of the way it is parsed, but in Python you need to add two of them! This is needed be­cause the back­slash is also used for es­cape se­quences.

Con­tri­bu­tions

The li­braries are ba­sic in a sense that they do not have a lot of fea­tures or op­tions. This is in­ten­tional. Users can eas­ily adopt them to suit their own needs with­out hav­ing to go through 100s of lines of code and the learn­ing curve is very small. So the main goal is to have a li­brary that sup­port many plat­forms, is (al­most) iden­ti­cal on all these plat­forms and is sim­ple to use.

Bug fixes and small fea­ture im­prove­ments are al­ways wel­come, you can use a pull re­quest to add must-have fea­tures or per­form bug fixes.

Li­cense

See the LICENSE.txt file.

Down­load the con­tents of this pack­age in one zip archive (159.3k).

dy­nam­ic­num­ber – Dy­nam­i­cally type­set num­bers and val­ues in through “sym­bolic links”

This pack­age dy­nam­i­cally type­sets val­ues gen­er­ated by dif­fer­ent kinds of scripts in through the use of “sym­bolic links” (which are not in any way re­lated to the “sym­bolic links” used in UNIX sys­tems!). The aim is to re­duce er­rors re­sult­ing from out-of-date num­bers by di­rectly set­ting them in the num­ber gen­er­at­ing file and im­port­ing a “sym­bolic link” into the source file.

It can be used to im­port not only nu­mer­i­cal val­ues, but strings and pieces of code are also pos­si­ble.

Cur­rently only MATLAB and Python are sup­ported to pro­duce Dy­namic Num­ber list files.

Pack­agedy­nam­ic­num­ber
Re­pos­i­toryhttps://github.com/opi­eters/Dy­nam­icNum­ber
Ver­sion0.1.3
Li­censesMIT Li­cense
Copy­right2015 Olivier Pi­eters
Main­tainerOlivier Pi­eters
TDS archivedynamicnumber.tds.zip
Con­tained inTeX Live as dy­nam­ic­num­ber
MiKTeX as dy­nam­ic­num­ber
TopicsData im­port
...
Guest Book Sitemap Contact Contact Author