我的文档的语言设置为加泰罗尼亚语babel
。加泰罗尼亚语字母表包含一个字母,称为埃拉杰米纳达l
,用标点符号分隔两个小写字母·
(例如“cel·la”或“pel·lícula”)。更多信息请访问http://en.wikipedia.org/wiki/Interpunct#Catalan)。
我想l·l
从键盘输入,而不是书写,这是模式中包\lgem
给出的命令。但是,当我输入时,间距太大,我希望它看起来像原始命令的输出。babel
catalan
l·l
一张图来澄清这一点:
答案1
前段时间,我的一位大学同事给了我以下代码来使用波动的点(Shift+3
在西班牙语键盘上)作为活动字符。有时我会使用它,但我没有在任何“官方”样式文件中使用它,这样我就可以更轻松地使用"l
或\lgem{}
。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[catalan]{babel}
\usepackage{lmodern}
%Definició de la ela geminada per tal que accepti el punt volat del teclat
\def·#1{%
\ifmmode
\cdot #1
%\csname normal@char\string"\endcsname l%
\else%
\def\argument{#1}%
\if\argument l%
\leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
\setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
\advance\raiselldim by \the\fontdimen5\the\font
\advance\raiselldim by -\ht2%
\leftllkern=-.25\wd0%
\advance\leftllkern by \wd1%
\advance\leftllkern by -\wd0%
\rightllkern=-.25\wd0%
\advance\rightllkern by -\wd1%
\advance\rightllkern by \wd0%
\allowhyphens\discretionary{-}{l}%
{\hbox{}\kern\leftllkern\raise\raiselldim\hbox{.}%
\kern\rightllkern\hbox{l}}\allowhyphens%
\else
\if\argument L%
\leftllkern=0pt\rightllkern=0pt\raiselldim=0pt%
\setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
\advance\raiselldim by .5\ht0%
\advance\raiselldim by -.5\ht2%
\leftllkern=-.125\wd0%
\advance\leftllkern by \wd1%
\advance\leftllkern by -\wd0%
\rightllkern=-\wd0%
\divide\rightllkern by 6%
\advance\rightllkern by -\wd1%
\advance\rightllkern by \wd0%
\allowhyphens\discretionary{-}{L}%
{\hbox{}\kern\leftllkern\raise\raiselldim\hbox{.}%
\kern\rightllkern\hbox{L}}\allowhyphens%
\else
#1
\fi
\fi
\fi
}
\begin{document}
cel·la
CEL·LA
\end{document}
结果是:
答案2
您有多种选择。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[catalan]{babel}
\usepackage{newunicodechar}
\newunicodechar{Ŀ}{\L.}
\newunicodechar{ŀ}{\l.}
\begin{document}
CE\Lgem A -- ce\lgem a
CE\L.LA -- ce\l.la
CE"LA -- ce"la
CEĿLA -- ceŀla
\end{document}
最后使用 Unicode 字符(并需要 UTF-8),前三个可以在任何输入编码下工作。
答案3
基于前一个解决方案的替代解决方案。直接重新定义 · 不是一个好主意(例如,TOC 存在问题),正确的方法是重新定义 LICR 对象\textperiodcentered
。我甚至考虑了不可能的情况,例如 l·L。我很久以前就写好了,并发布到列表 es-tex(CervanTeX),在这里我只是复制并粘贴它:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[catalan]{babel}
\def\xgem{%
\ifmmode
\csname normal@char\string"\endcsname l%
\else
\leftllkern=0pt\rightllkern=0pt\raiselldim=0pt
\setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{.}%
\advance\raiselldim by \the\fontdimen5\the\font
\advance\raiselldim by -\ht2
\leftllkern=-.25\wd0%
\advance\leftllkern by \wd1
\advance\leftllkern by -\wd0
\rightllkern=-.25\wd0%
\advance\rightllkern by -\wd1
\advance\rightllkern by \wd0
\allowhyphens\discretionary{-}{}%
{\kern\leftllkern\raise\raiselldim\hbox{.}%
\kern\rightllkern}\allowhyphens
\fi
}
\def\Xgem{%
\ifmmode
\csname normal@char\string"\endcsname L%
\else
\leftllkern=0pt\rightllkern=0pt\raiselldim=0pt
\setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{.}%
\advance\raiselldim by .5\ht0
\advance\raiselldim by -.5\ht2
\leftllkern=-.125\wd0%
\advance\leftllkern by \wd1
\advance\leftllkern by -\wd0
\rightllkern=-\wd0%
\divide\rightllkern by 6
\advance\rightllkern by -\wd1
\advance\rightllkern by \wd0
\allowhyphens\discretionary{-}{}%
{\kern\leftllkern\raise\raiselldim\hbox{.}%
\kern\rightllkern}\allowhyphens
\fi
}
\newbox\LL\hbox{l·l L·l l·L L·L}
% No lo uso, pero es como podría guardarse el valor
% anterior:
\expandafter\let\expandafter\saveperiodcentered
\csname T1\string\textperiodcentered \endcsname
% Y aquí está el quid. No hago nada con el argumento, pero
% se podría usar para, por ejemplo, considerar los 4 casos
% por separado:
\DeclareTextCommand{\textperiodcentered}{T1}[1]{%
\ifnum\spacefactor=998
\Xgem
\else
\xgem
\fi#1}
\begin{document}
Por defecto:
\leavevmode\box\LL
\sfcode`L=998
Corregido:
l·l L·l l·L L·L
\end{document}
答案4
使用最后的回复我认为最好的版本是这个(因为它改进了 babel-catalan 的问题,即使用“.”而不是“·”,读者可以在文本中使用 CTRL+F 来实现这一点,例如):
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{newunicodechar}
\newunicodechar{Ŀ}{L·}
\newunicodechar{ŀ}{l·}
usepackage[catalan]{babel}
\renewcommand{\lgem}{l·l}
\renewcommand{\Lgem}{L·L}
\def\xgem{%
\ifmmode
\csname normal@char\string"\endcsname l%
\else
\leftllkern=0pt\rightllkern=0pt\raiselldim=0.15em
\setbox0\hbox{l}\setbox1\hbox{l\/}\setbox2\hbox{$\cdot$}%
\advance\raiselldim by \the\fontdimen5\the\font
\advance\raiselldim by -\ht2
\leftllkern=-.25\wd0%
\advance\leftllkern by \wd1
\advance\leftllkern by -\wd0
\rightllkern=-.25\wd0%
\advance\rightllkern by -\wd1
\advance\rightllkern by \wd0
\allowhyphens\discretionary{-}{}%
{\kern\leftllkern\raise\raiselldim\hbox{$\cdot$}%
\kern\rightllkern}\allowhyphens
\fi
}
\def\Xgem{%
\ifmmode
\csname normal@char\string"\endcsname L%
\else
\leftllkern=0pt\rightllkern=0pt\raiselldim=0pt
\setbox0\hbox{L}\setbox1\hbox{L\/}\setbox2\hbox{$\cdot$}%
\advance\raiselldim by .5\ht0
\advance\raiselldim by -.5\ht2
\leftllkern=-.125\wd0%
\advance\leftllkern by \wd1
\advance\leftllkern by -\wd0
\rightllkern=-\wd0%
\divide\rightllkern by 6
\advance\rightllkern by -\wd1
\advance\rightllkern by \wd0
\allowhyphens\discretionary{-}{}%
{\kern\leftllkern\raise\raiselldim\hbox{$\cdot$}%
\kern\rightllkern}\allowhyphens
\fi
}
\DeclareTextCommand{\textperiodcentered}{T1}[1]{%
\ifnum\spacefactor=998
\Xgem
\else
\xgem
\fi#1}
\begin{document}
Novel·la
Noveŀla
Nove"la
Nove\lgem a
Nove\l.la
\end{document}