🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Andi Loesch Tue, 29 Sep 1992 08:47
deutsche Rechtschreibpr"ufung
#1002
Author: Andi Loesch
Date: Tue, 29 Sep 1992 08:47
13 lines
743 bytes
Ich habe leider keine FAQ gefunden. Deshalb meine Frage hier:

Gibt es irgendwo eine deutsche Rechtschreibpr"ufung / ein deutsches
dictionary f"ur TeX/LaTeX?

Ciao
Andi

--
  Andreas Loesch	Phone   : (+49 89)3209 4086
  Univ. Muenchen	FAX     : (+49 89)3209 4059
  Am Coulombwall 1	E-mail  : Andi.Loesch@Physik.Uni-Muenchen.DE
W-8046 Garching
Re: deutsche Rechtschreibpr"ufung
#1003
Author: Georg Wittig
Date: Tue, 29 Sep 1992 09:35
18 lines
1301 bytes
loesch@bl.physik.tu-muenchen.de (Andi Loesch) writes:

>Gibt es irgendwo eine deutsche Rechtschreibpr"ufung / ein deutsches
>dictionary f"ur TeX/LaTeX?

Auch ich bin an einem wirklich GUTEN, KORREKTEN UND VOLLSTAENDIGEN
deutschen Dictionary interessiert. Wir haben im Moment nur die
de-facto-Standard-Dictionaries in

	ftp.gmd.de:/dict/{german,germanl}

, die aber nach meiner Meinung viel zu viele Wuensche offen lassen. Wer
kennt bessere deutsche Dictionaries?
--
Georg Wittig                  GMD-I8.IT                                         Schloss Birlinghoven          P. O. Box 1316                                    D-W-5205 Sankt Augustin 1     Germany
email: Georg.Wittig@gmd.de    telephone: (+49) 2241 14-2294
 ------------------------------------------------------------------------------
"In the beginning was the word, but it wasn't a fixed number of bits."
Re: deutsche Rechtschreibpr"ufung
#1004
Author: Michael Staats
Date: Tue, 29 Sep 1992 15:32
41 lines
2019 bytes
In <wittig.717759318@gmd.de> wittig@gmd.de (Georg Wittig) writes:

>loesch@bl.physik.tu-muenchen.de (Andi Loesch) writes:

>>Gibt es irgendwo eine deutsche Rechtschreibpr"ufung / ein deutsches
>>dictionary f"ur TeX/LaTeX?

>Auch ich bin an einem wirklich GUTEN, KORREKTEN UND VOLLSTAENDIGEN
>deutschen Dictionary interessiert. Wir haben im Moment nur die
>de-facto-Standard-Dictionaries in

Mich w"urde das auch interessieren. 
Als Abhilfe habe ich vor kurzem ein Programm nach der Art von
delatex geschrieben, das aber meiner Ansich nach besser ist und 
z. B. folgende Konversionen vornimmt:

"Uberraschung -> #berraschung (an der Stelle von # steht dann entweder
			       ein IBM ASCII "U oder ein ISO "U)

ther\-mi\-sches -> thermisches

Au\3erdem kann auf Wunsch der ganze Text im Mathematik-Modus
entfernt werde. Oder Environmentnamen werden entfernt, ebenso
natuerlich alle Befehle, die mit \ Anfangen.

Wenn man seinen LaTeX Code damit filtert, kann man den Output
von einem unter DOS "ublichen Programm (z. B. word) checken lassen.
F"ur die Erw"ahnung von Schimpfw"ortern wie DOS und word 
entschuldige ich mich hiermit.

Wenn Bedarf besteht, k"onnte ich den source-code (ANSI-C) posten
oder mailen.

Tsch"uss,
Michael

