2

How do I use fonts \mathrm and \mathbb with czech letters č,ě,š,ř,ž,ý,á,í....?

Command Line: bibtex.exe "ideje"

[12] [13] [14] [15] [16] [17]

Package amsfonts Warning: Obsolete command \frak; \mathfrak should be used inst
ead on input line 501.

(D:\ProgramFiles\MikTexExe\tex\latex\amsfonts\ueuf.fd) [18]

LaTeX Warning: Command \v invalid in math mode on input line 529.

! Please use \mathaccent for accents in math mode.
\add@accent ...@spacefactor \spacefactor }\accent 
                                                  #1 #2\egroup \spacefactor ...
l.529   \item to tam musíš $ně
                                 kde$ použít
? 

! Emergency stop.
\add@accent ...@spacefactor \spacefactor }\accent 
                                                  #1 #2\egroup \spacefactor ...
l.529   \item to tam musíš $ně
                                 kde$ použít


Process has been killed ...
Superuser27
  • 1,312
user2925716
  • 1,940

2 Answers2

3

Math mode is not suitable to put emphasis or other formatting on normal text. Math mode is (as the name suggests) for mathematics. In particular $někde$ (if it compiled) or $n\check{e}kde$ (which compiles, as suggested by Phelype Oleinik in the comments) would usually be interpreted as a mathematical term, specifically the product of the variables n, ě (or e-check), k, d and e.

Compare

$this is horrible emphasis$

with

\emph{this is emphasis}

In particular the mathematics fonts used in TeX may not support the same sets of glyphs with the same accents as the text fonts. (And math accents may be input and handled differently.)

In text there are a variety of ways to emphasise or highlight certain words. A good overview can be found in Nicola Talbot's LaTeX for Complete Novices https://www.dickimaw-books.com/latex/novices/html/fontstyle.html#44113

\documentclass[czech]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}

\begin{document}
$this is horrible emphasis$ % don't try this at home!

\emph{this is emphasis}

\begin{itemize}
  \item to tam musíš někde použít
  \item to tam musíš \emph{někde} použít
  \item to tam musíš \textit{někde} použít
  \item to tam musíš \textbf{někde} použít
  \item to tam musíš \textsf{někde} použít
\end{itemize}
\end{document}

"to tam musíš někde použít" with different emphasis on 'někde'. First no emphasis, then \emph (italics), then italics, bold and finally sans serif


To answer the question in the title. The standard amssymb fonts for \mathbb only support upper-case letters (ASCII letters, that is). You would need an alternative that does have lowercase letters (and more importantly and even less likely, you would have to find one that supports properly accented letters). Lowercase letters are not supported. See for example Blackboard bold characters

moewe
  • 175,683
1

After repeating the same reservations that you should be sure you really want to do this, here’s how you can.

In unicode-math, you can set the \mathrm font. If what you want to do is define a Czech word as an operator or variable name, you might prefer setting the operator font and using \operatorname from the amsmath package.

Unicode does not have any codepoints for accented blackboard bold, but you can declare your own double-struck font face that does. Here, I use the free font Foglihten No01.

A contrived example:

\documentclass[varwidth]{standalone}
\usepackage{unicode-math}

\setmathrm{Latin Modern Roman Caps}[Scale=MatchLowercase] % For example
% Available at http://www.glukfonts.pl/font.php?font=FoglihtenNo01
\setmathfontface\mathds{FoglihtenNo01.otf}[Scale=MatchLowercase]

\begin{document}
to tam musíš \(\mathrm{ně kde}\) \\
použít \(\mathds{Ě}\)

\end{document}

Czech in mathematics

Or for a more dramatic contrast:

\documentclass[varwidth]{standalone}
\usepackage{unicode-math}

\setmathrm{Latin Modern Roman Caps}[Scale=MatchLowercase] % For example
% Available at http://www.glukfonts.pl
\setmathfontface\mathds{FoglihtenNo03.otf}[Scale=1.3]

\begin{document}
to tam musíš \(\mathrm{někde}\) \\
použít \(\mathds{Ě}\)

\end{document}

Foglihten Noo3 sample

If what you want are accents over \mathbb characters, you can define that as a math accent.

\documentclass[varwidth]{standalone}
\usepackage[T1]{fontenc}
\usepackage{amssymb}

\DeclareSymbolFont{lmodern}{T1}{lmr}{m}{n}
\DeclareMathAccent{\caron}{\mathord}{lmodern}{"07}

\begin{document}
R \(\caron{\mathbb{R}}\)
\end{document}

Legacy font sample

Davislor
  • 44,045