2

After updating ubuntu to 16.04 it seems that the "skt" package has completely stopped working.

The work of the skt preprocessor is the following. Suppose I give the command

\documentclass{article}
\usepackage{skt}
\begin{document}
{\skt rama.h "siva.h brahma}
\end{document}

and save this file as example.skt and then run the command skt example.skt then I would get the output file as example.tex and then I have to run example.tex file to get the desired devanagari output.

But whenever I type the command, skt in terminal it gives error message as skt command not found. There is a similar preprocessor, devnag which works well and is recognized by the ubuntu terminal, but I prefer the skt package as it has lot of advantages (like Vedic Accents etc, etc).

Can someone help.

  • As far as I know, TeX Live just contains the C source skt.c, but has never included the binary. I tried to compile it with a simple gcc -o skt skt.c, but I got errors. – egreg Aug 31 '16 at 8:04
  • @egreg I got the errors to – crskhr Aug 31 '16 at 13:48
7

The skt.c source looks positively ancient. It just needs a small adjustment for me on Cygwin to compile again:

diff --git a/skt.c b/skt.c
index 1d34f11..8f8b2f4 100644
--- a/skt.c
+++ b/skt.c
@@ -43,7 +43,7 @@ void   search      (void);
 void   write_outbuf(void);
 void   write_line  (char *);
 char * str_find    (char *, char *);
-void   getline     (void);
+void   get_line     (void);
 char * command     (char *);
 void   error       (char *, int);
 void   process     (void);
@@ -136,9 +136,9 @@ int  intraspace;          /* intra-syllable space, from above and option 1    */
 /*                       MAIN                                                 */
 /******************************************************************************/

-main(argc,argv)
-int argc;
-char *argv[];
+int
+main(int argc,
+     char *argv[])
 { char *p; int k;

 /* INITIALIZATION */
@@ -151,7 +151,7 @@ char *argv[];
   o_ptr = outbuf; *o_ptr = '\0';
   for (k=0; k<total_options+1; k++) option[k] = FALSE; /* disable everything  */

-  printf("SKT.C Version 2.2 02-Jan-2002\n");
+  printf("SKT.C Version 2.2.1 2016-08-31\n");

 #if (DEBUG == 0)

@@ -186,7 +186,7 @@ char *argv[];
   printf("Enter text (blank line terminates program) :\n");
 #endif

-  getline(); if (eof_flag) { printf("No input text.\n"); exit(1); }
+  get_line(); if (eof_flag) { printf("No input text.\n"); exit(1); }

 #if (DEBUG == 0)

@@ -238,7 +238,7 @@ char *p,*q;
       if (p == 0)
         { if (sktline == TRUE) { strcat(outbuf,i_ptr); write_outbuf(); }
           else { write_line(inbuf); o_ptr = outbuf; *o_ptr = '\0';  }
-          getline(); 
+          get_line(); 
           continue; 
         }
       q = i_ptr; i_ptr = p;
@@ -270,8 +270,8 @@ char c, d, e;
     if (strlen(outbuf) < 81) { write_line(outbuf); break; }
     if (option[9])                                  /* if obey-lines enabled */
       { if (strlen(outbuf) > 250) 
-         { printf("Line %4d    Warning: Very long output line: %d characters\n",
-                   line_cnt, strlen(outbuf) );
+         { printf("Line %4d    Warning: Very long output line: %u characters\n",
+                  line_cnt, (unsigned)strlen(outbuf) );
          }
         write_line(outbuf); break;
       }
@@ -324,13 +324,13 @@ char * str_find(char *buf, char *str)
 }

 /******************************************************************************/
-/*                       GETLINE                                              */
+/*                       GET_LINE                                              */
 /******************************************************************************/

 /* Function: get another line from input file; reset i_ptr, increments        */
 /*           line_cnt, and sets eof_flag if EOF.                              */

-void getline(void)
+void get_line(void)
 { 
 char *p;
   i_ptr = inbuf;
@@ -445,12 +445,12 @@ unsigned char *i, c,d;
     c = *i_ptr; d = *(i_ptr+1);
 /* END OF LINE */
     if ((c == '\0') || (c == '\n'))
-      { sktword(); strcat (outbuf,i_ptr); write_outbuf(); getline(); CC; }
+      { sktword(); strcat (outbuf,i_ptr); write_outbuf(); get_line(); CC; }
 /* COMMENT DELIMITER */
     if (c == '%')
     { if (*(i_ptr+1) == '\n') sktcont();
       else sktword();
-      strcat(outbuf,i_ptr); write_outbuf(); getline(); CC;
+      strcat(outbuf,i_ptr); write_outbuf(); get_line(); CC;
     }
 /* ILLEGAL CHARS */
     if (strchr("&fqwxzFQWXZ\177",c))

See also modified skt.c on Gist.

UPDATE: I have accidentally used reverse diff. This is fixed now.

  • I compiled the modified skt.c on Mac OS X and got a few warnings, but the conversion from the example .skt file seems successful. – egreg Aug 31 '16 at 9:56
  • @egreg Too naive to understand this answer. How did you compile?? How do I compile this on Ubuntu. Will the command skt example.skt give me an output now?? – crskhr Aug 31 '16 at 13:51
  • 1
    @S.C. I downloaded the modified source from wilx's site and ran gcc -o skt skt.c This produces an skt executable that you can save in any place where PATH points to. In order to test it, have your test.skt file in the same directory as the skt executable and run ./skt test – egreg Aug 31 '16 at 15:03
  • @egreg Working without an error. Thanks thanks and thanks :) – crskhr Aug 31 '16 at 15:15
  • 1
    @S.C.: The updated source has been uploaded to CTAN. – wilx Jan 13 '17 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.