-- 
Michael Staats, Student of Theoretical Physics, Uni-GH Duisburg 
Wenn dieser Artikel in Deutsch ist: Bitte entschuldigt meine Fehler.
If this article is in english: Please excuse me for my mistakes. 
if (written_in_C(&article)) mistake_msg_to("michael@hal6000.uni-duisburg.de");
Re: deutsche Rechtschreibpr"ufung
#1011
Author: HAEBLER
Date: Wed, 30 Sep 1992 08:47
41 lines
1973 bytes
In article <hm342st.717780303@unidui>, hm342st@unidui.uni-duisburg.de (Michael
Staats) says:
>
>In <wittig.717759318@gmd.de> wittig@gmd.de (Georg Wittig) writes:
>
>>loesch@bl.physik.tu-muenchen.de (Andi Loesch) writes:
>
>>>Gibt es irgendwo eine deutsche Rechtschreibpr"ufung / ein deutsches
>>>dictionary f"ur TeX/LaTeX?
>
>>Auch ich bin an einem wirklich GUTEN, KORREKTEN UND VOLLSTAENDIGEN
>>deutschen Dictionary interessiert. Wir haben im Moment nur die
>>de-facto-Standard-Dictionaries in
>
>Mich w"urde das auch interessieren.
>Als Abhilfe habe ich vor kurzem ein Programm nach der Art von
>delatex geschrieben, das aber meiner Ansich nach besser ist und
>z. B. folgende Konversionen vornimmt:
>
>"Uberraschung -> #berraschung (an der Stelle von # steht dann entweder
>                               ein IBM ASCII "U oder ein ISO "U)
>
>ther\-mi\-sches -> thermisches
>
>Au\3erdem kann auf Wunsch der ganze Text im Mathematik-Modus
>entfernt werde. Oder Environmentnamen werden entfernt, ebenso
>natuerlich alle Befehle, die mit \ Anfangen.
>
>Wenn man seinen LaTeX Code damit filtert, kann man den Output
>von einem unter DOS "ublichen Programm (z. B. word) checken lassen.
>F"ur die Erw"ahnung von Schimpfw"ortern wie DOS und word
>entschuldige ich mich hiermit.
>
>Wenn Bedarf besteht, k"onnte ich den source-code (ANSI-C) posten
>oder mailen.
>
Ja, poste mal, mich wuerde das schon interessieren.

Danke

      Marcus
Re: deutsche Rechtschreibpr"ufung
#1012
Author: Michael Staats
Date: Wed, 30 Sep 1992 09:40
365 lines
9475 bytes
In <hm342st.717780303@unidui> hm342st@unidui.uni-duisburg.de (Michael Staats) writes:

>Wenn Bedarf besteht, k"onnte ich den source-code (ANSI-C) posten
>oder mailen.

Bisher hab' ich eine mail mit einer Nachfrage bekommen. Da das Interesse
vielleicht doch allgemeiner ist und der code nicht allzu lang ist, hier
ist er. Bug Reports bitte an michael@hal6000.uni-duisburg.de, aber 
versprechen kann ich nichts.

======================= untex.c ============================================

/* untex.c: Copyright Michael Staats (michael@hal6000.uni-duisburg.de)
   This source can be freely distributed according to the GNU Public
   license, which is available via ftp at many anon ftp servers. 
   
   Warning: I give no warranty whatever. Please note, that this is
   one of the first versions of untex, there might be bugs. I haven't
   tested it completely.

*/


/* untex.c:     remove all (?) LaTeX commands from input,
                Options:
		-o remove options to commands
		-a remove arguments 
		-u replace all \"a (etc.) with ibm characters
		-g also replace all "a (etc.) with ibm characters (german.sty)
		-e remove environment names
		-m remove all math
		-  read from stdin (no ioctl call to determine piped input,
		                    this program is intended to be portable)
		
		-g implies -u, -a implies -o
*/


#include <stddef.h>
#include <stdio.h>
#include <ctype.h>


#define MAXCMDLEN 80
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
    
#define GET(c) if (((c)=getc(inf)) == EOF ) return    
int nomath 	= FALSE;
int noenv 	= FALSE;
int germ 	= FALSE;
int uml 	= FALSE;
int iso 	= FALSE;
int noarg 	= FALSE;
int noopt 	= FALSE;


void usage();
void untex(FILE *inf);
int umlaut(int c);
int parsecmd(FILE *inf);
int skipcomment(FILE *inf, int *c);


