4

I cannot combine the hat-pointing-down ˇ with [a-zA-z] but mostly [sz]. Pseudocode

\[hat-pointing-down][sz]

Most probable packages

\documentclass{aritcle}
\usepackage{fontspec}

\begin{document}
% character here
\end{document}

Unsuccessful attempts

\ˇ{Z}

How can you type the general character of hat-pointing-down?

  • Do you mean the hacek character like in Czech language ? –  Feb 16 '16 at 11:26
  • @ChristianHupfer Yes, I think it is the same as the diacritical mark. – Léo Léopold Hertz 준영 Feb 16 '16 at 11:27
  • 2
    Traditional way: \v{s}, not using unicode/XeLaTeX features –  Feb 16 '16 at 11:28
  • @Masi Did you try simply typing Ž? – egreg Feb 16 '16 at 11:37
  • @egreg I cannot type the letter with my keyboard so it is not so simple. I cannot find it in OS X Dvorak International. – Léo Léopold Hertz 준영 Feb 16 '16 at 11:38
  • @Masi What I can see is that the Dvorak keyboard layout is very defective and just provides accents only for French, Spanish and German. – egreg Feb 16 '16 at 11:45
  • 2
    @Masi have you tried copy-pasting from wikipedia for instance? – yo' Feb 16 '16 at 11:47
  • @egreg Can you please describe how to make Dvorak keyboard layout better? There are much variations in Dvorak layouts in different systems. Priority 2 bug has now been about the layout in Chromebook some months here https://code.google.com/p/chromium/issues/detail?id=540815&thanks=540815&ts=1444243379#makechanges Dvorak International OS X is good with Scandinavian and German support. Dvorak Linux is deficient without deadkeys. It would be great if you could extend your explanation about how to make Dvorak better – Léo Léopold Hertz 준영 Feb 16 '16 at 13:27
  • @egreg This seems to be a relevant thread where to understand better Dvorak's deficiencies http://tex.stackexchange.com/a/17511/13173 Please, note that developers need to understand how Dvorak could be improved. It would be great if you could specify those deficiencies. – Léo Léopold Hertz 준영 Feb 16 '16 at 13:46
  • @Masi I just stated a fact after looking at the available dead keys. I know nothing about Dvorak keyboards. – egreg Feb 16 '16 at 14:11
  • 2
    This is a place where your editor could help you. In both emacs and vim you can set up keybindings for high Unicode characters. This makes the keyboard layout less important. – musarithmia Feb 16 '16 at 14:23

2 Answers2

8

The traditional way to get the “háček” diacritic is \v{} - but this does not look good with fontspec without choosing a particular font)

Using \usepackage[utf8]{inputenc} or XeLaTeX the “háček” diacritic can be typed directly, for example U+0161 for š.

\documentclass{article}
\usepackage[T1]{fontenc}

\begin{document}
\v{a}
\v{b}
\v{c}
\v{d}
\end{document}

enter image description here

4

The best way is, of course, typing directly š or ž, which many keyboard layouts allow.

Otherwise you can use the standard commands:

\documentclass{article}

\usepackage{fontspec}

\newcommand{\ha}{% don't bother with this, it's just for showing the code
  \begingroup\catcode`\v=12 \catcode`\c=12 \haa
}
\newcommand\haa[1]{%
  \texttt{\detokenize{#1}}:~#1\endgroup
}

\begin{document}

The háček (Czech), āķis (Latvian), kablys (Lithuanian),
háčik (Slovak), kavelj (Slovene), kuka (Croatian and Serbian)
can be obtained with \TeX{} by prefixing the character
with \verb|\v|:
\begin{center}
\ha{\v{C}}\quad
\ha{\v{c}}\quad
\ha{\v{D}}\quad
\ha{\v{d}}\quad
\ha{\v{E}}\quad
\ha{\v{e}}\quad
\ha{\v{L}}\quad
\ha{\v{l}}\quad
\ha{\v{N}}\quad
\ha{\v{n}}\quad
\ha{\v{R}}\quad
\ha{\v{r}}\quad
\ha{\v{S}}\quad
\ha{\v{s}}\quad
\ha{\v{T}}\quad
\ha{\v{t}}\quad
\ha{\v{Z}}\quad
\ha{\v{z}}
\end{center}

Note that \texttt{fontspec} is able to use the correct
realization of the diacritic in certain combinations.

For the Latvian alphabet, you can do
\begin{center}
\ha{\={A}}\quad
\ha{\={a}}\quad
\ha{\v{C}}\quad
\ha{\v{c}}\quad
\ha{\={E}}\quad
\ha{\={e}}\quad
\ha{\c{G}}\quad
\ha{\c{g}}\quad
\ha{\={I}}\quad
\ha{\={i}}\quad
\ha{\c{K}}\quad
\ha{\c{k}}\quad
\ha{\c{L}}\quad
\ha{\c{l}}\quad
\ha{\c{N}}\quad
\ha{\c{n}}\quad
\ha{\v{S}}\quad
\ha{\v{s}}\quad
\ha{\={U}}\quad
\ha{\={u}}\quad
\ha{\v{Z}}\quad
\ha{\v{z}}
\end{center}
\end{document}

enter image description here

However, since the Dvorak keyboard allows typing ˇ (Alt-Shift-t), ¯ (Alt-Shift-,) and ¸ (Alt-Shift-z), you can also use newunicodechar:

\documentclass{article}

\usepackage{fontspec}

% define the prefixes
\usepackage{newunicodechar}
\newunicodechar{ˇ}{\v}
\newunicodechar{¯}{\=}
\newunicodechar{¸}{\c}

\newcommand{\ha}[1]{% don't bother with this, it's just for showing the code
  \texttt{\detokenize{#1}}:~#1%
}

\begin{document}

The háček (Czech), āķis (Latvian), kablys (Lithuanian),
háčik (Slovak), kavelj (Slovene), kuka (Croatian and Serbian)
can be obtained with \TeX{} by prefixing the character
with \verb|ˇ|:
\begin{center}
\ha{ˇC}\quad
\ha{ˇc}\quad
\ha{ˇD}\quad
\ha{ˇd}\quad
\ha{ˇE}\quad
\ha{ˇe}\quad
\ha{ˇL}\quad
\ha{ˇl}\quad
\ha{ˇN}\quad
\ha{ˇn}\quad
\ha{ˇR}\quad
\ha{ˇr}\quad
\ha{ˇS}\quad
\ha{ˇs}\quad
\ha{ˇT}\quad
\ha{ˇt}\quad
\ha{ˇZ}\quad
\ha{ˇz}
\end{center}

Note that \texttt{fontspec} is able to use the correct
realization of the diacritic in certain combinations.

For the Latvian alphabet, you can do
\begin{center}
\ha{¯A}\quad
\ha{¯a}\quad
\ha{ˇC}\quad
\ha{ˇc}\quad
\ha{¯E}\quad
\ha{¯e}\quad
\ha{¸G}\quad
\ha{¸g}\quad
\ha{¯I}\quad
\ha{¯i}\quad
\ha{¸K}\quad
\ha{¸k}\quad
\ha{¸L}\quad
\ha{¸l}\quad
\ha{¸N}\quad
\ha{¸n}\quad
\ha{ˇS}\quad
\ha{ˇs}\quad
\ha{¯U}\quad
\ha{¯u}\quad
\ha{ˇZ}\quad
\ha{ˇz}
\end{center}
\end{document}

enter image description here

egreg
  • 1,121,712