| 1 |
%%^^A%% unimath-example.ltx -- part of UNICODE-MATH <wspr.io/unicode-math> |
| 2 |
%%^^A%% A minimal example file to demonstrate the package. |
| 3 |
|
| 4 |
%%%%%%%%%%%%%%%%%%%%%%% |
| 5 |
% UNICODE-MATH EXAMPLE FILE |
| 6 |
%%%%%%%%%%%%%%%%%%%%%%% |
| 7 |
|
| 8 |
\documentclass{article} |
| 9 |
|
| 10 |
% Load fontspec and define a document font: |
| 11 |
\usepackage{fontspec} |
| 12 |
\setmainfont{texgyrepagella-regular.otf} |
| 13 |
|
| 14 |
% Load unicode-math and define a math font: |
| 15 |
\usepackage{unicode-math} |
| 16 |
\setmathfont{texgyrepagella-math.otf} |
| 17 |
|
| 18 |
\begin{document} |
| 19 |
\title{An example of \textsf{unicode-math}} |
| 20 |
\author{Will Robertson} |
| 21 |
\maketitle |
| 22 |
|
| 23 |
This is an example of the \textsf{unicode-math} package. |
| 24 |
It allows you to write maths with Unicode input and to use fonts that contain Unicode mathematical glyphs. Follow along in the source code to see how it works. |
| 25 |
|
| 26 |
After loading the package and selecting a font, you shouldn't need to change much to continue to write maths as always. |
| 27 |
\[ |
| 28 |
F(s)=\symscr L \{f(t)\}=\int_0^\infty \symup e^{-st}f(t)\,\symup d t |
| 29 |
\] |
| 30 |
|
| 31 |
The style of Latin and Greek letters is set up by default to match the output of standard \LaTeX: Latin letters and Greek lowercase letters are italic, and Greek uppercase letters are upright. These can be configured with the \texttt{math-style} package option. |
| 32 |
|
| 33 |
One very important feature to recognise is that bold maths now works consistently for both Latin and Greek letters. By default, \verb|\symbf| will turn a Latin letter bold and upright, and a Greek letter will remain italic and also become bold. For example: |
| 34 |
\[ |
| 35 |
\symbf{a} = a\,\symbf{I} \qquad \symbf{\beta} = \beta\,\symbf{I} |
| 36 |
\] |
| 37 |
This behaviour can be configured with the \texttt{bold-style} package option. |
| 38 |
|
| 39 |
In the examples above, I've used \LaTeX\ commands to input characters like \verb|\beta|, \verb|\infty|, and so on. These may now be typed directly into the source of the document: |
| 40 |
\[ |
| 41 |
𝐉 = ∇×𝐇 \qquad 𝐁 = μ₀(𝐌 + 𝐇) |
| 42 |
\] |
| 43 |
\[ |
| 44 |
∫₀³ xⁿφ₁₂(x)\,ⅆx |
| 45 |
\] |
| 46 |
It does not matter if you use upright or italic characters; they will be normalised according to the setting of the \texttt{math-style} and \texttt{bold-style} options. |
| 47 |
|
| 48 |
And that's a brief introduction to the package. Please see the documentation for further details. This is a new package; feedback, suggestions, and bug reports are all most welcome. |
| 49 |
|
| 50 |
\end{document} |
| 51 |
|
| 52 |
\endinput |
| 53 |
|
| 54 |
% /© |
| 55 |
% |
| 56 |
% ------------------------------------------------ |
| 57 |
% The UNICODE-MATH package <wspr.io/unicode-math> |
| 58 |
% ------------------------------------------------ |
| 59 |
% This package is free software and may be redistributed and/or modified under |
| 60 |
% the conditions of the LaTeX Project Public License, version 1.3c or higher |
| 61 |
% (your choice): <http://www.latex-project.org/lppl/>. |
| 62 |
% ------------------------------------------------ |
| 63 |
% Copyright 2006-2019 Will Robertson, LPPL "maintainer" |
| 64 |
% Copyright 2010-2017 Philipp Stephani |
| 65 |
% Copyright 2011-2017 Joseph Wright |
| 66 |
% Copyright 2012-2015 Khaled Hosny |
| 67 |
% ------------------------------------------------ |
| 68 |
% |
| 69 |
% ©/ |