1

In terms of character support, a lot of LaTeX fonts leave something to wish for. At the moment I'm using Palatino for text and fourier for maths while having to accept that å, ä, ö, æ and ø only exist as upright in the math font and upright Greek letters are provided by other packages.

Is there any font which, for now regardless of how "pretty" it looks, supports all these characters in text and math mode – italics and upright included? (In ideal world, also bold math natively supported...) I.e. a single font which at least lets me type English-language science (which needs Greek letters, both upright and slanted) with the additional benefits of not having to use accents creatively to use regular Scandinavian letters (which I tend to also use as variable names etc.)

For background reference, these fonts seem to only concentrate on writing using only the Latin English alphabet: https://r2src.github.io/top10fonts/ ... and http://www.tug.dk/FontCatalogue/ is not searchable by supported characters (as far as I know).

EDIT: Disclaimer, because this always comes up: I have two goals: 1) generality, being able to use those commonly used letters properly in arbitrary context and 2) there are certain situations where I need exactly those Scandinavian letters as variables. Similarities with derivative dot markup is not an issue where I will be using these.

6
  • 1
    Please tell us whether you use pdfLaTeX and whether you're open to using XeLaTeX and/or LuaLaTeX.
    – Mico
    Commented Nov 30, 2017 at 5:52
  • 1
    Aside: Are you sure it's a good idea to use the text-mode charactersä and ö in a math context? IMNSHO, doing so creates the potential for lots of confusion with \ddot{a} and \ddot{o}. The double-dot accents (generally?, near-universally?!) signify the second derivative of the associated variable with respect to time. Do you need to, or wish to, go there?
    – Mico
    Commented Nov 30, 2017 at 6:09
  • @Mico pdfLaTeX at the moment; I am considering if I should at some point "move on" to one or the other you mentioned. I'm not intending to use text-mode characters ä and ö, I'm looking for proper math font versions. And I have good didactic reasons for using those: to show students anything can be a symbol in mathematics. There is no possible confusion with derivatives where I will be using these.
    – JoonasD6
    Commented Dec 3, 2017 at 9:48
  • For example, I commonly give out the following simplification problem after teaching the zero product property: (x-a)·(x-b)·(x-c)·...·(x-å)·(x-ä)·(x-ö)
    – JoonasD6
    Commented Dec 3, 2017 at 9:55
  • One thing to keep in mind is that in mathematical typography, "accent characters" such as hats, tildes, and umlauts/tremas regularly get "stacked" one on top of the other. E.g., $\tilde{\hat{\ddot{a}}}$ and $\ddot{\tilde{\hat{a}}}$. (I have no idea what these two things might mean!) The algorithms for placing stacked accents are rather involved, naturally.
    – Mico
    Commented Dec 3, 2017 at 10:04

2 Answers 2

4

You can use these characters in math if you use \textrm and \textit rather than \mathrm and \mathit in most font setups these will use the same fonts. If you are using a font setup where they are different, a version of \textrm that uses the \mathrm front could easily be defined.

enter image description here

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\begin{document}

Here is some math: $ \textrm{zzäöæømm} \neq  \textit{zzäöæømm} \neq  \emptyset$
\end{document}
3

I find this not a good idea: it will confuse your readers, particularly if the dot above for derivatives is used elsewhere. In general, adorned letters have a meaning related to the unadorned one.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{fourier}
% Note: I won't under any circumstance use
% Palatino for text and Utopia (fourier) for math.

\newcommand{\swedishmathchar}[1]{%
  \ifnum\mathgroup=\mathrmgroup
    \textnormal{\upshape#1}%
  \else
    \ifnum\mathgroup=\mathbfgroup
      \textnormal{\bfseries#1}%
    \else
      \textnormal{\itshape#1}%
    \fi
  \fi
}
\newcommand{\makeswedishmathchar}[2]{%
  \DeclareUnicodeCharacter{#1}{%
    \relax
    \ifmmode\swedishmathchar{#2}\else#2\fi
  }%
}
\makeswedishmathchar{00C5}{\r{A}}
\makeswedishmathchar{00E5}{\r{a}}
\makeswedishmathchar{00C4}{\"A}
\makeswedishmathchar{00E4}{\"a}
\makeswedishmathchar{00D6}{\"O}
\makeswedishmathchar{00F6}{\"o}
\makeswedishmathchar{00C6}{\AE}
\makeswedishmathchar{00E6}{\ae}
\makeswedishmathchar{00D8}{\O}
\makeswedishmathchar{00F8}{\o}
\AtBeginDocument{%
  \sbox0{$\mathrm{\xdef\mathrmgroup{\the\fam}}$}%
  \sbox0{$\mathbf{\xdef\mathbfgroup{\the\fam}}$}%
}

\begin{document}
xyzäöæømm

$xyzäöæømm$

$xyz\mathrm{ä}\mathbf{ö}æømm$

\end{document}

enter image description here

3
  • +1 for ingenuity but I find this makes for confusing markup. It would be simpler to use directly the \text.. commands as in @DavidCarlisle's answer.
    – user4686
    Commented Nov 30, 2017 at 22:34
  • 1
    @jfbu I think this is the syntax the OP aimed to.
    – egreg
    Commented Nov 30, 2017 at 22:35
  • indeed but you did oppose his use of Palatino+Fourier ;-)
    – user4686
    Commented Nov 30, 2017 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .