[comp.text.tex] How to substitute for a ligature?

ecogk@lure.latrobe.edu.au (Gabor Korosi) (05/03/91)

Hi Gurus,

I am Hungarian, and Hungarian is full of accented letters, so I jumped at
the dx fonts of Norbert Schwarz as soon as I could. It is great (the only
problem that the capital Greek letters were discarded, so I still need the
cm fonts, just for them), but I am struck with the following problem:

Hungarian, like many other European languages (the only exception on the
continent I am aware of is French) uses the right English double quote 
shifted down to the baseline as left double quote. (That is ,,example'' 
instead of ``example''.) This is the "12 character in dx fonts. Is there 
any way to force TeX to use this character for the ligature `` rather than
the English default? The current solution I use is: 

%
%  Hungarian left double quote
%
\catcode`=\active
\def`{\futurelet\next\lqtest}
\def\lqtest{\ifx\next`\let\next\hunlqq \else\let\next\lq \fi\next}
\def\hunlqq#1{\hlqq}
\chardef\hlqq="12

and it works, but there must be a much simpler one. (Well, the \hunlqq 
could be cut out, but that is not my problem.)

Any idea? 

G\'abor K\H or\"osi

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (05/04/91)

ecogk@lure.latrobe.edu.au (Gabor Korosi) writes:

>Hi Gurus,

Hi there :-)

>Hungarian, like many other European languages (the only exception on the
>continent I am aware of is French) uses the right English double quote 
>shifted down to the baseline as left double quote. (That is ,,example'' 
>instead of ``example''.) This is the "12 character in dx fonts. Is there 
>any way to force TeX to use this character for the ligature `` rather than
>the English default?

Yes. Unfortunately you have to go outside TeX.
I suggest you dive into the tfm format and find out
how ligatures work. Use the 'tftopl' program to convert
a .tfm file to a .pl file, which is readable.
Then edit that, and translate back with 'pltotf'.

As an example, here is a fragment from cmr10.pl,
describing the ligatures of 'f' followed by 'i', 'f',
and 'l'.

(LIGTABLE
   (LABEL C f)
   (LIG C i O 14)
   (LIG C f O 13)
   (LIG C l O 15)

You see how 'fi' gets replaced by 'octal 14' et cetera.

Happy hacking!

Victor.

ecogk@lure.latrobe.edu.au (Gabor Korosi) (05/04/91)

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) answers to my question:
> 
>>      uses the right English double quote 
>>shifted down to the baseline as left double quote. (That is ,,example'' 
>>instead of ``example''.) This is the "12 character in dx fonts. Is there 
>>any way to force TeX to use this character for the ligature `` rather than
>>the English default?
> 
> Yes. Unfortunately you have to go outside TeX.
  ... The solution via .pl files deleted.

I am sorry, I failed to add that I want to keep the English double quote as
well. Half the text I write is in English, half is in Hungarian. I occasionally
happen to write in French as well. (They use the << >> ligatures for `` '',
which are also available in dx fonts.)  

>  
> Happy hacking!

Not like that, thanks. I prefer to have a flexible solution which I can switch
along with the \language (ie, hyphenation table), rather than hard-wiring. 
Just I hoped for a better solution than the one I presented.
> 
> Victor.

G\'abor

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (05/05/91)

ecogk@lure.latrobe.edu.au (Gabor Korosi) writes:

>eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) answers to my question:
>> 
>>>      uses the right English double quote 
>>>shifted down to the baseline as left double quote. (That is ,,example'' 
>>>instead of ``example''.) This is the "12 character in dx fonts. Is there 
>>>any way to force TeX to use this character for the ligature `` rather than
>>>the English default?
>> 
>> Yes. Unfortunately you have to go outside TeX.
>  ... The solution via .pl files deleted.

>I am sorry, I failed to add that I want to keep the English double quote as
>well. Half the text I write is in English, half is in Hungarian. I occasionally
>happen to write in French as well. (They use the << >> ligatures for `` '',
>which are also available in dx fonts.)  

Another suggestion: why do you want to use the `` ligature?
Why don't you define ,, as a ligature that will give you the
correct character? And for French << and >> ?? I mean: ?

Victor.

Damian.Cugley@prg.ox.ac.uk (Damian Cugley) (05/07/91)

> From:		Gabor Korosi <ecogk@lure.latrobe.edu.au>
> Message-Id:	<1991May3.211126.5326@lure.latrobe.edu.au>

> Hungarian uses the right English double quote shifted down to the
> baseline as left double quote. (That is ,,example'' instead of
> ``example''.) This is the "12 character in dx fonts. Is there any way
> to force TeX to use this character for the ligature `` rather than the
> English default?

It ought to be possible to have two commas (,,) meaning a double comma
just as '' is a double apostrophe.  (If it isn't already it ought to be.)

Also, so far as I am aware(*), when this style of quotation is used, the
right quote is usually two inverted commas: ,,example`` as opposed to
,,example''.

Damian 
------------------------------ 

(*) Hart's Rules for Compositors and Readers, 39th ed., p.110. (Oxford
    University Press, 1990)