• No results found

Bug reports can be opened at

N/A
N/A
Protected

Academic year: 2021

Share "Bug reports can be opened at"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

globalvals – Resuable variables for use in large projects

Charles Baynham 2019/02/06 (v 1.1)

This file is maintained by Charles Baynham.

Bug reports can be opened at

https://github.com/charlesbaynham/globalvals.

The globalvals package allow the user to declare a variable which can then be used anywhere else in a document, including before it was declared. This can be useful in large projects, where value can be entered once and automatically updated throughout the document, without having to maintain a seperate file full of definitions.

This is done by putting the definitions into the .aux files, therefore requiring two runs to get it right.

It implements two commands: \defVal{hkeyi}{hvaluei} and \useVal{<key>}.

\defVal sets up a global variable and \useVal recalls it.

Using \defVal twice with the same hkeyi will result in an error. Using \useVal for an undefined value will output the text “??”.

1 Defining a value

Defining a macro can be done using the command

\defVal

\defVal{hkey i}{hvaluei}

For example, you might call

\defVal{software_version}{v1.65}

hvalueis will be expanded, so you can also embed macros within your variables, e.g.:

\defVal{fractional_stability}{\SI{10E-16}{\per\sqrt\second}}

2 Using a variable

To use a defined variable, use the command

\useVal

\useVar{hkey i}

1

(2)

For instance, the values saved in section 1 could be recalled using

\useVal{software_version}

and

\useVal{fractional_stability}

to give “v1.65” and “10 × 10

−16

/ √ s”.

Importantly, values may be used before they are defined. This is handy if you e.g. would like to refer to a quantity in your abstract but it’s most sensible defined in a later chapter. Like so:

The clock’s fractional accuracy is estimated as

\useVal{an_important_quantity}.

...

\defVal{an_important_quantity}{\num{1E-18}}

to give

The clock’s fractional accuracy is estimated as 1 × 10

−18

.

2

Referenties

GERELATEERDE DOCUMENTEN

• The final author version and the galley proof are versions of the publication after peer review.. • The final published version features the final layout of the paper including

While organizations change their manufacturing processes, it tends they suffer aligning their new way of manufacturing with a corresponding management accounting

However, most large-eddy simulations of particle- laden flows still use the filtered fluid velocity in the particle’s equation of motion, 6 without incorporating a model for

Ondanks de niet gevonden directe effecten, wordt er wel een mediatie effect gevonden op de merkattitude via persuasion knowledge mits de advertentievermelding subtiel (@merk)

It also presupposes some agreement on how these disciplines are or should be (distinguished and then) grouped. This article, therefore, 1) supplies a demarcation criterion

By answering the research question, this research provides a better understanding about why unnecessary visits of elderly on EDs occur by elaborating on

Abbreviations: BMI, body mass index; CVID, common variable immunodeficiency disorders; ENT, ear nose throat; ESID, European Society for Immunodeficiencies; HRCT, high

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of