1

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 ...
  • Use $n\check{e} kde$ instead. See: tex.stackexchange.com/q/177000/134574 – Phelype Oleinik Mar 8 at 15:58
  • 1
    The question is whether you really want math mode here? 'někde' looks more like a word to me that should be set in normal text mode and not a math formula (n \cdot \check{e} \cdot k \cdot d \cdot e?) especially in the context it is presented in. Do you maybe just want to emphasise or highlight the word with italics? Then \emph{někde} would be much more appropriate. $...$ is really only for maths, not for text emphasis. (Compare the output of \emph{foo} and $foo$) – moewe Mar 8 at 16:08
  • What I want is \mathbb. Your \check command doesn't yield a good output: to tam musíš $\mathbb{n\check{e}kde}$ použít – user2925716 Mar 8 at 16:11
  • The standard \mathbb font only has glyphs for uppercase characters. Lower-case \mathbb is not included. You'd need a different font. But even then math mode is not really suitable for normal text or emphasis of normal text. – moewe Mar 8 at 16:14
  • OK. I'm a beginner. How do I make normal text in emphasis mode? – user2925716 Mar 8 at 16:15
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.