summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/combelow/combelow.tex
blob: e0716f39ef060a1bf1cc4a1e9e351b0f91ccaaa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
\documentclass{ltxdoc}

\usepackage{combelow}
\usepackage{url}
\usepackage{listings}
\lstset{numbers=left,numberstyle=\tiny,basicstyle=\ttfamily,language=[LaTeX]TeX,breaklines}

\begin{document}
\title{The \textsf{combelow} package}
\author{Gianluca Pignalberi\\\texttt{g.pignalberi@freesoftwaremagazine.com}}
\date{02/05/2010~(0.99f)}
\maketitle

\begin{abstract}
Standard \LaTeX{} doesn't have the commands necessary to typeset some
``secondary'' diacritic marks used in some European languages. Romanian and 
Latvian have some letters with a \emph{comma below} (aka comma accent). Up 
to now, \LaTeX{} users approximated it with the \emph{cedilla} (~\c{}~). From
now on they have a proper comma below (~\cb{}~).
\end{abstract}

\section{Introduction}
Once I had to typeset a flyer in Romanian. The flyer text had a word 
containing a `\cb t'. To my big surprise and disappointment, \LaTeX{} 
wasn't able to produce that glyph with a specific command, and I then 
approximated it with a cedilla (after reading chapter 40 of \cite{babel}).
After asking some Romanians, they told me the flyer was ok, but those answers
didn't persuade me: every Romanian newspapers and magazines had a comma below
Ts and Ss, not a cedilla.

I decided to read Unicode books and documents~\cite{Unitables,Ced}, and 
discovered that \c s and \c t are Turkish strokes. Romanian would rather have
the so-called \emph{comma below} (a preferred form for cedilla). I also 
discovered that Latvian has some other letters with a comma below: g, k, l, n
and r. Being `g' a descending letter, its comma below becomes a 
\emph{turned comma above} (\cb g).

I thought that using \textsf{utf8x} encoding would allow me to typeset those 
letters, and their corresponding uppercase versions, once typed with a 
Unicode editor. I was wrong, and a real command was needed.

You can find a more in-depth description of the whole work in~\cite{GP09}.

\section{Usage}
After including the package into your document 
(\verb+\usepackage{combelow}+), you're provided with the command \verb+\cb+
that typesets its argument with the proper comma. Table~\ref{tab:cb}
summarizes commands and results.

\begin{table}
\centering
\begin{tabular}{cc}
Command&Result\\
\verb+\cb g+&\cb g\\
\verb+\cb k+&\cb k\\
\verb+\cb l+&\cb l\\
\verb+\cb n+&\cb n\\
\verb+\cb r+&\cb r\\
\verb+\cb s+&\cb s\\
\verb+\cb t+&\cb t\\
\end{tabular}
\caption{Examples of comma below-ed letters}
\label{tab:cb}
\end{table}

\section{Properties and known issues}
A lot of Romanian printed matter show comma below-ed letters with a comma
below slightly smaller than the actual font size. The package isn't able yet
to manage a comma below less than the current font size.

If you want to put the comma accent below a two or more bytes Unicode 
character, you have to surround it with braces, just as you would do with 
other standard accents.

The biggest drawback is that the package doesn't allow hyphenation and loses
kerning information too.

\section{The code}
\begin{lstlisting}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{combelow}[2010/05/02 v0.99f comma below command]
\def\@commafont{\check@mathfonts
    \fontsize\sf@size\z@\selectfont}
\DeclareRobustCommand{\cb}[1]{{%
\setbox\z@\hbox{#1}%
\ifdim\dp\z@<.1\ht\z@\ooalign{\unhbox\z@\crcr\hidewidth\lower.3ex\hbox{\@commafont,}\hidewidth}%
\else\ooalign{\unhbox\z@\crcr\hidewidth\raise.5ex\hbox{\@commafont`}\hidewidth}%
\fi}}%
\endinput
\end{lstlisting}
That's all: it stacks a comma (typeset in a smaller font) under a character 
without descendant (with no depth), while stacks an open single quote over a 
descending character (with a significant depth, since some Times fonts have no
descendant, while being deeper than 0).

\bibliographystyle{plain}
\bibliography{combelow}

\appendix
\section{Changes}
\textbf{2009/04/21} \textbf{v0.1} 

\vspace{.5em}
\noindent
\begin{itemize}
\item Initial version, not released. Could only typeset g, k, l, n, r, s 
and t with comma below, and the corresponding uppercase letters.
\end{itemize}

\vspace{.5em}
\noindent
\textbf{2009/04/30} \textbf{v0.2}

\vspace{.5em}
\noindent
\begin{itemize}
\item Not released. Could typeset every not descending letters with comma 
below, but only g among descending letters.
\end{itemize}

\vspace{.5em}
\noindent
\textbf{2009/08/23} \textbf{v0.99a, b, c, d}

\vspace{.5em}
\noindent
\begin{itemize}
\item Can typeset all letters with comma below, recognizing descendents and
positioning the comma according to them (wrong turned comma above for italics 
and slanted characters in 0.99a; wrong vertical position in 0.99c). Since all 
of these versions are contemporary, I've just released 0.99d.
\end{itemize}

\vspace{.5em}
\noindent
\textbf{2009/10/19} \textbf{v0.99d bug fix}

\begin{itemize}
\item Fixed a problem with fonts like Times. Thanks to Enrico Gregorio.
\end{itemize}

\vspace{.5em}
\noindent
\textbf{2009/11/10} \textbf{v0.99e}

\begin{itemize}
\item Now the comma is finally smaller than the current font. Thanks to Enrico 
Gregorio for providing me with the necessary code.
\end{itemize}

\vspace{.5em}
\noindent
\textbf{2010/05/02} \textbf{v0.99f}

\begin{itemize}
\item Constantin Gubceac (Gub\v{c}ek) sent me a lot of scanned samples of
Romanian books, so that I could realize how close the comma has to be to the
corresponding letters. Thanks to his help this newer version puts the comma
closer.
\end{itemize}
\end{document}