int main(int argc, char *argv[])
{
	int i;
	FILE *inf;

	if (argc <= 1) usage();

	i = 1;
	inf = NULL;
	while (i < argc && argv[i][0]=='-') switch(argv[i++][1]) {
	      case 'm':nomath = TRUE;
		break;
	      case 'a':noarg = TRUE;   /* no break here! */
	      case 'o':noopt = TRUE;
		break;
	      case 'e':noenv = TRUE;
		break;
	      case 'g':germ = TRUE;   /* no break here ! */
	      case 'u':uml = TRUE;
		iso = !strcmp(&argv[i-1][2], "iso");
		break;
	      default:
		if (!strcmp(argv[i-1],"-")) inf = stdin;
		else usage();
		break;
	}
	
	if (i >= argc && inf == NULL) usage();

	if (inf == NULL) for (;i<argc;i++) {
		if ((inf = fopen(argv[i],"r"))==NULL) perror(argv[i]);
		else untex(inf);
		fclose(inf);
	} else untex(inf);
	
	exit(0);
}

void usage()
{
	fprintf(stderr,"usage: untex [-o] [-a] [-m] [-e] [-u[iso]] [-g[iso]] file1 [file2] [file3] ...\n");
	fprintf(stderr,"or:    untex [-o] [-a] [-m] [-e] [-u[iso]] [-g[iso]] -\n");
	fprintf(stderr,"Options:   - : read from stdin\n");
	fprintf(stderr,"          -m : remove all math code\n");
	fprintf(stderr,"          -o : remove options to commands\n");
	fprintf(stderr,"          -u : replace all \\\"a (etc.) with ibm characters\n");
	fprintf(stderr,"          -g : also replace all \"a (etc.) with ibm characters (german.sty)\n");
	fprintf(stderr,"       -uiso : replace all \\\"a (etc.) with iso characters\n");
	fprintf(stderr,"       -giso : also replace all \"a (etc.) with iso characters (german.sty)\n");
	fprintf(stderr,"          -e : remove environment names\n");
	fprintf(stderr,"          -a : remove arguments of commands\n");
	fprintf(stderr,"          -g implies -u, -a implies -o\n");
	fprintf(stderr,"          output is written to stdout\n");

	exit(1);
}

void untex(FILE *inf)
{
	int c, c1;

	while ( (c=getc(inf)) != EOF ) {
		switch (c) {
		      case '\\':
			GET(c);
			switch (c) {
				
				/* following code treats chars preceeded
				   by a backslash */
				
			      case '|':  /* print escaped special chars */
			      case '$':
			      case '&':
			      case '%':
			      case '#':
			      case '_':
			      case '{':
			      case '}':
				putchar(c);
				break;

			      case ' ': /* print space instead of these */
			      case '`':
			      case '\'':
			      case '+':
			      case '/':
			      case ':':
			      case ';':
			      case ',':
			      case '<':
			      case '>':
			      case '@':
				putchar(' ');
				break;
				
			      case '-': /* ignore these */
			      case '=':
			      case '!':			      
			      case '^':
			      case '~':
			      case '.':
				break;
				
			      case '(': /* if -m is set, ignore math */
			      case '[':
				c1 = (c == '(') ? ')' : ']';
				if (!nomath) putchar(c);
				while (nomath && c != c1) {
					while ( (c=getc(inf)) != EOF &&
					       skipcomment(inf, &c) &&
					       c != '\\' );
					GET(c);
				}
				break;
	
			      case '3':if (germ) putchar(umlaut('s'));
				break;
				
			      
				
			      case '\"':
				GET(c);
				if (uml) putchar(umlaut(c));
				else putchar(c);
				break;
				
			      case '\\':putchar('\n');  
				GET(c);
				if (c == '[') 
				    while ((c=getc(inf)) != EOF  &&
					   skipcomment(inf, &c) &&
					   c != ']');
				else ungetc(c, inf);
				break;
				
			      default:
				ungetc(c, inf);
				if ((c=parsecmd(inf)) == EOF) return;
				if (c=='\n') putchar(c); else putchar(' ');
				break;
			}
			break; 
		      case '%':while ((c=getc(inf)) != EOF && c != '\n');
			break; 
			
		      case '{':
		      case '}':
		      case '~':
		      case '_':
			putchar(' ');
			break;
		      case '\"':
			if (germ) {
				GET(c);
				putchar(umlaut(c));
			} else putchar(c);
			break;
			      
		      case '$':
			GET(c);
			if (c != '$') ungetc(c, inf);
			if (nomath) {
				while ((c=getc(inf)) != EOF && 
				       skipcomment(inf, &c) &&
				       c != '$');
				if (c == EOF) return;
				GET(c);
				if (c != '$') ungetc(c, inf);
			}
			break;
			
			
		      default:putchar(c);
			break;
		}
		if (c == EOF) return;
	}
	return;
}

								   
int skipcomment(FILE *inf, int *c)
{
	static int oldc = 0;
	
	while (oldc != '\\' && *c == '%') {
		while ((*c=getc(inf)) != EOF && *c != '\n');
		*c = getc(inf);
	}
	oldc = *c;
	return((*c != EOF));
}



