Catalan language "ela geminada"

You have several options available.

\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}

The last uses the Unicode characters (and requires UTF-8), the first three work in any input encoding.

enter image description here


Some time ago, one of my university colleagues gave me the following code to use the punt volat (Shift+3 on a spanish keyboard) as an active character. Sometimes I use it but I don't have it on any 'official' style file, then it's easier for me to use "l or \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}

The result is:

enter image description here


An alternative solution, based on the previous one. Redefining directly · is not a good idea (problems with TOC, for example), and the proper way is redefining the LICR object \textperiodcentered. I even consider impossible cases, like l·L. I wrote it long ago and posted to the list es-tex (CervanTeX), and here I just copy and paste it:

\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}