Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The font I'm using (Adobe Garamond Premier Pro) does have certain precomposed glyphs with diacritics, so I'm having (Xe)LaTeX add them in. I found this post and used the method described there for dealing with the combining dot below diacritic. Now, I'm struggling trying to find the commands for the caron and for the transliterations of the Hebrew characters aleph and ayin.

What I've done is undeclared these in my preamble. Hence:

\UndeclareUTFcomposite[\UTFencname]{x01CE}{\v}{a}
\UndeclareUTFcharacter[\UTFencname]{x02BE}{\texthamza}
\UndeclareUTFcharacter[\UTFencname]{x02BF}{\textain}

Where I'm stuck is finding the proper code to renew the \v, \texthamza, and \textain "commands"(?). (Are the \text* characters even able to be displayed if the font doesn't contain the glyph?)

I need some guidance on where to find the code to these. I've been through the ot1enc.def, t1enc.def, ts1enc.def files without success. Any suggestions on how to implement these glyphs would be appreciated.

PS Sorry if I'm using the terms incorrectly; I'm still a beginner at this.


Okay, with regard to the caron here is what I have thus far:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Garamond Premier Pro}

\UndeclareUTFcomposite[\UTFencname]{x01CE}{\v}{a}
\makeatletter
\renewcommand{\v}[1]
  {\leavevmode \vtop{\offinterlineskip \ialign{##\cr #1\cr
  \setbox0=\hbox{\raise.1ex\hbox{\char"02C7}}\ht0=0pt\dp0=0pt\hidewidth\box0
  \hidewidth\cr}}}
\makeatother

\begin{document}

\huge\v{a}

\end{document}

I'm unsure if the spacing is right, but it looks fine. Any thoughts would be appreciated. Thanks!


Per egreg's guidance with some modification, here is what I have now:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Garamond Premier Pro}
\newfontfamily{\transliterationfont}{Linux Libertine O}

\UndeclareUTFcomposite[\UTFencname]{x1E63}{\d}{s}
\makeatletter
\renewcommand{\d}[1]
  {\hmode@bgroup
  \o@lign{\relax#1\crcr\hidewidth\ltx@sh@ft{-1ex}.\hidewidth}\egroup}
\makeatother

\usepackage{newunicodechar}
\newunicodechar{ǎ}{\accent\string"02C7 a}
\newunicodechar{ʾ}{{\transliterationfont{ʾ}}} % U+02BE
\newunicodechar{ʿ}{{\transliterationfont{ʿ}}} % U+02BF

\begin{document}

\huge\emph{hǎlākāh}
\huge\emph{Baba Me\d{s}iʿa}
\huge\emph{ʾErubin}

\end{document}

I don't suppose there is a way to get around having to do \d to do a combining dot below by using the above method for the caron if the Garamond doesn't have it, correct?

share|improve this question
    
You have to redefine \d only if the font has nothing in the slot U+0323; I presume you have taken the code from this answer –  egreg Jan 15 '12 at 22:17
    
@egreg, yes, I had linked it in the second sentence of my opening post. –  user8934 Jan 15 '12 at 22:53

1 Answer 1

I'd suggest the following strategy

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\newfontfamily{\hebrewfont}{New Peninim MT}

\usepackage{newunicodechar}
\newunicodechar{ǎ}{\accent\string"02C7 a}
\newunicodechar{א}{{\hebrewfont{א}}} % HEBREW LETTER ALEF
\newunicodechar{ע}{{\hebrewfont{ע}}} % HEBREW LETTER AYIN

In other words, you set a font family containing the requested characters and switch to them when the character is missing. For the caron, the primitive \accent should give good results (assuming that the isolated accent is present in the font).

share|improve this answer
    
Thanks, @egreg! This is really helpful. I've made some modification and posted it in an edit above. –  user8934 Jan 15 '12 at 22:10
1  
@JohnDaveMedina If it is helpful, upvote it. ;-) –  lockstep Jan 15 '12 at 22:15
    
@lockstep, thanks for the reminder. I'm still getting used to the system. :-) –  user8934 Jan 15 '12 at 22:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.