The Unicode Consortium provide a range of data files detailing the nature of code points in Unicode. These data files are machine-readable but large. Here, a set of loaders are provided to parse these files during a TeX run and set appropriate parameters in an automated fashion.
load-unicode-data.texThe loader parses a number of data files provided by the Unicode Consortium and when used with used Unicode-capable engine sets up a range of TeX-related parameters based on the extracted information.
From the file UnicodeData.txt the following properties are set:
\catcode 11 for all letters (Unicode class "L")\catcode 11 for all combining marks (Unicode class "M")\sfcode 999 for all code points of class "Lu" (upper case
letters)\lccode for all of class "Ll" (lower case letters) to the code
point itself, and \uccode to the upper case mapping (or if
not given to the code point itself)\uccode for all of class "Lu" (upper case letters) to the code
point itself, and \lccode to the lower case mapping (or if
not given to the code point itself)\lccode and \uccode for all of class "Lt" (title case
letters) to the lower and upper case mappings (or if not given
to the code point itself)\lccode and \uccode for all other letter code points are
set to the code point itself\lccode and/or \uccode for non-letter code points for
which an upper or lower case mapping is given\sfcode 0 (ignored) for code points of Unicode classes "Pe"
(closing punctuation marks) and "Pf" (final quotation marks)\Umathcode for all letters (Unicode class "L") and combining
marks (Unicode class "M") as TeX class 7 (var)In the above, 'letters' refers to code points with Unicode class "L", irrespective of their TeX category code.
load-unicode-math-classes.texFrom the file MathClass-15.txt the following mapping between
Unicode math classes and TeX math types are set up
\mathop\mathbin\mathbin\mathrel\mathopen\mathclose\mathpunct\mathalphaFor each code point processed, the result is of the form
\Umathcode <codepoint> = <type> 1 <codepoint>
load-unicode-xetex-classes.texFrom the files EastAsianWidth.txt and LineBreak.txt inter
character classes for XeTeX (\XeTeXcharclass) are set for the
following classes
All code points of classes "ID" and "CJ" are assigned to a
\XeTeXcharclass, but for other classes this only occurs when
they fall into east Asian width type "F", "H" or "W" (full-,
half- and wide-width).
The following mappings between Unicode and XeTeX classes occur
as standard: these may be over-ridden by defining
\XeTeXcharclass<class> as required. (If classes "ID" or "CL"
are explicitly set, the other members of the same groups above
will inherit these values.)
This file does not activate XeTeX's inter-character token
mechanism (\XeTeXinterchartokenstate is not set) nor does it
install any material in the inter-character token registers.
Note that this file is separate from the main loader as the data structure here may need more refinement at the macro level.
The following data files are included here with permission of the Unicode Consortium (see below):
UnicodeData.txtBidiBrackets.txtBidiMirroring.txtBidiMirroring-5-1-0.txtCaseFolding.txtEastAsianWidth.txtemoji-data.txtGraphemeBreakProperty.txtLineBreak.txtMathClass.txtPropList.txtSpecialCasing.txtScripts.txtScriptExtension.txtWordBreakProperty.txtWith the exception of MathClass.txt, which is currently not
formally part of the Unicode Character Database, and
BidiMirroring-5-1-0.txt, which is a data file for Unicode 5.1.0,
all of the data files here are for Unicode 15.1.0.
BidiMirroring-5-1-0.txt will never be updated and is included for
OpenType font support: While BidiMirroring.txt lists all mirror
pairs in the current Unicode version, only the pairs from Unicode 5.1.0
are handled directly by the OpenType rendering system. All newer pairs
have to be handled through font features.
Requests to include additional Unicode data files in this bundle are welcome. Ideally this bundle will act as a single location for all Unicode data for use by TeX systems.
The home page for this bundle is https://github.com/latex3/unicode-data, and issues may be reported there.
EastAsianWidth.txt was not readEastAsianWidth.txtload-unicode-math-classes.tex loaderload-unicode-data.tex\loop to load-unicode-math-classes.texBidiBrackets.txt, Scripts.txt and ScriptExtension.txtPropList.txtBidiMirroring.txt and BidiMirroring-5-1-0.txtemoji-data.txt and GraphemeBreakProperty.txtWordBreakProperty.txtload-unicode-xetex-classes.tex for modified data file format\Uchar for text mode whilst allowing
for upTeX and HiTeX behaviorsThis bundle is copyright (C) 2015-2025 The LaTeX Project
It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this license or (at your option) any later version. The latest version of this license is in the file http://www.latex-project.org/lppl.txt.
The source data (.txt files) are supplied by the Unicode
Consortium and the following notice applies.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2025 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
TeX
95.0%
Lua
5.0%
The Unicode Consortium provide a range of data files detailing the nature of code points in Unicode. These data files are machine-readable but large. Here, a set of loaders are provided to parse these files during a TeX run and set appropriate parameters in an automated fashion.
load-unicode-data.texThe loader parses a number of data files provided by the Unicode Consortium and when used with used Unicode-capable engine sets up a range of TeX-related parameters based on the extracted information.
From the file UnicodeData.txt the following properties are set:
\catcode 11 for all letters (Unicode class "L")\catcode 11 for all combining marks (Unicode class "M")\sfcode 999 for all code points of class "Lu" (upper case
letters)\lccode for all of class "Ll" (lower case letters) to the code
point itself, and \uccode to the upper case mapping (or if
not given to the code point itself)\uccode for all of class "Lu" (upper case letters) to the code
point itself, and \lccode to the lower case mapping (or if
not given to the code point itself)\lccode and \uccode for all of class "Lt" (title case
letters) to the lower and upper case mappings (or if not given
to the code point itself)\lccode and \uccode for all other letter code points are
set to the code point itself\lccode and/or \uccode for non-letter code points for
which an upper or lower case mapping is given\sfcode 0 (ignored) for code points of Unicode classes "Pe"
(closing punctuation marks) and "Pf" (final quotation marks)\Umathcode for all letters (Unicode class "L") and combining
marks (Unicode class "M") as TeX class 7 (var)In the above, 'letters' refers to code points with Unicode class "L", irrespective of their TeX category code.
load-unicode-math-classes.texFrom the file MathClass-15.txt the following mapping between
Unicode math classes and TeX math types are set up
\mathop\mathbin\mathbin\mathrel\mathopen\mathclose\mathpunct\mathalphaFor each code point processed, the result is of the form
\Umathcode <codepoint> = <type> 1 <codepoint>
load-unicode-xetex-classes.texFrom the files EastAsianWidth.txt and LineBreak.txt inter
character classes for XeTeX (\XeTeXcharclass) are set for the
following classes
All code points of classes "ID" and "CJ" are assigned to a
\XeTeXcharclass, but for other classes this only occurs when
they fall into east Asian width type "F", "H" or "W" (full-,
half- and wide-width).
The following mappings between Unicode and XeTeX classes occur
as standard: these may be over-ridden by defining
\XeTeXcharclass<class> as required. (If classes "ID" or "CL"
are explicitly set, the other members of the same groups above
will inherit these values.)
This file does not activate XeTeX's inter-character token
mechanism (\XeTeXinterchartokenstate is not set) nor does it
install any material in the inter-character token registers.
Note that this file is separate from the main loader as the data structure here may need more refinement at the macro level.
The following data files are included here with permission of the Unicode Consortium (see below):
UnicodeData.txtBidiBrackets.txtBidiMirroring.txtBidiMirroring-5-1-0.txtCaseFolding.txtEastAsianWidth.txtemoji-data.txtGraphemeBreakProperty.txtLineBreak.txtMathClass.txtPropList.txtSpecialCasing.txtScripts.txtScriptExtension.txtWordBreakProperty.txtWith the exception of MathClass.txt, which is currently not
formally part of the Unicode Character Database, and
BidiMirroring-5-1-0.txt, which is a data file for Unicode 5.1.0,
all of the data files here are for Unicode 15.1.0.
BidiMirroring-5-1-0.txt will never be updated and is included for
OpenType font support: While BidiMirroring.txt lists all mirror
pairs in the current Unicode version, only the pairs from Unicode 5.1.0
are handled directly by the OpenType rendering system. All newer pairs
have to be handled through font features.
Requests to include additional Unicode data files in this bundle are welcome. Ideally this bundle will act as a single location for all Unicode data for use by TeX systems.
The home page for this bundle is https://github.com/latex3/unicode-data, and issues may be reported there.
EastAsianWidth.txt was not readEastAsianWidth.txtload-unicode-math-classes.tex loaderload-unicode-data.tex\loop to load-unicode-math-classes.texBidiBrackets.txt, Scripts.txt and ScriptExtension.txtPropList.txtBidiMirroring.txt and BidiMirroring-5-1-0.txtemoji-data.txt and GraphemeBreakProperty.txtWordBreakProperty.txtload-unicode-xetex-classes.tex for modified data file format\Uchar for text mode whilst allowing
for upTeX and HiTeX behaviorsThis bundle is copyright (C) 2015-2025 The LaTeX Project
It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this license or (at your option) any later version. The latest version of this license is in the file http://www.latex-project.org/lppl.txt.
The source data (.txt files) are supplied by the Unicode
Consortium and the following notice applies.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2025 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.
TeX
95.0%
Lua
5.0%