没有合适的资源?快使用搜索试试~ 我知道了~
首页latex物理单位宏包siunitx
latex物理单位宏包siunitx
需积分: 50 38 下载量 113 浏览量
更新于2023-03-16
评论 1
收藏 659KB PDF 举报
latex物理单位宏包siunitx说明书 latex物理单位宏包siunitx说明书 latex物理单位宏包siunitx说明书 latex物理单位宏包siunitx说明书 latex物理单位宏包siunitx说明书
资源详情
资源评论
资源推荐
siunitx — A comprehensive (SI) units package
∗
Joseph Wright
†
Released 2017/08/02
Abstract
Physical quantities have both numbers and units, and each physical quantity
should be expressed as the product of a number and a unit. Typesetting physical
quantities requires care to ensure that the combined mathematical meaning of the
number–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, differ-
ent 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 quantities 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.
Contents
1 Introduction 3
2 Installation 3
3 siunitx for the impatient 4
4 Using the siunitx package 5
4.1 Loading the package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.3 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.4 The unit macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.5 Creating new macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.6 Tabular material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
∗
This file describes v2.7j, last revised 2017/08/02.
†
E-mail: joseph.wright@morningstar2.co.uk
1
5 Comprehensive details of package control options 17
5.1 The key–value control system . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2 Detecting fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3 Font settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.4 Parsing numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.5 Post-processing numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.6 Printing numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.7 Multi-part numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.8 Lists and ranges of numbers . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.9 Angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.10 Creating units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.11 Loading additional units . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.12 Using units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.13 Numbers with units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.14 Tabular material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.15 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.16 Other options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.17 Local configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6 Localisation 59
7 Hints for using siunitx 60
7.1 Ensuring text or math output . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.2 Expanding content in tables . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.3 Using siunitx with datatool . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.4 Using units such as µm s
−1
in headings . . . . . . . . . . . . . . . . . . . 62
7.5 A left-aligned column visually centred under a heading . . . . . . . . . 63
7.6 Symbols and X
E
T
E
X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7.7 Scaled document fonts with X
E
T
E
X . . . . . . . . . . . . . . . . . . . . . . 64
7.8 Interaction with tex4ht . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.9 Maximising performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.10 Transferring settings to pgf . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.11 Using siunitx with the cellspace package . . . . . . . . . . . . . . . . . . 65
7.12 Special considerations for the \kWh unit . . . . . . . . . . . . . . . . . . . 65
7.13 Adding items after the last column of a tabular . . . . . . . . . . . . . . 66
7.14 Creating a column with numbers and units . . . . . . . . . . . . . . . . 67
7.15 Tables with heading rows . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.16 Associating a locale with a babel language . . . . . . . . . . . . . . . . . 68
8 Information for those upgrading 69
8.1 Upgrading from version 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.2 Upgrading from version 2.0 or 2.1 . . . . . . . . . . . . . . . . . . . . . . 73
8.3 Upgrading from version 2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.4 Upgrading from version 2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.5 Upgrading from version 2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.6 Upgrading from version 2.5 . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2
9 Correct application of (SI) units 74
9.1 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
9.2 Mathematical meaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
9.3 Graphs and tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10 Making suggestions and reporting bugs 80
11 Code level interfaces 80
12 Thanks 80
Change History 81
Index 88
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 L
A
T
E
X users to typeset numbers and
units 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.
2 Installation
The package is supplied in dtx format and as a pre-extracted zip file, siunitx.tds.zip.
The later is most convenient for most users: simply unzip this in your local texmf
directory and run texhash to update the database of file locations. If you want to
unpack the dtx yourself, running tex siunitx.dtx will extract the package whereas
latex siunitx.dtx will extract it and also typeset the documentation.
The package requires L
A
T
E
X3 support as provided in the l3kernel and l3packages
bundles. Both of these are available on ctan as ready-to-install zip files. Suitable
versions are available in MiKT
E
X 2.9 and T
E
X Live 2015 (updating the relevant packages
online may be necessary). L
A
T
E
X3, and so siunitx, requires the ε-T
E
X extensions: these
are available on all modern T
E
X systems.
Typesetting the documentation requires a number of packages in addition to those
needed to use the package. This is mainly because of the number of demonstration
items included in the text. To compile the documentation without error, you will need
the packages:
• amsmath
3
• booktabs
• cancel
• caption
• cleveref
• colortbl
• csquotes
• helvet
• mathpazo
• multirow
• listings
• pgfplots
• xcolor
3 siunitx for the impatient
The package provides the user macros:
• \ang[hoptionsi]{hanglei}
• \num[hoptionsi]{hnumberi}
• \si[hoptionsi]{huniti}
• \SI[hoptionsi]{hnumberi}[hpre-uniti]{huniti}
• \numlist[hoptionsi]{hnumbersi}
• \numrange[hoptionsi]{hnumbersi}{hnumber2i}
• \SIlist[hoptionsi]{hnumbersi}{huniti}
• \SIrange[hoptionsi]{hnumber1i}{hnumber2i}{huniti}
• \sisetup{hoptionsi}
• \tablenum[hoptionsi]{hnumberi}
plus the S and s column types for decimal alignments and units in tabular environ-
ments. These user macros and column types are designed for typesetting numbers and
units with control of appearance and with intelligent processing.
Numbers are processed with understanding of exponents, complex numbers and
multiplication.
12 345.678 90
1 ±2i
0.3 ×10
45
1.654 ×2.34 ×3.430
\num{12345,67890} \\
\num{1+-2i} \\
\num{.3e45} \\
\num{1.654 x 2.34 x 3.430}
4
The unit system can interpret units given as text to be used directly or as macro-
based units. In the latter case, different formatting is possible.
\si{kg.m.s^{-1}} \\
\si{\kilogram\metre\per\second} \\
\si[per-mode=symbol]
{\kilogram\metre\per\second} \\
\si[per-mode=symbol]
{\kilogram\metre\per\ampere\per\second}
kg m s
−1
kg m s
−1
kg m/s
kg m/(A s)
Simple lists and ranges of numbers can be handled.
\numlist{10;20;30} \\
\SIlist{0.13;0.67;0.80}{\milli\metre} \\
\numrange{10}{20} \\
\SIrange{0.13}{0.67}{\milli\metre}
10, 20 and 30
0.13 mm, 0.67 mm and 0.80 mm
10 to 20
0.13 mm to 0.67 mm
By default, all text is typeset in the current upright math font. This can be changed
by setting the appropriate options: \sisetup{detect-all} 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 L
A
T
E
X2
ε
way.
\usepackage{siunitx}
The key–value options described later in this document can be used when loading the
package, for example
\usepackage[version-1-compatibility]{siunitx}
to use options from version 1 of the package.
4.2 Numbers
\num
\num[hoptions i]{hnumber i}
Numbers are automatically formatted by the \num macro. This takes one optional
argument, hoptionsi, and one mandatory one, hnumberi. The contents of hnumberi are
automatically formatted. The formatter removes both ‘soft’ (␣) and ‘hard’ spaces (\,
and ~), automatically identifies exponents (by default marked using e, E, d or D) and
adds the appropriate spacing of large numbers. With the standard settings a leading
5
剩余94页未读,继续阅读
qq_35998790
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0