3

See, I wanted to type Ħ but I couldn't find any command so please can you find a command except Ħ as a Unicode character. I'm also using XeLaTeX, but the viewers aren't so please help me and those persons.

6
  • 3
    what do you mean by "viewers aren't` ? peopl reading your pdf do not need xetex. xetex will show that character if you specify a suitable font that has it Feb 29 at 17:14
  • Welcome to TeX.SE!
    – Mensch
    Feb 29 at 17:39
  • This is an IPA symbol. How do I know? I googled it, so you will need a font that contains it.
    – yannisl
    Feb 29 at 17:57
  • @yannisl It's a letter in the Maltese alphabet.
    – egreg
    Feb 29 at 18:03
  • @egreg Thanks I see the difference in the wiki.
    – yannisl
    Feb 29 at 18:12

2 Answers 2

6

You do not need a command

\documentclass{article}

\begin{document}

Ħ

\end{document}

produces

enter image description here

with xelatex.

Wth pdflatex you get

! LaTeX Error: Unicode character Ħ (U+0126)
               not set up for use with LaTeX.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.5 Ħ
      
? h
You may provide a definition with
\DeclareUnicodeCharacter 
? 

But as the help text says you can declare the character

\documentclass{article}
\ifdefined\DeclareUnicodeCharacter
\DeclareUnicodeCharacter{0126}{H\llap{\rule[1ex]{.8em}{.04em}}}
\fi

\begin{document}

Ħ

\end{document}

with pdflatex produces

enter image description here

You can of course adjust the bar position as required.

Or with pdftex you may prefer the B{H} from the fc font designed for African languages using Latin script

enter image description here

\documentclass{article}

\usepackage[T1,T4]{fontenc}
\ifdefined\DeclareUnicodeCharacter
\DeclareUnicodeCharacter{0126}{{\fontencoding{T4}\selectfont\B{H}}}
\begin{document}

Ħ 

\end{document}
2
  • 1
    The Maltese Ħ is very different from the \B{H} character (not to mention that T4 fonts are only available as bitmap.
    – egreg
    Feb 29 at 17:59
  • @egreg sure but I offered a bar rule first, which isn't substantially different to using a bar glyph Feb 29 at 19:56
6

For XeLaTeX just use the character. For pdflatex you need to define the characters by imposing a bar to H and h.

\documentclass{article}

\DeclareUnicodeCharacter{0126}{\malteseH}%
\DeclareUnicodeCharacter{0127}{\malteseh}%
\newcommand{\malteseH}{%
  \makebox[0pt][l]{%
    \dimen0=\fpeval{(\the\fontdimen1\font)/(1pt)}\fontcharwd\font`H
    \hspace{0.05\fontcharwd\font`H}%
    \hspace{\dimen0}%
    \rule[1.15ex]{\dimeval{0.9\fontcharwd\font`H-0.5\dimen0}}{0.035em}%
  }H%
}
\newcommand{\malteseh}{%
  \makebox[0pt][l]{%
    \dimen0=\fpeval{(\the\fontdimen1\font)/(1pt)}\fontcharwd\font`h
    \hspace{0.05\fontcharwd\font`h}%
    \hspace{\dimen0}%
    \rule[1.2ex]{0.45\fontcharwd\font`h}{0.035em}%
  }h%
}

\begin{document}

Ħ ħ \textbf{Ħ ħ} \textit{Ħ ħ}

GĦ għ

GH gh

\end{document}

enter image description here

You must log in to answer this question.

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