Greek latex convert (solved)

Aristides Kontogeorgis kontogar at math.uch.gr
Thu Mar 15 16:18:01 EET 2001


Loipon edw einai mia mikrh allagh tou kwdika c pou mou esteile o evris
to opoio pernei input ellhniko latex 
kai bgazei ellhniko latex, 
etoimo gia epeksergasia me to babel. 




###################################################################
        Author  : Panayotis Vryonis <vrypan at hellug.gr>
        Date    : 12.Sep.1998

        Hacked by Evripidis Papakostas <evris at eeea.gr>
        - problem with extra space greek words and punctuation marks
solved by checking if isalnum(c)
        - problem with capitals like 'A etc solved by c>=182 instead of
c>=193
        Date 06.Feb.1999
   ###################################################################
*/

#include <stdio.h>
#include <ctype.h>
#define GR 1
#define LAT 0
#define LTEX 2
#define IDLE 2

main()
{
int     STATUS,c ;

STATUS = GR ;

c=getchar();
while (c!=EOF) {
        if (!( isspace(c) || isdigit(c) || (c=='.')   || (c==',') || (c=='$') 
  )) { 
                if (c==92) {
                            STATUS=LTEX; 
                           }
                 if (c>=182) {
                        if (STATUS==LAT) {
                                if(isalnum(c))
                                        printf(" } ");
                                else
                                        printf("} ");
                                 STATUS = GR ;}
                         if (STATUS==LTEX){ STATUS = GR ; }      
                }
                else {
                        if (STATUS==GR) { 

                                if(isalnum(c))
                                        printf("\\textlatin{ ");
                                else
                                        printf("\\textlatin{");
                                STATUS = LAT ;
                        }
                }
        }
        printf ( "%c",c );
        c=getchar();
        }
return 0 ;       
}

-- 
Aristides Kontogeorgis
University Of Crete
Department of Mathematics
Heraklion 71409
kontogar at math.uch.gr
http://www.math.uch.gr/~kontogar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: evris1.c
Type: text/x-c
Size: 1602 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/20010315/b0738512/attachment.bin>


More information about the Linux-greek-users mailing list