Turkish characters to small caps
This is quite a big problem. :(
The lower case letter i
in small caps has no dot and changing it to produce a dotted i is bound to bigger problems than it would solve.
The real solution would be a proper Turkish font, where i
always has a dot.
In your case I propose a workaround: add to the preamble
\providecommand*\UndeclareTextComposite[3]{%
\expandafter\let\csname\expandafter\string\csname
#2\endcsname\string#1-#3\endcsname\relax}
\UndeclareTextComposite{\.}{T1}{i}
\makeatletter
\DeclareTextCompositeCommand{\.}{T1}{i}{%
\ifx\f@shape\scdefault\accent10i\else i\fi}
\makeatother
and input your dotted i's in small caps as
\textsc{ı and \.i. just like I and İ}
Writing \.i
in normal text should cause no big harm.
Note that \sc
is deprecated and would be used as {\sc ...}
not \sc{...}
I use \textsc
below.
I think the easiest thing to do is remove the magic association of \.\i
with i
so that it always uses a dot accent.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[turkish]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=3.50cm, right=2.50cm, top=3.00cm, bottom=3.00cm]{geometry}
\addto\extrasturkish{\uccode`i=\string"9D \lccode`I=\string"19 }
\addto\noextrasturkish{\uccode`i=`I \lccode`I=`i }
\begin{document}
\expandafter\let\csname\string\T1\string\.-\string\i\endcsname\relax
\shorthandoff{=}
\textsc{ı and \.\i. just like I and İ}
\textrm{ı and \.\i. just like I and İ}
\end{document}
In the following, I will try to give an example that attempts to solve the problem by using lualatex
. As commented above, the use of an open type font that was properly designed solves the problem almost immediately. Unfortunately, there are a quite large number of fonts that need tweaking to get them to produce a small caps dotted i. Here, I will use four different fonts—Minion Pro, Scala Pro, TeX Gyre Termes and Latin Modern. The first two are commercial fonts whereas the last two can be downloaded from http://www.gust.org.pl/projects/e-foundry.
The end result looks like the following.
I will now explain what I did for each line in the table above.
1) Minion Pro has been through quite a number of updates. Recent versions have the correct settings for Turkish in the lookup tables. Here you can see that
version 2.012 created 2004/06/29
Edited 'smcp' feature to remove a redundant i->i.sc substitution which was interfering with Turkish substitution i->idotaccent.sc.
version 2.030 created 2007/08/16
Added glyph "i.dot" as duplicate of glyph "i". Added substitution to 'locl' feature to substitute "i.dot" from "i" in certain languages (e.g. Turkish).
The font works out of the box. No fiddling is necessary.
2-3) Scala Pro seems to work out of the box. However, due to the ambiguities it creates, the fi ligature is not applied when the language is Turkish. Unfortunately, the kerning is too close between the f-i pair for my taste. Even though not specifically asked in the question, I provide an example feature file that adds some space to fix the kerning.
4-5) TeX Gyre Termes has a glyph called idotaccent.sc
but there is no reference to it in the font's lookup tables. The feature file below fixes the problem, albeit in a brute force way. There is probably a much more elegant solution than the one illustrated: I used the Font Forge program to extract the feature file of the font (Font Forge->Element Menu->Font Info->Click on lookups->Right click on the table->Save feature file)
, copied the relevant lookup table used in small caps conversion, modified the lookup info for the Turkish language in a new feature named sctr
(small caps turkish) and activated the feature.
6-7) Latin Modern does not have the dotted i in small caps. This time I took the dotless i small caps, added a dot accent to it (uni0307)
and roughly fixed the kerning. I again created a new feature named sctr
, and activated it.
There are probably ways to directly modify the rules used in smcp lookup tables, but I was not able to do it using feature files. No matter what I do, the predefined substitutions in smcp rules seem to override the changes I instruct. As a result, the only remedy I could find was to create a new feature to do the hacks.
For more information on feature files please see the file syntax page. Furthermore, the following pages have long discussions on how feature files should be defined for dottless i small caps, and various ligatures for Turkish: page 1, page 2, page 3.
Here is the code that generates the table above:
% !TeX program = lualatex
% !TeX spellcheck = tr
\documentclass[12pt,oneside,a4paper]{article}
\pagestyle{empty}
\usepackage[no-math]{fontspec}
\usepackage[turkish]{babel}
\defaultfontfeatures{Ligatures=TeX, Language=Turkish}
\setmainfont[SmallCapsFont={Latin Modern Roman Caps}]{Latin Modern Roman}
\newfontfamily\scalaKern[FeatureFile={scala.fea}]{Scala Pro}
\newfontface\termesSC[FeatureFile={termes.fea},RawFeature={+sctr}]{TeX Gyre Termes}
\newfontfamily\lmSC[SmallCapsFont={Latin Modern Roman Caps}, SmallCapsFeatures={FeatureFile={lm.fea},RawFeature={+sctr}}]{Latin Modern Roman}
\newcommand{\test}{fizik}
\newcommand{\TEST}{FİZİK}
\begin{document}
\begin{tabular}{rllll}
&Font & Regular & Small Caps & All Caps \\
1) &Minion Pro v2.030 & {\fontspec{Minion Pro}\test} & {\fontspec{Minion Pro} \textsc{\test}} & {\fontspec{Minion Pro} \TEST} \\
2) &Scala Pro & {\fontspec{Scala Pro} \test} & {\fontspec{Scala Pro} \textsc{\test}} & {\fontspec{Scala Pro} \TEST}\\
3) &Scala Pro (scala.fea) & {\scalaKern \test} & &\\
4) &TeX Gyre Termes v2.004& {\fontspec{TeX Gyre Termes} \test} & {\fontspec{TeX Gyre Termes} \textsc{\test}} & {\fontspec{TeX Gyre Termes} \TEST}\\
5) &TeX Gyre Termes (termes.fea) & & {\termesSC \test} & \\
6) &Latin Modern v2.004 & {\test} & {\textsc{\test}} & {\TEST} \\
7) &Latin Modern (lm.fea) & & {\lmSC \textsc{\test}} & \\
\end{tabular}
\end{document}
scala.fea contents
feature kern {
language TRK;
pos \f \i.latn_TRK 40;
} kern;
termes.fea contents
lookup smcpLowercasetoSmallCapitalsloo {
lookupflag 0;
sub \a by \a.sc ;
sub \b by \b.sc ;
sub \c by \c.sc ;
sub \d by \d.sc ;
sub \e by \e.sc ;
sub \f by \f.sc ;
sub \g by \g.sc ;
sub \h by \h.sc ;
# sub \i by \i.sc ;
sub \j by \j.sc ;
sub \k by \k.sc ;
sub \l by \l.sc ;
sub \m by \m.sc ;
sub \n by \n.sc ;
sub \o by \o.sc ;
sub \p by \p.sc ;
sub \q by \q.sc ;
sub \r by \r.sc ;
sub \s by \s.sc ;
sub \t by \t.sc ;
sub \u by \u.sc ;
sub \v by \v.sc ;
sub \w by \w.sc ;
sub \x by \x.sc ;
sub \y by \y.sc ;
sub \z by \z.sc ;
sub \aacute by \aacute.sc ;
sub \abreve by \abreve.sc ;
sub \abreveacute by \abreveacute.sc ;
sub \abrevedotbelow by \abrevedotbelow.sc ;
sub \abrevegrave by \abrevegrave.sc ;
sub \abrevehookabove by \abrevehookabove.sc ;
sub \abrevetilde by \abrevetilde.sc ;
sub \acircumflex by \acircumflex.sc ;
sub \acircumflexacute by \acircumflexacute.sc ;
sub \acircumflexdotbelow by \acircumflexdotbelow.sc ;
sub \acircumflexgrave by \acircumflexgrave.sc ;
sub \acircumflexhookabove by \acircumflexhookabove.sc ;
sub \acircumflextilde by \acircumflextilde.sc ;
sub \adblgrave by \adblgrave.sc ;
sub \adieresis by \adieresis.sc ;
sub \adotbelow by \adotbelow.sc ;
sub \ae by \ae.sc ;
sub \aeacute by \aeacute.sc ;
sub \agrave by \agrave.sc ;
sub \ahookabove by \ahookabove.sc ;
sub \amacron by \amacron.sc ;
sub \aogonek by \aogonek.sc ;
sub \aring by \aring.sc ;
sub \aringacute by \aringacute.sc ;
sub \atilde by \atilde.sc ;
sub \cacute by \cacute.sc ;
sub \ccaron by \ccaron.sc ;
sub \ccedilla by \ccedilla.sc ;
sub \ccircumflex by \ccircumflex.sc ;
sub \cdotaccent by \cdotaccent.sc ;
sub \dcaron by \dcaron.sc ;
sub \dcroat by \dcroat.sc ;
sub \ddotbelow by \ddotbelow.sc ;
sub \dlinebelow by \dlinebelow.sc ;
sub \eacute by \eacute.sc ;
sub \ebreve by \ebreve.sc ;
sub \ecaron by \ecaron.sc ;
sub \ecircumflex by \ecircumflex.sc ;
sub \ecircumflexacute by \ecircumflexacute.sc ;
sub \ecircumflexdotbelow by \ecircumflexdotbelow.sc ;
sub \ecircumflexgrave by \ecircumflexgrave.sc ;
sub \ecircumflexhookabove by \ecircumflexhookabove.sc ;
sub \ecircumflextilde by \ecircumflextilde.sc ;
sub \edblgrave by \edblgrave.sc ;
sub \edieresis by \edieresis.sc ;
sub \edotaccent by \edotaccent.sc ;
sub \edotbelow by \edotbelow.sc ;
sub \egrave by \egrave.sc ;
sub \ehookabove by \ehookabove.sc ;
sub \emacron by \emacron.sc ;
sub \eng by \eng.sc ;
sub \eogonek by \eogonek.sc ;
sub \ereversed by \ereversed.sc ;
sub \eth by \eth.sc ;
sub \etilde by \etilde.sc ;
sub \gacute by \gacute.sc ;
sub \gbreve by \gbreve.sc ;
sub \gcaron by \gcaron.sc ;
sub \gcircumflex by \gcircumflex.sc ;
sub \gcommaaccent by \gcommaaccent.sc ;
sub \gdotaccent by \gdotaccent.sc ;
sub \germandbls by \germandbls.sc ;
sub \hbar by \hbar.sc ;
sub \hbrevebelow by \hbrevebelow.sc ;
sub \hcircumflex by \hcircumflex.sc ;
sub \hdieresis by \hdieresis.sc ;
sub \hdotbelow by \hdotbelow.sc ;
sub \iacute by \iacute.sc ;
sub \ibreve by \ibreve.sc ;
sub \icircumflex by \icircumflex.sc ;
sub \idblgrave by \idblgrave.sc ;
sub \idieresis by \idieresis.sc ;
sub \idotbelow by \idotbelow.sc ;
sub \igrave by \igrave.sc ;
sub \ihookabove by \ihookabove.sc ;
sub \i_j by \i_j.sc ;
sub \imacron by \imacron.sc ;
sub \iogonek by \iogonek.sc ;
sub \itilde by \itilde.sc ;
sub \jcircumflex by \jcircumflex.sc ;
sub \kcommaaccent by \kcommaaccent.sc ;
sub \lacute by \lacute.sc ;
sub \lcaron by \lcaron.sc ;
sub \lcommaaccent by \lcommaaccent.sc ;
sub \ldot by \ldot.sc ;
sub \ldotbelow by \ldotbelow.sc ;
sub \ldotbelowmacron by \ldotbelowmacron.sc ;
sub \lslash by \lslash.sc ;
sub \mdotbelow by \mdotbelow.sc ;
sub \nacute by \nacute.sc ;
sub \ncaron by \ncaron.sc ;
sub \ncommaaccent by \ncommaaccent.sc ;
sub \ndotaccent by \ndotaccent.sc ;
sub \ndotbelow by \ndotbelow.sc ;
sub \ntilde by \ntilde.sc ;
sub \oacute by \oacute.sc ;
sub \obreve by \obreve.sc ;
sub \ocircumflex by \ocircumflex.sc ;
sub \ocircumflexacute by \ocircumflexacute.sc ;
sub \ocircumflexdotbelow by \ocircumflexdotbelow.sc ;
sub \ocircumflexgrave by \ocircumflexgrave.sc ;
sub \ocircumflexhookabove by \ocircumflexhookabove.sc ;
sub \ocircumflextilde by \ocircumflextilde.sc ;
sub \odblgrave by \odblgrave.sc ;
sub \odieresis by \odieresis.sc ;
sub \odotbelow by \odotbelow.sc ;
sub \oe by \oe.sc ;
sub \ograve by \ograve.sc ;
sub \ohookabove by \ohookabove.sc ;
sub \ohorn by \ohorn.sc ;
sub \ohornacute by \ohornacute.sc ;
sub \ohorndotbelow by \ohorndotbelow.sc ;
sub \ohorngrave by \ohorngrave.sc ;
sub \ohornhookabove by \ohornhookabove.sc ;
sub \ohorntilde by \ohorntilde.sc ;
sub \ohungarumlaut by \ohungarumlaut.sc ;
sub \omacron by \omacron.sc ;
sub \oogonek by \oogonek.sc ;
sub \oslash by \oslash.sc ;
sub \oslashacute by \oslashacute.sc ;
sub \otilde by \otilde.sc ;
sub \racute by \racute.sc ;
sub \rcaron by \rcaron.sc ;
sub \rcommaaccent by \rcommaaccent.sc ;
sub \rdblgrave by \rdblgrave.sc ;
sub \rdotaccent by \rdotaccent.sc ;
sub \rdotbelow by \rdotbelow.sc ;
sub \rdotbelowmacron by \rdotbelowmacron.sc ;
sub \sacute by \sacute.sc ;
sub \scaron by \scaron.sc ;
sub \scedilla by \scedilla.sc ;
sub \scircumflex by \scircumflex.sc ;
sub \uni0219 by \uni0219.sc ;
sub \sdotbelow by \sdotbelow.sc ;
sub \tcaron by \tcaron.sc ;
sub \tcedilla by \tcedilla.sc ;
sub \uni021B by \uni021B.sc ;
sub \tdieresis by \tdieresis.sc ;
sub \tdotbelow by \tdotbelow.sc ;
sub \thorn by \thorn.sc ;
sub \tlinebelow by \tlinebelow.sc ;
sub \uacute by \uacute.sc ;
sub \ubreve by \ubreve.sc ;
sub \ucircumflex by \ucircumflex.sc ;
sub \udblgrave by \udblgrave.sc ;
sub \udieresis by \udieresis.sc ;
sub \udotbelow by \udotbelow.sc ;
sub \ugrave by \ugrave.sc ;
sub \uhookabove by \uhookabove.sc ;
sub \uhorn by \uhorn.sc ;
sub \uhornacute by \uhornacute.sc ;
sub \uhorndotbelow by \uhorndotbelow.sc ;
sub \uhorngrave by \uhorngrave.sc ;
sub \uhornhookabove by \uhornhookabove.sc ;
sub \uhorntilde by \uhorntilde.sc ;
sub \uhungarumlaut by \uhungarumlaut.sc ;
sub \umacron by \umacron.sc ;
sub \uogonek by \uogonek.sc ;
sub \uring by \uring.sc ;
sub \utilde by \utilde.sc ;
sub \wacute by \wacute.sc ;
sub \wcircumflex by \wcircumflex.sc ;
sub \wdieresis by \wdieresis.sc ;
sub \wgrave by \wgrave.sc ;
sub \yacute by \yacute.sc ;
sub \ycircumflex by \ycircumflex.sc ;
sub \ydieresis by \ydieresis.sc ;
sub \ydotbelow by \ydotbelow.sc ;
sub \ygrave by \ygrave.sc ;
sub \yhookabove by \yhookabove.sc ;
sub \ytilde by \ytilde.sc ;
sub \zacute by \zacute.sc ;
sub \zcaron by \zcaron.sc ;
sub \zdotaccent by \zdotaccent.sc ;
sub \zdotbelow by \zdotbelow.sc ;
sub \aogonekacute by \aogonekacute.sc ;
sub \eogonekacute by \eogonekacute.sc ;
sub \iogonekacute by \iogonekacute.sc ;
sub \jacute by \jacute.sc ;
sub \oogonekacute by \oogonekacute.sc ;
sub \u_uni032F by \ubrevebelowinverted.sc ;
sub \h_uni0303 by \h_uni0303.sc ;
sub \imacron.alt by \imacron.alt.sc ;
sub \l_uni0303 by \l_uni0303.sc ;
sub \t_uni0303 by \t_uni0303.sc ;
} smcpLowercasetoSmallCapitalsloo;
feature sctr {
language TRK;
sub i by idotaccent.sc;
lookup smcpLowercasetoSmallCapitalsloo;
} sctr;
lm.fea contents
feature sctr {
language TRK;
sub i by \i \uni0307;
} sctr;
feature kern {
language TRK;
position \uni0307 <150 0 0 0>;
} kern;