int umlaut(int c)
{
	switch (c) {
	      case 'a':return(iso ? '\344' : 0x84);
	      case 'A':return(iso ? '\304' : 0x8E);
	      case 'o':return(iso ? '\366' : 0x94);
	      case 'O':return(iso ? '\326' : 0x99);
	      case 'u':return(iso ? '\374' : 0x81);
	      case 'U':return(iso ? '\334' : 0x9A);
	      case 's':return(iso ? '\337' : 0xE1);
	}
	return(c);
}


int parsecmd(FILE *inf)
{
	int c;
	char cmd[MAXCMDLEN], env[MAXCMDLEN], envtst[MAXCMDLEN];
	int cmdc, envc, i, open, close;
	int proceed;

	
	envc = cmdc = 0;
	c = getc(inf);
	
	while (c != EOF &&  (isalnum(c) || c == '@' || c == '*' )) {
		cmd[cmdc++] = c;
		if (cmdc >= MAXCMDLEN - 1) cmdc--;
		c = getc(inf);
	}
	cmd[cmdc] = 0;
	if (c == EOF) return(c);
	
	if (noopt && c == '[') {
		while ((c=getc(inf)) != EOF && c != ']');
		if ((c = getc(inf)) == EOF) return(c);
	}

	if (noarg && c == '{' && strcmp(cmd,"begin") && strcmp(cmd,"end")) {
		open = 1;
		close = 0;
		while ((c = getc(inf)) != EOF && skipcomment(inf, &c) &&
		       close != open) 
		    if (c =='{') open++; else if (c == '}') close++;
		ungetc(c, inf);
		return(c);
	}
	
	if (!strcmp(cmd,"begin") || !strcmp(cmd,"end")) {
		if ((c != '{' || c == EOF)) {
			ungetc(c, inf);
			return(c);
		}
	        while (c != EOF && c != '}') {
			c = getc(inf);
			env[envc++] = c;
			if (envc >= MAXCMDLEN - 1) envc--;
		}
		env[envc-1] = 0;
		if (!noenv) printf(env);
		envtst[0] = 0;
		if (nomath && !strcmp(cmd,"begin") &&
		    (!strcmp(env,"displaymath") ||
		     !strcmp(env,"equation") ||
		     !strcmp(env,"eqnarray") ||
		     !strcmp(env,"equation*") ||
		     !strcmp(env,"eqnarray*")
		     )
		    ) { 
			putchar('\n');
			while (strcmp(envtst, env)) {
				while ((c=getc(inf)) != EOF &&
				       skipcomment(inf, &c) &&
				       c != '\\');
				if (getc(inf) == 'e' &&
				    getc(inf) == 'n' &&
				    getc(inf) == 'd' &&
				    getc(inf) == '{') {
					i = 0;
					while ((c=getc(inf)) != EOF &&
					       c != '}') {
						envtst[i++] = c;
						if (i >= MAXCMDLEN - 1) i--;
					}
					envtst[i] = 0;
				}
			}
			if (!noenv) printf(envtst);
		}
	}
	ungetc(c, inf);
	return(c);
}


=======================  end  ============================================
-- 
Michael Staats, Student of Theoretical Physics, Uni-GH Duisburg 
BTW: I'm looking for a Makefile which takes physical model, applied methods,
expected results and literature references as input and generates a master
thesis in Theoretical Physics to save time for reading news. Help me, please!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads