home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / text / tex / 10359 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  4.6 KB

  1. Path: sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!aun.uninett.no!nuug!nntp.uio.no!hfmac15.uio.no!user
  2. From: olems@ulrik.uio.no (Ole Michael Selberg)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: german quotation marks in TeX ?
  5. Message-ID: <olems-200892122110@hfmac15.uio.no>
  6. Date: 20 Aug 92 11:21:05 GMT
  7. References: <451@muller.loria.fr>
  8. Sender: news@ulrik.uio.no (Mr News)
  9. Followup-To: comp.text.tex
  10. Organization: Oslo University
  11. Lines: 110
  12. Nntp-Posting-Host: hfmac15.uio.no
  13.  
  14. In article <451@muller.loria.fr>, roegel@loria.fr (Roegel Denis) wrote:
  15. > Hi all,
  16. > This is a very easy question. I would like to typeset the german quotation
  17. > marks, the first beeing left down, the last up and right. 
  18. >  
  19. > It looks something like         
  20. >                            Hallo"
  21. >                           "
  22. > I could of course use " and lower it to get the left mark, but I wonder if
  23. > this has already been defined, especialley by german TeXnicians. All what I 
  24. > found was to use `` and '' within the Fraktur font defined by Haramboulis.
  25. > Is there a better solution ?
  26.  
  27. % You can obtain ,, with the following definition:
  28.  
  29. \def\anf{\leavevmode\setbox0=\hbox{\lower1.38ex\hbox{''}}\ht0=0pt % 
  30.    \dp0=0pt \box0}
  31.  
  32. % You may want to do some additional kerning, since the 
  33. % supposes `` to be an opening quote (Anfuehrungszeichen) and '' a closing
  34. % quote (Abfuehrungszeichen), whereas in German it's the other way around.
  35. % This makes the spacing slightly wrong (it's almost imperceptible,
  36. though!).
  37.  
  38. % Personally, I think you'd get a better result using guillemets
  39. % (i.e. >>Hallo<< instead of ,,Hallo```).
  40. % These are the macros I've written myself to be able to combine
  41. % PS guillmets, taken from Times, with Computer Modern Roman
  42. % (\ti is TimesItalic, \tb -- TimesBold etc, which are supposed to be
  43. defined 
  44. % by \font in the usual way; \ab yields `<<', \as yields `>>', \hab yields
  45. `<'
  46. % /initial half quote/, \has yields `>' /final half quote/):
  47. %%
  48. %% Guillemet definitions:
  49. %%
  50.   \def\ab{\leavevmode\ifnum\fam=\itfam\abit\else%
  51.        \ifnum\fam=\bffam\abbf\else\ifnum\fam=\slfam\absl\else%
  52.                \abrm\fi\fi\fi}%
  53.            \def\abit{{\ti\char171}\kern-0.1em}%  
  54.            \def\absl{{\ts\lower0.05em\hbox{\char171}}}%
  55.            \def\abbf{{\tb\char171}}%
  56.            \def\abrm{{\tr\lower0.05em\hbox{\char171}}}%
  57.   \def\as{\leavevmode\ifnum\fam=\itfam\asit\else%
  58.        \ifnum\fam=\bffam\asbf\else\ifnum\fam=\slfam\assl\else%     
  59.                \asrm\fi\fi\fi}%
  60.            \def\asit{{\ti\char187}}%
  61.            \def\assl{{\ts\lower0.05em\hbox{\char187}}}%  
  62.            \def\asbf{{\tb\char187}}%
  63.            \def\asrm{{\tr\lower0.05em\hbox{\char187}}}%
  64.   \def\hab{\leavevmode\ifnum\fam=\itfam\habit\else%
  65.        \ifnum\fam=\bffam\habbf\else\ifnum\fam=\slfam\habsl\else%
  66.               \habrm\fi\fi\fi}%
  67.            \def\habit{{\ti\char172}}%  
  68.            \def\habsl{{\ts\char172}}%
  69.            \def\habbf{{\tb\char172}}%
  70.            \def\habrm{{\tr\char172}}%
  71.    \def\has{\leavevmode\ifnum\fam=\itfam\hasit\else%
  72.        \ifnum\fam=\bffam\hasbf\else\ifnum\fam=\slfam\hassl\else
  73.               \hasrm\fi\fi\fi}
  74.            \def\hasit{{\ti\char173}}%
  75.            \def\hassl{{\ts\char173}}%  
  76.            \def\hasbf{{\tb\char173}}%
  77.            \def\hasrm{{\tr\char173}}%
  78.            
  79. % To simplify my work, I make " and * active, so that I can
  80. % input: 
  81. %           Han sa: "Jeg har avbestilt *Aftenposten*." 
  82. % and have it apprear like this in my output:
  83. %           Han sa: <<Jeg har avbestilt <Aftenposten>.>>
  84. % For this, I use the following macros:
  85.  
  86. %%
  87. %% Definitions for simplified input of quotes:
  88. %%
  89. \newcount\quoteflag \newcount\quotecount 
  90. \newcount\hquoteflag  \newcount\hquotecount
  91. \def\star{*}
  92. \catcode`\"=\active
  93. \catcode`\*=\active
  94. \def"{\ifnum\quoteflag=0 \ab\global\quoteflag=1
  95.        \else\as\global\quoteflag=0 \fi \global\advance\quotecount by1}
  96. \def*{\ifnum\hquotecount=0 \hab\global\hquoteflag=1
  97.        \else\has\global\hquoteflag=0 \fi\global\advance\hquotecount by1}
  98. \def\quotetest{\ifodd\quotecount\immediate\write16{!! Uneven number of
  99. quotes.}\fi
  100.      \ifodd\hquotecount\immediate\write16{!! Uneven number of half
  101. quotes.}\fi}
  102.       
  103. % The macro \quotetest can be used within other macros, e.g. chapter
  104. macros,
  105. % to alert you of non-matching quotes.
  106.  
  107. % NB: If you want to use the above definitions for German, you should let
  108. % \ab and \hab exchange places with \as and \has, so that
  109. %         "Ich verstehe nicht", sagte sie
  110. % yields
  111. %         >>Ich verstehe nicht<<, sagte sie
  112. % according to the rules of German standard typography (except in
  113. Switzerland).
  114.  
  115.  
  116. Ole Michael Selberg
  117. Institutt for oesteuropeiske og orientalske studier
  118. Universitetet i Oslo
  119. Postboks 1030 Blindern
  120. N-0315 Oslo 3
  121.