在我的语言中,我们使用字母“ģ”代表LATIN SMALL LETTER G WITH CEDILLA
代码U+0123
。我怎样才能用纯乳胶写它?
解决方案 好的,我得到了我想要的,感谢WriteLatex utf-8 ģ符号问题和@egreg 的回答。编写所有拉脱维亚字母的基本代码如下:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{combelow}
\DeclareTextCompositeCommand{\c}{T1}{G}{\cb{G}}
\DeclareTextCompositeCommand{\c}{T1}{g}{\cb{g}}
\DeclareTextCompositeCommand{\c}{T1}{K}{\cb{K}}
\DeclareTextCompositeCommand{\c}{T1}{k}{\cb{k}}
\DeclareTextCompositeCommand{\c}{T1}{L}{\cb{L}}
\DeclareTextCompositeCommand{\c}{T1}{l}{\cb{l}}
\DeclareTextCompositeCommand{\c}{T1}{N}{\cb{N}}
\DeclareTextCompositeCommand{\c}{T1}{n}{\cb{n}}
\DeclareTextCompositeCommand{\c}{T1}{R}{\cb{R}}
\DeclareTextCompositeCommand{\c}{T1}{r}{\cb{r}}
\DeclareTextCompositeCommand{\c}{T1}{a}{\={a}}
\DeclareTextCompositeCommand{\c}{T1}{A}{\={A}}
\DeclareTextCompositeCommand{\c}{T1}{e}{\={e}}
\DeclareTextCompositeCommand{\c}{T1}{E}{\={E}}
\DeclareTextCompositeCommand{\c}{T1}{i}{\=\i}
\DeclareTextCompositeCommand{\c}{T1}{I}{\={I}}
\DeclareTextCompositeCommand{\c}{T1}{u}{\={u}}
\DeclareTextCompositeCommand{\c}{T1}{U}{\={U}}
\DeclareTextCompositeCommand{\c}{T1}{c}{\v{c}}
\DeclareTextCompositeCommand{\c}{T1}{C}{\v{C}}
\DeclareTextCompositeCommand{\c}{T1}{s}{\v{s}}
\DeclareTextCompositeCommand{\c}{T1}{S}{\v{S}}
\DeclareTextCompositeCommand{\c}{T1}{z}{\v{z}}
\DeclareTextCompositeCommand{\c}{T1}{Z}{\v{Z}}
\DeclareUnicodeCharacter{0122}{\c{G}}
\DeclareUnicodeCharacter{0123}{\c{g}}
\DeclareUnicodeCharacter{0136}{\c{K}}
\DeclareUnicodeCharacter{0137}{\c{k}}
\DeclareUnicodeCharacter{013B}{\c{L}}
\DeclareUnicodeCharacter{013C}{\c{l}}
\DeclareUnicodeCharacter{0145}{\c{N}}
\DeclareUnicodeCharacter{0146}{\c{n}}
\DeclareUnicodeCharacter{0156}{\c{R}}
\DeclareUnicodeCharacter{0157}{\c{r}}
\DeclareUnicodeCharacter{0100}{\c{A}}
\DeclareUnicodeCharacter{0101}{\c{a}}
\DeclareUnicodeCharacter{0112}{\c{E}}
\DeclareUnicodeCharacter{0113}{\c{e}}
\DeclareUnicodeCharacter{012A}{\c{I}}
\DeclareUnicodeCharacter{012B}{\c{i}}
\DeclareUnicodeCharacter{016A}{\c{U}}
\DeclareUnicodeCharacter{016B}{\c{u}}
\DeclareUnicodeCharacter{010C}{\c{C}}
\DeclareUnicodeCharacter{010D}{\c{c}}
\DeclareUnicodeCharacter{0160}{\c{S}}
\DeclareUnicodeCharacter{010E}{\c{s}}
\DeclareUnicodeCharacter{017D}{\c{Z}}
\DeclareUnicodeCharacter{017E}{\c{z}}
\begin{document}
Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ, Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž
\end{document}
简化行动这可能是 latvian babel 的一部分吗?在 CTAN 中获取包的步骤是什么?
答案1
如果您不介意依赖combelow
我认为最简单的解决方案是:
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{combelow}
\usepackage[latvian.t1composite]{babel}
\usepackage{lmodern}
\DeclareUnicodeCharacter{0122}{\c{G}}
\DeclareUnicodeCharacter{0123}{\c{g}}
\DeclareUnicodeCharacter{0136}{\c{K}}
\DeclareUnicodeCharacter{0137}{\c{k}}
\DeclareUnicodeCharacter{013B}{\c{L}}
\DeclareUnicodeCharacter{013C}{\c{l}}
\DeclareUnicodeCharacter{0145}{\c{N}}
\DeclareUnicodeCharacter{0146}{\c{n}}
\DeclareUnicodeCharacter{0156}{\c{R}}
\DeclareUnicodeCharacter{0157}{\c{r}}
\DeclareUnicodeCharacter{0100}{\={A}}
\DeclareUnicodeCharacter{0101}{\={a}}
\DeclareUnicodeCharacter{0112}{\={E}}
\DeclareUnicodeCharacter{0113}{\={e}}
\DeclareUnicodeCharacter{012A}{\={I}}
\DeclareUnicodeCharacter{012B}{\={i}}
\DeclareUnicodeCharacter{016A}{\={U}}
\DeclareUnicodeCharacter{016B}{\={u}}
\begin{document}
Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ,
Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž
\end{document}
注意fontenc
和combelow
在 之前加载babel
。有关更多信息,请参阅手册。(在内部,\c{g}
有不同的定义,以防万一,至于未定义的 Unicode 字符,这与 不直接相关babel
)。
编辑。甚至更简单......(我以前为什么没想到这一点?:-))。
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage[L7x,T1]{fontenc}
\usepackage{combelow}
\usepackage[latvian.t1composite]{babel}
\usepackage{fourier}
\begin{document}
Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ,
Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž
\end{document}
它为什么有效?问题是utf8
仅定义请求的字体编码中可用的字符(即预组合字符)。T1
不包含这些拉脱维亚字符,因此它们仍未定义。这是出于效率原因而设计的,因此它不是一个错误(也许是一个缺陷)。但是,确实L7x
包含它们,因此它们被定义。但在我看来,加载未使用的字体编码远非理想。(警告:某些字体使用点来呈现宏指令-i,因为 l7xenc.def 将其定义为 \=i。)
答案2
不幸的是,拉脱维亚语的支持很差babel
:带有逗号变音符号的字母被错误地用变音符号表示。
这是一个可能更好的实现。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[latvian]{babel}
\makeatletter
\DeclareTextCommandDefault\textcommaabove[1]{%
\hmode@bgroup
\ooalign{%
\hidewidth
\raise.7ex\hbox{%
\check@mathfonts\fontsize\ssf@size\z@\math@fontsfalse\selectfont`%
}%
\hidewidth\crcr
\null#1\crcr
}%
\egroup
}
\makeatother
\DeclareTextCompositeCommand{\c}{T1}{G}{\textcommabelow{G}}
\DeclareTextCompositeCommand{\c}{T1}{g}{\textcommaabove{g}}
\DeclareTextCompositeCommand{\c}{T1}{K}{\textcommabelow{K}}
\DeclareTextCompositeCommand{\c}{T1}{k}{\textcommabelow{k}}
\DeclareTextCompositeCommand{\c}{T1}{L}{\textcommabelow{L}}
\DeclareTextCompositeCommand{\c}{T1}{l}{\textcommabelow{l}}
\DeclareTextCompositeCommand{\c}{T1}{N}{\textcommabelow{N}}
\DeclareTextCompositeCommand{\c}{T1}{n}{\textcommabelow{n}}
\DeclareTextCompositeCommand{\c}{T1}{R}{\textcommabelow{R}}
\DeclareTextCompositeCommand{\c}{T1}{r}{\textcommabelow{r}}
\DeclareUnicodeCharacter{0122}{\c{G}}
\DeclareUnicodeCharacter{0123}{\c{g}}
\DeclareUnicodeCharacter{0136}{\c{K}}
\DeclareUnicodeCharacter{0137}{\c{k}}
\DeclareUnicodeCharacter{013B}{\c{L}}
\DeclareUnicodeCharacter{013C}{\c{l}}
\DeclareUnicodeCharacter{0145}{\c{N}}
\DeclareUnicodeCharacter{0146}{\c{n}}
\DeclareUnicodeCharacter{0156}{\c{R}}
\DeclareUnicodeCharacter{0157}{\c{r}}
\begin{document}
\c{g} \c{G} ģ Ģ
\c{k} \c{K} ķ Ķ
\c{l} \c{L} ļ Ļ
\c{n} \c{N} ņ Ņ
\c{r} \c{R} ŗ Ŗ
\end{document}
如果你没有最新的 LaTeX 内核(即 2015/01/01 之前的版本),你可能需要添加对 的支持\textcommabelow
;在这种情况下,在 之后添加\makeatletter
,
\@ifundefined{textcommabelow}{%
\DeclareTextCommandDefault\textcommabelow[1]
{\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
\hbox{\check@mathfonts\fontsize\ssf@size\z@
\math@fontsfalse\selectfont,}\hidewidth}\egroup}%
}{}
拉脱维亚语字母表完整示例
元音上的横线可能需要一些改进。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[latvian]{babel}
\makeatletter
\DeclareTextCommandDefault\textcommaabove[1]{%
\hmode@bgroup
\ooalign{%
\hidewidth
\raise.7ex\hbox{%
\check@mathfonts\fontsize\ssf@size\z@\math@fontsfalse\selectfont`%
}%
\hidewidth\crcr
\null#1\crcr
}%
\egroup
}
% for older TeX distributions that don't have \textcommabelow
\@ifundefined{textcommabelow}{%
\DeclareTextCommandDefault\textcommabelow[1]
{\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
\hbox{\check@mathfonts\fontsize\ssf@size\z@
\math@fontsfalse\selectfont,}\hidewidth}\egroup}%
}{}
\makeatother
% (re)declare some text composites
\DeclareTextCompositeCommand{\c}{T1}{G}{\textcommabelow{G}}
\DeclareTextCompositeCommand{\c}{T1}{g}{\textcommaabove{g}}
\DeclareTextCompositeCommand{\c}{T1}{K}{\textcommabelow{K}}
\DeclareTextCompositeCommand{\c}{T1}{k}{\textcommabelow{k}}
\DeclareTextCompositeCommand{\c}{T1}{L}{\textcommabelow{L}}
\DeclareTextCompositeCommand{\c}{T1}{l}{\textcommabelow{l}}
\DeclareTextCompositeCommand{\c}{T1}{N}{\textcommabelow{N}}
\DeclareTextCompositeCommand{\c}{T1}{n}{\textcommabelow{n}}
\DeclareTextCompositeCommand{\c}{T1}{R}{\textcommabelow{R}}
\DeclareTextCompositeCommand{\c}{T1}{r}{\textcommabelow{r}}
% declare some Unicode characters
\DeclareUnicodeCharacter{0100}{\=A}
\DeclareUnicodeCharacter{0101}{\=a}
\DeclareUnicodeCharacter{0112}{\=E}
\DeclareUnicodeCharacter{0113}{\=e}
\DeclareUnicodeCharacter{012A}{\=I}
\DeclareUnicodeCharacter{012B}{\=\i}
\DeclareUnicodeCharacter{016A}{\=U}
\DeclareUnicodeCharacter{016B}{\=u}
\DeclareUnicodeCharacter{0122}{\c{G}}
\DeclareUnicodeCharacter{0123}{\c{g}}
\DeclareUnicodeCharacter{0136}{\c{K}}
\DeclareUnicodeCharacter{0137}{\c{k}}
\DeclareUnicodeCharacter{013B}{\c{L}}
\DeclareUnicodeCharacter{013C}{\c{l}}
\DeclareUnicodeCharacter{0145}{\c{N}}
\DeclareUnicodeCharacter{0146}{\c{n}}
\DeclareUnicodeCharacter{0156}{\c{R}}
\DeclareUnicodeCharacter{0157}{\c{r}}
\begin{document}
Aa, Āā, Bb, Cc, Čč, Dd, Ee, Ēē, Ff, Gg, Ģģ, Hh, Ii, Īī, Jj, Kk, Ķķ,
Ll, Ļļ, Mm, Nn, Ņņ, Oo, Pp, Rr, Ss, Šš, Tt, Uu, Ūū, Vv, Zz, Žž
\end{document}
添加后输出效果会更好\usepackage{lmodern}
:
如果您使用 LuaLaTeX 或 XeLaTeX,您只需要使用支持字形的字体,例如 CMU Serif 或 Linux Libertine。
\documentclass{article}
\usepackage[latvian]{babel}
\usepackage{fontspec}
\setmainfont{CMU Serif}
%\setmainfont{Linux Libertine O}
\begin{document}
\c{g} \c{G} ģ Ģ
\c{k} \c{K} ķ Ķ
\c{l} \c{L} ļ Ļ
\c{n} \c{N} ņ Ņ
\c{r} \c{R} ŗ Ŗ
\end{document}