1

I have a few dozens of letters that I want to use inside document without auxiliary symbols (as a plain text).

How should I tune up latex for it?

I.e. As I see babel package allows to solve the same problem with a predefined sets of letters (\usepackage[russian, german, french]{babel}). I want to have a kind of a set with other letters.

Thank you for an answer.

New contributor
Егор Карпов is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • If we would know the letters or langauge, we might be able to help you better? With a unicode engine and a OTF font that has the letters, there shouldn't be real problems. What have you got? – Johannes_B May 15 at 13:03
  • @Johannes_B I need these letters to be used: АаÁáÄäÅåBbCcČčDdĐđEeÉéËëĚěĘęFfGgĜĝHhIiÏïǏǐĮįJjKkLlMmNnOoÓóÖöÔôÒòPpRrŘřSsŜŝŠšTtŦŧUuÚúÜüŲųŬŭVvYyZzŽž – Егор Карпов May 15 at 13:17
3

You can do almost all of those characters with pdflatex (I changed the Cyrillic A and a into the Latin ones). The only ones not covered in the default setup are Ŧ and ŧ, but it's not difficult to add suitable definitions for them.

\documentclass{article}
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}% not needed in recent LaTeX
\usepackage{graphicx}

\DeclareUnicodeCharacter{0166}{\barredT}
\DeclareUnicodeCharacter{0167}{\barredt}

\DeclareRobustCommand{\barredT}{\barredTt{0.5}{0.05}{1.5}{T}}
\DeclareRobustCommand{\barredt}{\barredTt{0.4}{0}{1.15}{t}}
\newcommand{\reducedhyphen}[2]{%
  \raisebox{#1ex}{\scalebox{#2}[0.5]{-}}%
}
\newcommand{\barredTt}[4]{%
  \begingroup
  \vphantom{#4}%
  \ooalign{%
    #4\cr
    \hidewidth\kern#2em\reducedhyphen{#1}{#3}\hidewidth\cr
  }%
  \endgroup
}

\begin{document}

\newcommand{\charlist}{%
  \par\noindent
  A a Á á Ä ä Å å B b C c Č č D d Đ đ E e É é Ë ë Ě ě Ę ę F f 
  G g Ĝ ĝ H h I i Ï ï Ǐ ǐ Į į J j K k L l M m N n O o Ó ó Ö ö 
  Ô ô Ò ò P p R r Ř ř S s Ŝ ŝ Š š T t Ŧ ŧ U u Ú ú Ü ü Ų ų Ŭ ŭ 
  V v Y y Z z Ž ž\par
}

\charlist
\textbf{\charlist}
\textit{\charlist}

\end{document}

enter image description here

2

I don't really understand what needs to be tuned up.

egorUnicodeLetters

\documentclass[twocolumn]{article}
\usepackage{mwepage}
\usepackage{fontspec}
\usepackage{libertine}
\begin{document}
\noindent А
а
Á
á
Ä
ä
Å
å
B
b
C
c
Č
č
D
d
Đ
đ
E
e
É
é
Ë
ë
Ě
ě
Ę
ę
F
f
G
g
Ĝ
ĝ
H
h
I
i
Ï
ï
Ǐ
ǐ
Į
į
J
j
K
k
L
l
M
m
N
n
O
o
Ó
ó
Ö
ö
Ô
ô
Ò
ò
P
p
R
r
Ř
ř
S
s
Ŝ
ŝ
Š
š
T
t
Ŧ
ŧ
U
u
Ú
ú
Ü
ü
Ų
ų
Ŭ
ŭ
V
v
Y
y
Z
z
Ž
ž
\end{document}
  • Hmm... There are no mwepage and libertine packages available (Error: File `mwepage.sty' not found. \usepackage) – Егор Карпов May 15 at 13:56
  • @ЕгорКарпов Oh sorry, that is a leftover not meant to be in the MWE. It is just for the yellowish background of the image. You can remove it. Package libertine should be available though. – Johannes_B May 15 at 14:05
  • libertine is just a font package. You could choose any font that actually contains the glyphs (letters). If the font designer didn't bother to create a matching glyph, it won't be included in the font and the spot will remain empty. – Johannes_B May 15 at 14:07
  • I cannot compile document with the following letters: Đ đ Ę ę Į į Ŧ ŧ Ų ų (error: Command \k unavailable in encoding OT1. ų and Package inputenc Error: Unicode char ŧ (U+167)(inputenc) not set up for use with LaTeX. ŧ). Other letters are OK. – Егор Карпов May 15 at 14:24
  • Are you compiling the document as posted? The input encoding beeing utf8? – Johannes_B May 15 at 14:31
1

cm-unicode has all the glyphs (not Latin Modern):

\documentclass{article}

\usepackage{fontspec}
\setmainfont{CMU Serif}

\begin{document}

АаÁáÄäÅåBbCcČčDdĐđEeÉéËëĚěĘęFfGgĜĝHhIiÏïǏǐĮįJjKkLlMmNn OoÓóÖöÔôÒòPpRrŘřSsŜŝŠšTtŦŧUuÚúÜüŲųŬŭVvYyZzŽž

\end{document} 

enter image description here

1

In XeLaTeX or LuaLaTeX, \usepackage{fontspec} to enable all Unicode characters. If you use the \babelfont command after loading babel, this will also load fontspec. Make sure the font you select contains all the characters you need. For example, you mentioned Russian and the default Latin Modern Roman does not contain Cyrillic, but Computer Modern Unicode does, so you might write it this way:

\documentclass{article}
\usepackage{babel}
\usepackage{fontspec}

\babelprovide[import=ru, main]{russian}
\babelprovide[import]{german}
\babelprovide[import=fr]{french}

% Versions of babel prior to 2019 incorrectly ignored all default features.
% As a workaround, you could specify them as options.
\defaultfontfeatures{Scale = MatchLowercase}
\babelfont{rm}[Scale=1.0]{CMU Serif}
\babelfont{sf}{CMU Sans Serif}
\babelfont{tt}{CMU Typewriter Text}

\begin{document}
\otherlanguage{german}{Frauenfußball}

\otherlanguage{french}{football féminin}

\otherlanguage{russian}{женский футбол}
\end{document}

(You can add the Language=Default font feature to any of the fonts to suppress the harmless error message about a language not being “available with” a script.)

In PDFLaTeX, start by setting the correct font encodings for the glyphs you use, if babel doesn’t already. Western European languages use T1 and Russian uses T2A or X2. You generally also want to \usepackage{textcomp} to get other commonly-used symbols from the text-companion encoding. When you \usepackage[utf8]{inputenc} (which has been the default since the spring of 2018), LaTeX will understand any Unicode characters from the standard encodings that you select.

If you need any other Unicode characters that you cannot support this way (because you need to load them from another font or fake them with a command), you can declare them with the newunicodechar package, e.g. \newunicodechar{🄯}{\reflectbox{\textcopyright}}.

Your Answer

Егор Карпов is a new contributor. Be nice, and check out our Code of Conduct.

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.