I've been typesetting all my functions in non-italics (even for $f(x)$
), but am not sure if this is the correct convention. This website suggests that generic functions (e.g., $f(x), g(x)$
should be in italics and only ones with fixed meaning should not (e.g., $\sin(x)$
). What if I give the function a fixed meaning (e.g., $F(x)$
always mean XXX in the text). What convention does everyone use?
-
Please tell us whether you use Plain-TeX or LaTeX.– MicoMay 8 at 9:31
-
1Using Latex thanks– stevewMay 8 at 10:04
1 Answer
There are various, and often conflicting, typographical conventions for virtually everything under the sun, including mathematical typesetting. It's true that some typographical conventions are more widely observed than others, depending on which country and typographical tradition you feel you are associated with. However, there is no universal convention for math typesetting, beyond possibly [??] the convention that the =
symbol should always signify "equality" or "is equal to" -- in some properly defined sense, of course.
Rather than committing to any one given math style, you may want to look into typesetting your documents under XeLaTeX and/or LuaLaTeX. That way, you can make use of the unicode-math package, which offers four [yes, 4] different "math styles" that govern the way non-bold lowercase and uppercase Latin and Greek letters are typeset. They are:
ISO
: italic (aka sloped) shape for all Latin and Greek letters, both uppercase and lowercase.TeX
(maybe should be called "Knuth"?): italic shape for all Latin letters (both uppercase and lowercase); italic lowercase Greek letters; upright uppercase Greek letters.french
: italic lowercase Latin letters; upright uppercase Latin letters; upright lowercase and uppercase Greek letters.upright
: upright shape for all Latin and Greek letters, both uppercase and lowercase.
I'm pretty confident that these four styles manage to cover the vast majority of conventions one may run into "in the wild". However, I wouldn't be surprised if there were some math typesetting conventions out there, somewhere, that do not conform to one of these four styles. Do please let me know if you run across such a deviant math style...
The following table shows how these styles affect the "look" of lowercase and uppercase Latin and Greek letters.
The important thing to do is to use as little visual formatting as possible and, instead, to rely on LaTeX and the unicode-math
package to do the tedious job for you of making the typeset mathematics adhere to the chosen style.
The unicode-math
package also offers three options for the bold-style
criterion: ISO
, TeX
, and upright
; see section 5.2 of the package's user guide for detailed information. To use the ISO
style for regular-weight letters and the upright
style for bold letters, you'd type
\setmathfont{Stix Two Math}[math-style=ISO,bold-style=upright]
You asked a separate question:
What if I give the function a fixed meaning (e.g.,
$F(x)$
always mean XXX in the text)?
The typographic issue worth noting isn't that F
could happen to represent only one specific function -- at least in your usage of F
. The typographic issue at stake is that F
is very much a generic symbol; as such, the way it should get typeset should very much depend on the math style you employ. In contrast, \sin
can only ever mean one thing -- unless you want to assign a non-standard meaning to \sin
, in which case you will have well earned the unforgiving and everlasting enmity of your readers...
Here's the code that gave rise to the screenshot shown above.
\documentclass{article}
\usepackage{booktabs,unicode-math}
\setmainfont{Stix Two Text} % or some other suitable text font
\newcommand\blurb{$abc \quad y=f(x) \quad ABC \quad \sigma\phi\psi \quad \Sigma\Phi\Psi$}
\begin{document}
\begin{tabular}{@{}ll@{}}
math style & output \\
\midrule
ISO & \setmathfont{Stix Two Math}[math-style=ISO]\blurb \\
TeX & \setmathfont{Stix Two Math}[math-style=TeX]\blurb \\
french & \setmathfont{Stix Two Math}[math-style=french]\blurb \\
upright & \setmathfont{Stix Two Math}[math-style=upright]\blurb \\
\end{tabular}
\end{document}
-
1
-
What about
sin
ande
andi
? There the styles may vary more then your four generic types (which are valuable). May 8 at 21:52 -
@usr1234567 - I'm not aware of a math style that recommends using italic letters for
sin
,cos
,exp
,log
, etc; however, I wouldn't be terribly shocked if such a style did exist. The ISO standards webpage cited by the OP states thate
andi
should be rendered in the upright font shape if they denote the resp. famous mathematical constants. However, I believe it's fair to say that adherence to this standard is far from universal -- at least among mathematicians. (Aside: I usei
a lot in my own writing, but as an indexing variable, never as the square root of-1
.)– MicoMay 10 at 20:16 -
Nice answer! I've seen that there also seems to be a
math-style=literal
, but I'm not sure if that is used.– mickepMay 13 at 18:35 -
1@mickep - Thanks. AFAICT,
math-style=literal
isn't really comparable to the four math styles I mention in my answer. The main effect ofmath-style=literal
is to assure that if you enter a given symbol (say, the glyph for upright-alpha) directly, it will get rendered "as is". In contrast, ifmath-style=TeX
were in effect, Xe/LuaLaTeX would produce a slanted alpha glyph even though the input consists of an upright alpha. I must confess to not knowing what a meaningful use case formath-style=literal
could be.– MicoMay 13 at 20:41