Home

siunitx — A comprehensive (SI) units package

image

Contents

1. 1 234 gram product cubed per mole 1 234 g prod mol 1 234 g prod mol 1 234 g prod mol Unit qualifiers can appear in a number of output formats The package expects a choice from the list subscript space and brackets These work as might be expected silunits output qualifier format subscript gram product silunits output qualifier format space gram product silunits output qualifier format brackets gram product Sprod g prod g prod When the qualifier is given as a subscript no brackets will be added if a power is given for the same unit For other formats brackets are added if use brackets is true Asi units output qualifier format subscript gram product squared silunits output qualifier format space gram product squared ae g prod 6 8 Symbols Most units use letters as the symbol for the unit and these are all very easy to control However a small number of units use other symbols and matching these to the body text requires more work siunitx provides appropriate symbols for commonly used units but the definitions may need adjustment depending on the body font used in a document The package provides one general option for the handling of symbols If the packages textcomp or upgreek are loaded symbols can be taken from these for units rather than using the siunitx default values The switch redefine symbols can be used to turn this behaviour on or o
2. num 456 123 0 0 456 123 456 The inclusion of a leading plus sign is usually unnecessary for positive numbers and so the retain explicit plus option is available to control whether these are printed As the same time it may be useful to force all numbers to have a sign This behaviour is controlled by the include explicit sign option with the sign to use stored by the explicit sign option num 345 Xnum numbers process retain explicit plus 345 MM Xnum numbers process explicit sign numbers process include explicit sign 113453 345 345 345 The retention of a zero exponent 10 is controlled by the retain zero exponent option num 444e0 Xnum numbers process retain zero exponent yes 444e0 444 444 x 10 16 numbers output group digits numbers output group four digits numbers output group separator Table 11 numbers output options Option name Type Default close bracket Literal close uncertainty Literal complex root Maths i decimal marker Maths exponent base Literal 10 exponent product Maths times group digits Switch true group four digits Switch false group separator Maths open bracket Literal open uncertainty Literal separate uncertainty Switch false tight spacing Switch false use brackets Switch true uncertainty space Maths none 6 5 Printing numbers Actually printing numbers is controlled by a number of settings which apply ideas
3. 3 6 3 Parsingnumbers 4 2 Numbers 3 6 4 Post processing numbers 4 3 Units as arguments 4 6 5 Printing numbers This file describes version v2 oalpha last revised 2009 03 29 E mail joseph wright morningstar2 co uk 10 12 13 14 16 6 6 Creating units 19 7 2 Using a comma as a separator 23 67 Using wits css 2 19 OS Symbols s scere ba 21 Change History 23 7 Usage tips and known issues 22 7 1 Ensuring text or maths output 22 Index 23 1 Introduction The correct application of units of measurement is very important in technical applica tions For this reason carefully crafted definitions of a coherent units system have been laid down by the Conf rence G n rale des Poids et Mesures CGPM this has resulted in the Syst me International d Unit s SI At the same time typographic conventions for correctly displaying both numbers and units exist to ensure that no loss of meaning occurs in printed matter siunitx aims to provide a unified method for IATEX users to typeset units and values correctly and easily The design philosophy of siunitx is to follow the agreed rules by default but to allow variation through option settings In this way users can use siunitx to follow the requirements of publishers co authors universities etc without needing to alter the input at all siunitx is intended as a complete replacement for Slunits Slstyle unitsdef units fancyuni
4. pm mp exponent markers dDeE are both valid The package uses a range of different key types Choice Takes a limited number of choices which are described separately for each key Literal A key which uses the value s given directly either to check input for example the numbers input keys or in output Maths Similar to a literal option but the input is always used in maths mode irre spective of other siunitx settings Thus to text mode only input must be placed inside the argument of a text macro Macro Requires a macro which may need a single argument 10 font detect bold font detect family font detect italic font detect mode font detect all font detect none Table 7 font detect options Option name Type Default all Style none bold Switch false display maths Switch false family Switch false inline bold Choice text italic Switch false mode Switch false none Style none Style A key which contains a number of other keys to set Only the key name should be given no value is required This type of key is user definable as described in Section Switch These are on off switches and recognise true on and yes to turn on and false off and no to turn off Giving just the key name also turns the key on The tables of option names use these descriptions to indicate how the keys should be used In all cases UK and US English spellings are available for both option names and for setting
5. Non SI units whose values in SI units must be obtained experimentally http www bipm org en si si_brochure chapter4 table7 html 7 Other non SI units http www bipm org en si si_brochure chapter4 table8 html 28
6. The separation between units and between a number and the units following it can be adjusted The options inter unit separator and number unit separator are used to store an appropriate spacing or separator value The separators are always printed in maths mode a full text space is therefore given as text When using literal unit input the symbol is converted into an inter unit space which can be different from that specified in inter unit separator By default per applies only to the next unit given By setting the sticky per flag this behaviour is changed so that per applies to all subsequent units Pa Gy H si pascal per gray henry Pa Gy71 H 1 silunits output sticky per pascal per gray henry As with numerical output there are some occasions when units can potentially be ambiguous This can be corrected by adding brackets in the appropriate place and is controlled by the use brackets switch The opening and closing brackets used are stored open bracket and close bracket respectively 5This is the standard method of reading units in English for example J mol K is pronounced joules per mole per kelvin 21 units output qualifier format symbols redefine symbols sisetup units output qualifier format space SI 1 234 gram product cubed per mole SI units output use brackets false 1 234 gram product cubed per mole ASI units output open bracket WM units output close bracket
7. decimal markers and signs respectively More than one input decimal marker can be used it will be converted by the package to the appropriate output marker Numbers which include an exponent part also require a marker for the exponent this again is taken from the range of tokens in the exponent markers option As well as normal digits the package will interpret symbolic numbers such as pi correctly if they are included in the symbols list Tokens given in the ignore list are totally passed over by siunitx they will be removed from the input with no further processing In some fields it is common to give the uncertainty in a value in brackets after the main part of the number for example 1 234 5 The opening and closing symbols used for this type of input are set as open uncertainty and close uncertainty When using complex numbers in input the complex root y 1 is indicated by one of 14 numbers process round mode numbers process round figures numbers process round places Table 10 numbers process options Option name Type Default add zero decimal Switch false add zero integer Switch false explicit sign Literal include explicit sign Switch false retain explicit plus Switch false retain zero exponent Switch false round mode Choice off round figures Number 2 round places Number 2 the tokens stored in complex roots 6 4 Post processing numbers Before typesetting numbers various post proce
8. mathtt mode Choice maths text rm Macro rmfamily text sf Macro sffamily text tt Macro ttfamily Some text x 1 2 x 10 kgKcd More text y 3msmol 6 2 Output font families The relationship between font family detected and font family used for output is not fixed The font detected by the package in the surrounding material does not have to match that used for output This is controlled by the font output options The mode option determines whether siunitx uses maths or text mode when printing output The choices are maths math and text When using maths mode text is printed using a maths font whereas in text mode a text font is used The extent to which this is visually obvious depends on the fonts in use in the document This manual uses old style lower case figures in text mode to highlight the differences This option has no effect if the font detect mode switch is on If font family detection is inactive siunitx uses the font family stored in either maths rm or text rm for output The choice of maths or text depends on the mode setting If font family detection is active siunitx may be using a sans serif or monospaced font for output In maths mode these are stored in maths sf and maths tt and for text mode in text s and text tt Notice that the detected and output font families can differ sisetup font detect family 7 1234 num 1234 1234 sffamily num 1234 MN 99m SI 99 metre 99m sisetup font maths
9. 3 Non SI units accepted for use with the International System of Units Unit Macro Symbol day day d degree degree E hectare hectare ha hour hour h litre litre l liter L minute plane angle arcminute minute time ninute min percent percent second plane angle arcsecond tonne tonne t Table 4 Non SI units whose values in SI units must be obtained experimentally Unit Macro Symbol astronomical unit astronomicalunit ua atomic mass unit atomicmassunit u bohr bohr a speed of light clight co dalton dalton Da electron mass electronmass Me electronvolt electronvolt eV elementary charge elementarycharge e hartree hartree En reduced Planck constant planckbar h Table 5 Other non SI units Unit Macro Symbol angstrom angstrom A bar bar bar barn barn b bel bel B decibel decibel dB knot knot kn millimetre of mercury mmHg mmHg nautical mile nauticalmile M neper neper Np square squared cubic cubed tothe raiseto per Table 6 SI prefixes Prefix Macro Symbol Power Prefix Macro Symbol Power yocto yocto y 107 deca Meca da 101 zepto zepto Zz 107 hecto hecto h 10 atto Natto a 1018 kilo kilo k 10 femto femto f 1071 mega mega M 10 pico pico p 1071 giga giga G 10 nano nano n 107 tera tera T 1012 micro micro u 1076 peta peta P 1015 milli milli m 1073 exa Nexa E 1018 centi centi c 107 zetta zetta Z 10 deci deci d 107 yotta yotta Y 104
10. 4 DeclareSIPower totheforth 4 A sit kilogram totheforth A sit quartic metre Following the syntax of the other macros qualifiers are created with the syntax DeclareSIQualifier qualifier symbol In contrast to the other parts of a unit there are no pre defined qualifiers It is therefore entirely up to the user to create these For example to identify the mass of a product created when using a particular catalyst the preamble could contain sisetup DeclareSIQualifier product prod DeclareSIQualifier catalyst cat and then in the body the document could read SI 1 234 gram product per mole catalyst per hour 1 hz cat 1 234 gproa mol 6 The key value control system The behaviour of the siunitx package is controlled by a number of key value options These can be given globally using the sisetup function or locally as the optional argument to the user macros All of the keys are controlled using the pgfkeys approach to organisation This means that the keys are split into paths of related keys A single key is set by giving the path plus key name if you need to set several keys on the same path you can change to the appropriate path and give the key name alone For example valid numerical input is controlled by keys in the numbers input path sisetupf numbers input signs pm mp numbers input exponent markers dDeE or sisetupf numbers input cd signs
11. defining macros for units instead of literal values new functionality is made available Units may be re defined to give different output and handling of reciprocal values can be altered Very often numbers and values are given together Mathematically these form a single entity and should be separated by a non breaking space The SI macro combines the functionality of num and si and makes this both possible and easy The SI macro takes two mandatory arguments in addition to the optional set up argument and a second optional argument ASI options number preunit unit The number and unit arguments work exactly like those for the num and si macros respectively preunit is a unit to be typeset before the numerical value most likely to be a currency SI font mode text 1 23 J mol7 1 K7 1 SI 23e7 candela A SI per sltash 1 99 per kilogram SI 70 metre per second ANSI per frac fraction nice 1 345 ampere per mole 1 23 molt Kt 0 23 x 107 cd 70ms 4 4 Units free standing 5 The unit macros The package always defines the basic set of SI units with macro names This includes the base SI units the derived units with special names and the prefixes A small number of powers are also given pre defined names Full details of units in the SI are available on line 1 The seven base SI units are always defined Table 1 In addition the macro meter is availab
12. macros exist outside of the si and SI arguments When this option is true siunitx creates the macros for general use The standard method to achieve this does not overwrite any existing macros this behaviour can be altered using the overwrite macros switch When free standing unit macros are created their behaviour can be adjusted by a number of options These are mainly intended for emulating the input syntax of older packages The option allow optional argument gives the same behaviour for the inputs 19 units output allow literal units units output allow unit number breaks Table 12 units creation options Option name Type Default add leading space Switch false allow in body Switch false allow optional argument Switch false overwrite macros Switch false use xspace Switch false SI 10 metre and metre 10 The add leading space and use xspace options control the behaviour at the ends of the unit macros Activating add leading space inserts the number unit space before the unit is printed This is suitable for the input syntax 30 metre but does mean that the unit macros are incorrectly spaced in running text On the other hand the use xspace option attempts to correctly space input such as metre is the symbol for metres 6 7 Using units Part of the power of siunitx is the ability to alter the output format for units without changing the input The behaviour of units is therefore controll
13. numbers output open bracket numbers output close bracket numbers output tight spacing units creation allow in body units creation overwrite macros units creation add leading space units creation allow optional argument units creation use xspace 1 234 5 1 234 0 005 1 234 5 There are certain combinations of numerical input which can be ambiguous This can be corrected by adding brackets in the appropriate place and is controlled by the use brackets switch The opening and closing brackets used are stored open bracket and close bracket respectively num 1 2i el0 MM Xnum numbers output use brackets false 1 2i e10 MM sisetupf numbers output open bracket close bracket J num 1 2i e10 1 2i x 1010 1 2ix 101 1 2i x 1010 Under some circumstances is may be desirable to squeeze the output spacing This is turned on using the tight spacing switch which compresses spacing where possible num 1i pm2i e3 num numbers output tight spacing true 1 pm2i e3 1 2i x 10 142i x 10 6 6 Creating units The various macro units are created at the start of the document These can be defined only inside the si and SI macros or can also be made available in the document body There are a number of settings which control this creation process Table 12 As a result these options all apply in the preamble only The allow in body option controls whether the unit
14. prefixes Table 6 4 The spelling deka is provided for US users as an alternative to deca A small number of pre defined powers are provided as macros square and cubic are intended for use before units with squared and cubed going after the unit Bq si square becquerel lm si joule squared per lumen be VTS si cubic lux volt tesla cubed Generic powers can be inserted on a one off basis using the tothe and raiseto macros These are the only macros for units which take an argument H5 si henry tothe 5 rad 5 si raiseto 4 5 radian Reciprocal powers are indicated using the per macro This applies to the next unit only unless the units output sticky per option is turned on lr l da si joule per mole per kelvin Da si joule per mole kelvin Bq si per henry tothe 5 MM si per square becquerel 5 1 Creating new macros The various macro components of a unit have to be defined before they can be used The package supplies a number of common definitions but new definitions are also possible DeclareSIUnit DeclareSIPrefix DeclareSIPrefix DeclareSIPower DeclareSIPower DeclareSIQualifier As the definition of a logical unit should remain the same in a single document these creation functions are all preamble only New units are produced using the DeclareSIUnit macro This takes two mandatory arguments as well as one optional one DeclareSIUnit opt
15. rm mathtt 7 SI 99 metre This can be used to good effect to change all output from siunitx without needing to detect the font For example when creating beamer presentations the settings 13 numbers input digits numbers input decimal markers numbers input signs numbers input exponent markers numbers input ignore numbers input symbols numbers input open uncertainty numbers input close uncertainty numbers input complex roots Table 9 numbers input options Option name Type Default complex roots Literal ij close uncertainty Literal decimal markers Literal digits Literal 0123456789 exponent markers Literal dDeE ignore Literal none open uncertainty Literal signs Literal pm mp symbols Literal pi sisetupf font maths rm mathsf font text rm sffamily given all output in sans serif font without font detection Every one of the font options can be given independently for units and number with the option paths font units and font numbers respectively This allows fine control of output 6 3 Parsing numbers The package uses a sophisticated parsing system to understand numbers This allows siunitx to carry out a range of formatting as described later All of the input options take lists of literal tokens and are summarised in Table 9 The basic parts of a number are the digits any sign and a separator between the integer and decimal parts These are stored in the input options digits
16. second eee SESS bee ROR ees PEAS NSIS As acute ge eee a dace Ain AE II E tee eae hee e siem ns lt b ce Pk RS bes oe ed sievert oad a ede m aroi p Se ee Geka SHUSECUP uree eS eae Oe eee 19 19 19 20 20 22 20 20 SIUnitSymbolAngstrom 23 SIUnitSymbolArcminute 22 SIUnitSymbolArcsecond 22 SIUnitSymbolCelsius 23 SIUnitSymbolDegree 22 SIUnitSymbolMicro 22 SIUnitSymbolOhm 22 Square tex aoe aces owen meee Oe 6 squ red so dine a a Da es ee S 6 stera ian 4 000 dns a eara a Gad 6 symbols maths angstrom option 22 symbols maths arcminute option 22 symbols maths arcsecond option 22 symbols maths celsius option 22 symbols maths degree option 23 symbols maths micro option 22 symbols maths ohm option 22 symbols redefine symbols option 22 symbols text angstrom option 22 symbols text arcminute option 22 symbols text arcsecond option 22 symbols text celsius option 22 symbols text degree option 22 symbols text micro option 22 symbols text ohm option 22 T NOGTA eis oa are ede eds 8 NEOSLA Acad eit Se ee ae 6 NEODNE sala cc a e ale QE eae a eee 7 A A neice vs deo E he Sede Gals 6 U units creation add leading space option Dead betadht beck todd dates 19 units creation allow in body opti
17. the S and s column types for decimal alignments and units in tables These macros are designed for typesetting units and values with control of appearance and with intelligent processing 12 345 678 90 num 12345 67890 MM 1 2i num 1i 2i 0 3 x 10 num 3e45 By default all text is typeset in the current upright serif maths font This can be changed by setting the appropriate options sisetup font detect al1 will use the current font for typesetting 4 Using the siunitx package 4 1 Loading the package The package should be loaded in the usual ATEX 2 way usepackage siunitx The package does not use load time options although it does support those from version 1 of the package and predecessor packages num si 4 2 Numbers Numbers are automatically formatted by the num macro This takes one optional and one mandatory argument num options number The contents of number are automatically formatted The formatter removes hard spaces 1 and automatically identifies exponents by default marked using e or d and adds the appropriate spacing of large numbers A leading zero is added before a decimal marker if needed both and are recognised as decimal marker 123 num 123 1234 num 1234 12345 num 12345 0 123 num 0 123 0 1234 num 0 1234 0 123 45 num 12345 3 45 x 10 4 num 3 45d 4 MM 1010 num e10 4 3 Units as arguments The symbol
18. the definition all others indicate the places where it is used A NEE gasio we garian atest aoa ahs a aa 8 ampere sore air a PEN E ee ae RS 5 angstrom ii a eed e ache 7 B Nareminute isle ae a ovens ee aoe E Abar fii ele ied wade EEA 7 Naresecond if cide dada eh aes 7 ND AIT e erd ea e ares bata z astronomicalunit we NDECQUETEL it vein as oe eee ee eee 6 atomicmassunit 4 NGM ee ced ace gs Bs aed wae eee 7 NDOT cis a He ME ada 7 eandela mimar el 5 NGCUSTUS aaa a ios 6 NO A SAWS BAe ES eh 8 elight oei ath deta E SE ET 7 coulomb q ao aee PR ee bee wee doo 6 ACUDA scien aci Dr BS eae ans 6 NGUDLCH oan 84 wi PS OPES eae ads 6 D Ndalitom sic ache aE eR etek ok ee Ee 7 NAY e din Sirs Pine area we HO eo oe aoe 7 A aatan ds shake i ede D dae aks 8 Ndegi ia oa a a a amos 8 decibeLl mery 7 DeclareSIPower o o cocooocoooo 9 DeclareSIPower 2 4 9 DeclareSIPrefix 8 DeclareSIPrefix oo 8 DeclareSIQualifier 9 DeclareSIUnit 8 Nde pree ema pas a o F Ndeka wared eG Wey EEE Me eae a de 6 E electronmass 00 00 7 electronvolt o o o oooooooocoo ooo 7 elementarycharge 7 NOS A A A A 8 F farad ceo ai do ah PEERS eee Ea 6 NECMUCG Roa RO ca eS Gold 8 font detect all option ag font detect bold option 10 font detect displ
19. 234 1254 num 1234 1234 emph num 1234 textbf num 1234 MN textbf num 1234 Bold detection is influenced by the value of inline bold which takes values text and maths The package can detect the local value of bold for either the surrounding text or the surrounding inline maths sisetupf font detect bold on font detect inline bold maths 3 1234 1234 num 1234 1234 boldmath num 1234 1234 bfseries num i234 1234 sisetup font detect inline bold text boldmath num 1234 bfseries num 1234 The font detection system can treat displayed mathematical content in two ways This is controlled by the display option When set on display mathematics is treated independently from the body of the document Thus the local maths font is checked for matching In contrast when set off display material is treated with the current running text font sffamily Some text sisetupf font detect all font detect display maths true x SI 1 2e3 kilogram kelvin candela More text sisetup font detect display maths false C y SI 3 metre second mole 12 font mode font maths font text font maths font maths font text font text rm rm s tt s tt Table 8 font options all also apply in font units and font numbers Option name Type Default maths rm Macro mathrm maths sf Macro mathsf maths tt Macro
20. ay maths option 12 font detect family option 10 font detect inline bold option 11 font detect italic option 10 font detect mode option 10 font detect none option 1i font maths rm option 13 font maths sf option 13 font maths tt option 13 font mode option 4 12 font text rm option 13 font text sf option 13 font text tt option 13 25 NB Beh Sec dch tes headed Sebebshaid bond kk dated 8 NEDA dee eee a arate 2 GRE RoE GNE KD aes whew 6 H hartree ercer wed he bbe hehehe 7 NHE6CtAre iia Se ate ee wee ne 7 NHBCtO ata da at Sin 8 NHGnTy ado eee oe 6 A 146 3 je Se cra hace GAR Sar ea ee ae 6 N QUEL ese Rates eho Phas ee aaa aoe 7 J NJOULS sice annota ae a aaO 4 6 K katal sicc gacra a ry ew due 3 A eho 6 A kea i era ea e er a ao 5 Mallo Gare sateen ie Ache dab eee 8 kilogram ta fd koe des Glasses 5 NEDOb 64 254 5408 dd 7 L NLTTOL dela ale le as ahaa ag elated 7 NIETO oegi dhe dhe Adobe Shoe debe 7 NEUMON 3h cecw dss erate 1S Grice see rE a E alas 6 N RIA 6 M NN 8 ME Rs 5 MStrO o Od 5 NDICTO dicas rre oa of er aaa ee aye 8 O cenae nara hy aca EA EVE 8 o fo ain Eaa sadihteue id hoe dea By bose F NM rt ba 7 Mole a ds a 5 N NADO ir 8 Ana ticalmile svidi reest urede e gt Nn per RR 7 A origa atra bb twee A a a s 6 num o o h e ebria 3 numbers input clos
21. cess retain zero expo nent option 4 16 numbers process round figures option 14 numbers process round mode option 14 numbers process round places option 14 O NOM Suit a a da os 6 options font detect all 11 font detect bold 10 font detect display maths La font detect family 10 font detect inline bold 11 font detect italic 10 26 font detect mode font detect none font maths rm font maths sf font maths tt font mode font text rm font text sf font text tt numbers input close uncertainty numbers input complex roots numbers input decimal markers numbers input digits numbers input exponent markers numbers input ignore numbers input open uncertainty numbers input signs numbers input symbols numbers output close bracket numbers output close uncertainty numbers output complex root numbers output decimal marker numbers output exponent base numbers output exponent product numbers output group digits numbers output group four digits numbers output group separator numbers output open bracket numbers output open uncertainty numbers output separate uncer tainty numbers output tight spacing numbers output uncertainty space numbers output use brackets numbers process add zero decimal numbers process add zero integer numbers process explicit sign numbers process include explicit sign numbers process retain explicit plus
22. e uncertainty option O bars 14 numbers input complex roots option 14 numbers input decimal markers option 13 numbers input digits option 13 numbers input exponent markers option a dd 13 numbers input ignore option 14 numbers input open uncertainty option id dada 14 numbers input signs option i3 numbers input symbols option 14 numbers output close bracket option 18 numbers output close uncertainty option i poids Ge eek ae EEE EE E EE 18 numbers output complex root option 17 numbers output decimal marker option 17 numbers output exponent base option 17 numbers output exponent product option E Gidea eg a ed 17 numbers output group digits option 16 numbers output group four dig its option cesses sonett miai 16 numbers output group separator option afi E A E EE EA E Ga 16 numbers output open bracket option 18 numbers output open uncertainty option numbers output separate uncer tainty option 18 numbers output tight spacing option 18 numbers output uncertainty space option a Bu ee art ane a aba 18 numbers output use brackets option 18 numbers process add zero deci mal option 4 15 numbers process add zero inte ger option ooooooooo o 15 numbers process explicit sign option 16 numbers process include explicit sign option o oooooo o oo 16 numbers process retain explicit plus option 2 20 2 60eue eas 16 numbers pro
23. ed by a number of options which alter either the processing of units or the output directly Some users may prefer to completely disable the use of literal input in units for example to enforce consistency This can be accomplished by setting the allow literal units switch With this option enabled only macro based units can be used in a document The standard method for printing units with a value prevents a break occurring between the two parts The allow unit number breaks can be used to turn on breaking in this context for example when using narrow columns begin minipage 4cm Some text to act as filler SI 10 kilogram cubic metre sisetup units output allow number unit breaks Some text to act as filler SI 10 kilogram cubic metre end minipage 20 units output inter unit separator units output number unit separator units output inter unit space units output sticky per units output use brackets units output open bracket units output close bracket Table 13 units output options Option name Type Default allow literal units Switch true allow number unit breaks Switch false close bracket Literal inter unit separator Literal inter unit space Literal number unit separator Literal open bracket Literal print as fraction Switch false qualifier format Choice subscript sticky per Switch false use brackets Switch true Some text to act as filler 10 kg m Some text to act as filler 10 kg m
24. ff the standard setting is true The individual symbols used for a number of units are available as package options in paths symbols maths and symbols text The option names are summarised in Table 14 22 SIUnitSymbolAngstrom SIUnitSymbolArcminute SIUnitSymbolArcsecond SIUnitSymbolCelsius SIUnitSymbolDegree SIUnitSymbolMicro SIUnitSymbo10hm Table 14 symbols maths and symbols text options Option name Type angstrom Literal arcminute Literal arcsecond Literal celsius Literal degree Literal micro Literal ohm Literal The standard values can be somewhat involved and the interested reader is directed to the code for full details In many cases the maths and text variations are created from the same underlying macro using text or ensuremath For example the standard definitions for angstrom are sisetupf symbols maths angstrom text AA symbols text angstrom AA The maths and text symbols defined above are wrapped up into mode independent functions with user names These are then used in the definitions of the appro priate units For example the angstrom symbol can be accessed using the macro SIUnitSymbolAngstrom Notice that these names capitalise the unit name to make reading the macro name easier 7 Usage tips and known issues 7 1 Ensuring text or maths output The macros ensuremath and text should be used to ensure that a particular item is always printed in the desired mode Some mat
25. for a unit can be typeset using the si macro this provides full control over output format for the unit Like the num macro si takes one optional and one mandatory argument Msi options unit The unit formatting system can accept two types of input When unit contains one or more literal items the output is processed in the same manner as with the sistyle package Sub and superscripts can be input without concern over maths mode and the tokens and are converted into an inter unit separator and inter unit space respectively kg m s si kg m s 2 MN Spolymer molcat s sif g_ polymer mol_ cat s 1 The second operation mode for the si macro is an interpretted system Here each unit SI multiple prefix and power is given a macro name These are entered in a method very similar to the reading of the unit name in English si kilo gram metre per square second si gram per cubic centi metre sif square volt cubic lumen per farad MM si metre squared per gray cubic lux MAN si henry second kgms cm V2 Im F71 m2 Gy Ix Hs 3The standard package settings use the same value for both of these MSI meter deka On its own this is less convenient than the direct method although it does use meaning rather than appearance for input However the the package allows you to define new unit macros a large number of pre defined abbreviations are also supplied More importantly by
26. hematical output does not work well in mathrm the standard font used by siunitx for printing The easiest way to solve this is to use the construction text ensuremath which will print the material in the standard mathematics font without affecting the rest of the output num numbers output complex root i 1 2i num numbers output complex root ensuremath i 1 2i AM num numbers output complex root text ensuremath i 1 2i 142i 142i 1 21 23 In some circumstances forcing mathnormal may suffice but this deals less well with non Latin characters 7 2 Using a comma as a separator The use of a comma as a group separator or decimal marker is common in many parts of the world This is easily achieved in siunitx but does require three sets of braces in the option to give the normal spacing Xnum numbers output decimal marker 1 23 Wrong Xnum numbers output decimal marker 1 23 Wrong Xnum numbers output decimal marker 1 23 Correct 1 23 1 23 1 23 Change History v1 0 v1 2 General First official release 1 General Correct handling for ranges of numbers added 1 v1 1 DS General Package extended to a greater General Complete re write of package range of unit types 1 to add many new features 1 Index The italic numbers denote the pages where the corresponding entry is described numbers underlined point to
27. ions 14 unit H symbol y symbol can contain literal values other units multiple prefixes powers and per although literal text should not be intermixed with unit macros The options argument can be any suitable options and applies the specific unit macro only The first optional argument to ASI and si can be used to override the settings for the unit A typical example is the Mdegree unit 3 1415 SI 3 1415 degree M This is declared in the package as DeclareSIUnit units output number unit separator degree SIUnitSymbolDegree The spacing can still be altered at point of use SI 67890 degree ASI units output number unit separator 67890 degree 67 890 67 890 The standard SI powers of ten are defined by the package and are described above However the user can define new prefixes with DeclareSIPrefix This has syntax DeclareSIPref ix prefix symbol powers ten A starred version is also avail able for creating binary prefixes with the same syntax powers ten being replaced by powers two For example kilo and kibi are defined DeclareSIPrefix kilo k 3 DeclareSIPrefix kibi ki 10 Descriptions for powers are created using DeclareSIPower with syntax DeclareSIPower power nu This creates a power macro to appear before the unit it applies to A starred version of the macro creates powers to appear after the unit 4 DeclareSIPower quartic t 4
28. le as an alias for metre for users of US spellings The full details of the base units are given in the SI Brochure 2 The SI also lists a number of units which have special names and symbols 3 these are listed in Table 2 In addition to the official SI units siunitx also provides macros for a number of units which are accepted for use in the SI although they are not SI units Table 3 lists the accepted units 5 Some units are fundamental physical quantities and these are non SI but can be used with in the SI Table 4 6 There are also a set of non SI units which are used in certain defined circumstances Table 5 although they are not necessarily official sanctioned 7 In addition to the units themselves siunitx provides pre defined macros for all of the SI Table 1 SI base units Unit Macro Symbol ampere ampere A candela candela cd kelvin kelvin K kilogram kilogram kg metre metre m mole Xmole mol second second s Table 2 Coherent derived units in the SI with special names and symbols Unit Macro Symbol Unit Macro Symbol becquerel becquerel Bq newton newton N degree Celsius celsius C ohm ohm Q coulomb coulomb C pascal pascal Pa farad farad F radian radian rad gray gray Gy siemens siemens S hertz hertz Hz sievert sievert Sv henry henry H steradian steradian sr joule joule J tesla tesla T katal katal kat volt volt V lumen lumen lm watt watt W lux lux lx weber weber Wb Table
29. numbers process retain zero expo nent numbers process round figures numbers process round mode numbers process round places symbols maths angstrom symbols maths arcminute symbols maths arcsecond symbols maths celsius 18 18 18 18 15 15 16 16 16 symbols maths degree symbols maths micro symbols maths ohm symbols redefine symbols symbols text angstrom symbols text arcminute symbols text arcsecond symbols text celsius symbols text degree symbols text micro symbols text ohm units creation add leading space units creation allow in body units creation allow optional ar UMENC si 24 ca eh kan aip aa a units creation overwrite macros units creation use xspace units output allow literal units units output allow unit number breaks seraa as Bans units output close bracket units output inter unit separa TOT ei ieni ead E es units output inter unit space units output number unit separa TOC arus Shack n E E RE units output open bracket units output qualifier format units output sticky per units output use brackets pascall ici oe SiGe ee Ree eee eee NDE 4 ane ch bce nee eee eee ee percent eo accused sews d beet NOt as aii gehen matt ale ed oes APTO Hes De ee ie ee Aplanckbar ii oa KEES radiador Fide ss dace en NraTSe tor sean be dae bes
30. on 19 units creation allow optional argu ment option 4 19 units creation overwrite macros option ip GY Soe do SHE Sect ek deed ld 19 units creation use xspace option 19 units output allow literal units option O 20 units output allow unit number breaks option 20 units output close bracket option 21 units output inter unit separa tor Option o esas es bees e 20 units output inter unit space option 20 27 units output number unit separa WwW tor option sec tregi erti e BO Nwatt 5564 e5 04946 iiare h neita 6 units output open bracket option 21 weber iif Be SS GLEE ee A Boe Ge Se A Ses ees 6 units output qualifier format option 21 y units output sticky per option a AA I 8 units output use brackets option 21 yotta oooooococooooocrrorr eee 8 Z Vv NEDCO wie Ae interes ae a ates ie 8 AVOL E ais a ed 6 AZECA aaa ea wade ee eial ea 8 References 1 The International System of Units SD http www bipm org en si 2 SI base units http www bipm org en si si_brochure chapter2 2 1 3 Units with special names and symbols units that incorporate special names and symbols http www bipm org en si si_brochure chapter2 2 2 2 2 2 html 4 SI Prefixes http www bipm org en si si_brochure chapter3 prefixes html 5 Non SI units accepted for use with the International System of Units http www bipm org en si si_brochure chapter4 table6 html 6
31. root option The later is always in maths mode but notice that siunitx uses mathrm by default To force standard TEX maths output to give i the construction text ensuremath i can be used num 1 23 num numbers output decimal marker 1 23 num numbers output complex root text ensuremath i 1 2i 1 23 1 23 1 21 When exponents are present in the input the options exponent base and exponent product set the obvious parts of the output Notice that the base is in the current mode but the product sign is always in maths mode num numbers output exponent product times 1e2 MM num numbers output exponent product cdot 1e2 MM num numbers output exponent base 2 1e2 1 x 102 1 102 1x 22 When input is given including an uncertatinty in a value it can be printed either with the uncertainty in brackets or as a separate number This behaviour is controlled by the separate uncertainty choice If the uncertainty is given in brackets a space may be added between the main value and the uncertainty this is stored using the uncertainty space option The opening and closing brackets used are stored open uncertainty and close uncertainty respectively num 1 234 5 num numbers output separate uncertainty on 1 234 5 AM sisetup numbers output open uncertainty close uncertainty uncertainty space num 1 234 5 I a Il Pa A wy 18 numbers output use brackets
32. s Thus centre and center can be used for alignment options and maths or math is valid in the names of font options In the rest of this document UK English spelling is used 6 1 Detecting fonts The siunitx package controls the font used to print output independently of the sur rounding material The standard method is to ignore the surroundings entirely and to use the current upright maths font for all printing However the package can detect and follow surrounding bold italic and font family changes The font detection options are available in path font detect and are summarised in Table 7 The four basic options bold and italic set detection of the prevailing bold and italic states respectively The italic state is only checked if the surrounding material is not in maths mode as maths text is always italic Detecting the current family roman sans serif or monospaced is controlled by the family setting while the current mode text or maths is detected using the mode switch The two style options all and none can be used to turn on or off all of the detection functions in one go These are style options and so need no value 4This will typically use mathrm 11 font detect inline bold font detect display maths 1234 sisetup font detect none num 1234 et num 1234 1934 emph num 1234 1034 textbf num 1234 1234 textbf num 1234 a sisetup font detect all 7 34 num 1234 1
33. siunitx A comprehensive SI units package Joseph Wright Released 2009 03 29 Abstract Typesetting values with units requires care to ensure that the combined mathe matical meaning of the value plus unit combination is clear In particular the SI units system lays down a consistent set of units with rules on how these are to be used However different countries and publishers have differing conventions on the exact appearance of numbers and units The siunitx package provides a set of tools for authors to typeset numbers and units in a consistent way The package has an extended set of configuration options which make it possible to follow varying typographic conventions with the same input syntax The package includes automated processing of numbers and units and the ability to control tabular alignment of numbers A number of IATEX packages have been developed in the past for formatting units Slunits Slstyle unitsdef units fancyunits and fancynum Support for users of all of these packages is available as emulation modules in siunitx In addition siunitx can carry out many of the functions of the dcolumn rccol and numprint packages Contents 4 4 Units free standing 1 Introduction 2 5 The unit macros 5 1 Creating new macros 2 Installation 2 6 The key value control system 3 siunitx for the impatient 3 6 1 Detecting fonts 4 Using the siunitx package 3 6 2 Output font families 4 1 Loading the package
34. ssing steps can be carried out These involve adding or removing information from the number in a systematic way the options are summarised in Table 10 The siunitx package can round numerical input to a fixed number of significant figures or decimal places This is controlled by the round mode option which takes the choices off figures and places When rounding is turned on the number of figures to use is determined by the round figures and round places option both of these options require a number num 1 23456 num 14 23 sisetupf numbers process round mode places numbers process round places 3 num 1 23456 num 14 23 sisetup numbers process round mode figures numbers process round figures 3 num 1 23456 num 14 23 Il w Il w 15 numbers process add zero decimal numbers process add zero integer numbers process explicit sign numbers process include explicit sign numbers process retain explicit plus numbers process retain zero exponent 1 234 56 14 23 1 235 14 230 1 23 14 2 It is possible to give real floating point numbers as input omitting the decimal or the integer parts of the number for example 0 123 or 123 0 The options add zero decimal and add zero integer allow the package to fill in the missing zero num 123 num 456 sisetupf numbers process add zero decimal no numbers process add zero integer no 3 num 123
35. such as differing decimal markers digit grouping and so on All of these options are concerned with the appearance of output rather than the data it conveys The options are summarised in Table 13 Grouping digits into blocks of three is a common method to increase the ease of reading of numbers The group digits choice turns this behaviour on and off with grouping for numbers of exactly four digits controlled by the group four digits choice Note that the later only applies if group digits is turned on The separator used between groups of digits is stored by the group separator option This takes literal input and is used in maths mode for a text mode full space use text num 12345 num numbers output group digits off 12345 MM num 1234 Xnum numbers output group four digits on 1234 MM num 12345 num numbers output group separator Xnum numbers output group separator 17 144 117 412345 M text 12345 numbers output complex root numbers output decimal marker numbers output exponent base numbers output exponent product numbers output separate uncertainty numbers output uncertainty space numbers output open uncertainty numbers output close uncertainty 12345 12345 1234 1234 12345 12 345 12 345 The decimal marker used in output is set using the decimal marker option This can differ from the input marker as can the root of 1 which is stored in the complex
36. ts and fancynum As such emulation modes are provided for all of these packages Where possible conventions from the existing solutions have been used here For example the macros num ang and MSI act in a very similar fashion to those in existing packages 2 Installation The entire bundle is supplied with the TDS ready zip file siunitx tds zip Simply unzip this into your local texmf tree and run your hash program texhash for TpXLive or initextmf u for MiKT X To extract the package siunitx sty and the configuration files from siunitx dtx two methods are available To extract the files using the ins file simply run pdf T X on siunitx ins This will produce all of the package files and also README txt To extract the files and build the documentation run pdf IATEX on siunitx dtx Three pdf IATExX runs with write18 enabled will also build the index and table of contents in the PDF General Conference on Weights and Measures International System of Units Compilation of the package documentation requires the l3doc class from the expl3 bundle produced by the ATEX3 team To compile the package documentation you will need to get a recent version of expl3 from the IATEX project website 3 siunitx for the impatient The package provides the user macros e SI options value L pre unit 14 unit y e sil options unit e num options number e ang options angle e sisetup options plus

Download Pdf Manuals

image

Related Search

Related Contents

  Owner`s Manual / Manual del Propietario - Ppe- pressure  USER MANUAL ANWENDUNGSINFORMATION HASZNÁLATI  KEF Audio Speaker PSW2500 User's Manual  Development of the business support system  取扱説明書 - アテイン株式会社  seine impressionniste  LCD Monitor User Manual M2700HD    

Copyright © All rights reserved.
Failed to retrieve file