Typesetting Telephone Numbers with Latex
Total Page:16
File Type:pdf, Size:1020Kb
ENUMB N E O 3 2 1 R H 4 S P 5 Version 2.3 T y 20th August 2021 X p 6 E e T s A L e 7 t h t t in 8 0 i g 9 w te rs lep be hone num Package author Keno Wehr Bug reports https://github.com/wehro/phonenumbers/issues This package makes it possible to typeset telephone numbers according to dif- ferent national conventions and to link them when required. German, Austrian, French, British, and North American phone numbers are supported. Phone numbers from other countries are supported rudimentarily. A German version of this manual is available in the file phonenumbers-de.pdf. Contents 1 Quick Start 4 1.1 Germany ................................. 4 1.2 Austria ................................... 4 1.3 France ................................... 5 1.4 United Kingdom ............................. 5 1.5 North America .............................. 6 1.6 Other Countries ............................. 6 2 General Principles 7 2.1 Basic Ideas of the Package ....................... 7 2.2 Commands ................................ 7 2.3 Linking of Phone Numbers ....................... 8 2.4 Options .................................. 9 2.5 Invalid Numbers ............................. 11 2.6 Licence .................................. 11 3 German Phone Numbers 12 3.1 Structure of the Numbers ........................ 12 3.2 Options .................................. 13 3.3 Invalid Numbers ............................. 14 4 Austrian Phone Numbers 16 4.1 Structure of the Numbers ........................ 16 4.2 Options .................................. 17 4.3 Invalid Numbers ............................. 18 5 French Phone Numbers 20 5.1 Scope ................................... 20 5.2 Structure of the Numbers ........................ 20 5.3 Options .................................. 22 5.4 Invalid Numbers ............................. 23 6 British Phone Numbers 24 6.1 Scope ................................... 24 6.2 Structure of the Numbers ........................ 24 6.3 Options .................................. 25 6.4 Invalid Numbers ............................. 26 2 7 North American Phone Numbers 27 7.1 Scope ................................... 27 7.2 Structure of the Numbers ........................ 28 7.3 Options .................................. 29 7.4 Invalid Numbers ............................. 30 8 Technical Remarks 31 A Bibliography 32 B German Area Codes 36 B.1 Geographic Area Codes ......................... 36 B.2 Non-Geographic Area Codes ...................... 89 C Austrian Area Codes 91 C.1 Geographic Area Codes ......................... 91 C.2 Non-Geographic Area Codes ...................... 101 D French Area Codes 103 D.1 Geographic Area Codes ......................... 103 D.2 Non-Geographic Area Codes ...................... 103 E British Area Codes 105 E.1 Geographic Area Codes ......................... 105 E.2 Non-Geographic Area Codes ...................... 111 F Area codes of the North American Numbering Plan 119 F.1 Geographic Area Codes ......................... 119 F.2 Non-Geographic Area Codes ...................... 123 G Valid Country Codes 125 H Version History 126 3 1 Quick Start 1.1 Germany \phonenumber{0441343396}[83] 04 41/34 33 96-83 \phonenumber[area-code-sep= (0 20 43) 2 63 21 94 brackets]{020432632194} \phonenumber[area-code=place, area-code-sep=space Hamburg 66 96 91 23 ]{04066969123} \phonenumber[foreign +49 2 09 57 63 42 ]{0209576342} 1.2 Austria \phonenumber[country=AT 01/7 65 43-2 10 ]{0176543}[210] \phonenumber[country=AT,area- (0 22 58) 5 43 21 code-sep=brackets]{0225854321} \phonenumber[country=AT,area- code=place,area-code-sep=space Salzburg 65 43 21 ]{0662654321} 4 \phonenumber[country=AT,foreign +43 3 16 45 67 89 ]{0316456789} 1.3 France \phonenumber[country=FR 01 99 00 67 89 ]{0199006789} \phonenumber[country=FR,area- code=place-and-number Île-de-France 01 99 00 67 89 ]{0199006789} \phonenumber[country=FR,foreign +33 1 99 00 67 89 ]{0199006789} 1.4 United Kingdom \phonenumber[country=UK (0151) 496 0123 ]{01514960123} \phonenumber[country=UK,area- 0118 496 0234 code-sep=space]{01184960234} \phonenumber[country=UK,area- code=place,area-code-sep=space London 7946 0345 ]{02079460345} \phonenumber[country=UK,foreign +44 29 2018 0456 ]{02920180456} 5 1.5 North America \phonenumber[country=US 212-555-0123 ]{2125550123} \phonenumber[country=US,area- 212 555-0123 code-sep=space]{2125550123} \phonenumber[country=US,area- code=place-and-number New York 212-555-0123 ]{2125550123} \phonenumber[country=US,trunk- 1-212-555-0123 prefix]{2125550123} \phonenumber[country=US,foreign +1 212 555 0123 ]{2125550123} 1.6 Other Countries \phonenumber{+3905523776} % 39 = +39 05 52 37 76 Italy \phonenumber{0035923456789} % +359 23 45 67 89 359 = Bulgaria 6 2 General Principles 2.1 Basic Ideas of the Package The phonenumbers package aims to enable the user to typeset telephone num- bers without any knowledge of the internal structure of the number or the national typographic conventions for typesetting phone numbers. For instance, area codes are separated from the subscriber number in most countries. To typeset the phone number with the aid of the phonenumbers package the user does not need to know which digits belong to the area code and which to the subscriber number. The package knows all area codes of the supported countries and will automatically typeset them correctly. \phonenumber{03023125789} 0 30/23 12 57 89 The first three digits of this German phone number are recognized as thearea code of Berlin, whereas in the following example the first six digits can be iden- tified as the area code of the German spa town of Bad Schandau. \phonenumber{03502225789} 03 50 22/2 57 89 The package does not aim to implement a particular norm. Rather, it follows the usual conventions for typesetting phone numbers. By setting options the user can determine the country the number is belonging to and select from various formatting options. This includes the additional output of the country calling code. Furthermore, the package is able to check if a phone number is valid ac- cording to the national rules. Invalid numbers will lead to warnings during compilation. 2.2 Commands \usepackage[hoptionsi]{phonenumbers} Loads the package and sets the hoptionsi globally, so that they will affect all phone numbers not having contradictory options of their own. Has to be used in the preamble. 7 \setphonenumbers{hoptionsi} Sets the hoptionsi for all following phone numbers not having contradictory op- tions of their own. Can be used in the preamble or in the document body. \phonenumber[hoptionsi]{hnumberi}[hextensioni] Typesets a telephone number. The hoptionsi are valid only for this phone num- ber. The hnumberi can be input in the local or in the international format. The local format is possible for supported countries only; the country has to be set by the country option (cf. section 2.4). The international format always begins with + or 00 followed by the country code (cf. appendix G). Apart from a leading plus sign the hnumberi has to consist of digits only. To structure the number spaces, brackets (round and square), slashes and hyphens may be input; these will be ignored. For German and Austrian phone numbers an hextensioni can be given addi- tionally, since extensions are often highlighted in German typography. If the optional argument is missing and the hnumberi contains a hyphen, the part of the number after the (last) hyphen is recognized as extension if not only an area code precedes. Numbers from supported countries are typeset according to the national con- ventions. Numbers from unsupported countries are structured in groups of two digits after the country calling code. \AreaCodesGeographic[hoptionsi] Typesets a list of geographic area codes for the country set globally or by a local option. \AreaCodesNonGeographic[hoptionsi] Typesets a list of non-geographic area codes (area codes for mobile phones and for other special purposes) for the selected country. \CountryCodes Typesets a list of valid country codes. 2.3 Linking of Phone Numbers On modern devices with telephony capabilities links on phone numbers can be used to call a number without having it to type. The phonenumbers package generates such links if the hyperref package [27] is loaded additionally. Independantly of their appearance in the text the phone numbers are linked including the country calling code (beginning with +) so that they can be reached from everywhere. The appearance of the links can be set using hyperref options. For example, you could add the following line to the preamble to display all links on phone numbers in blue. 8 \usepackage[colorlinks=true,urlcolor=blue]{hyperref} On classical personal computers such links are not usable though. If you need hyperref, but do not want to link phone numbers, use the link option (see section 2.4). 2.4 Options All options can be set globally with the aid of the \usepackage and the \setphonenumbers commands or locally for single phone numbers. country = AT|DE|FR|UK|US Default: DE Sets the country the number is belonging to. AT Austria DE Germany FR France UK United Kingdom US United States, Canada and further countries (cf. section 7.1) Please contact the package author if you need support for further countries. This option is ignored if the number is input in the international format. In this case the country is determined by the country code. link = on|off Default: on Specifies whether phone numbers shall be linked ifthe hyperref package is loaded (cf. section 2.3). foreign = international|american|european|off