DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: D T

⟦b2994ceb7⟧ TextFile

    Length: 1351 (0x547)
    Types: TextFile
    Names: »DeTeX.c«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z« 
        └─⟦036c765ac⟧ 
            └─⟦this⟧ »TeX3.0/TeXcontrib/kamal/DeTeX.c« 
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
    └─⟦this⟧ »./tex82/TeXcontrib/kamal/DeTeX.c« 
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦63303ae94⟧ »unix3.14/TeX3.14.tar.Z« 
        └─⟦c58930e5c⟧ 
            └─⟦this⟧ »TeX3.14/TeXcontrib/kamal/DeTeX.c« 

TextFile

/* COPYRIGHT (C) 1987  Kamal Al-Yahya */
#include   "setups.h"
DeTeX(buffer,out_file)			/* stripping TEX commands */

char *buffer;
FILE *out_file;
{
int c,cc;
char w[MAXWORD];

while ((c = *buffer++) != NULL)
	{
	switch (c)
		{
/* detect TeX commands (backslash) */
		case '\\':
			c=' ' ;		/* "erase" the backslash */
			putc(c,out_file);
			cc = *buffer++;
			if (cc == '\n')			putc(cc,out_file);
			else if (cc == '[')		buffer += display(buffer);
			else if (cc == '(')		buffer += formula(buffer);
			else if (cc == '$' || cc == '%')
				break;
/* check for LaTeX \begin{equation}, \begin{eqnarray}, and \begin{displaymath} */
			else
				{
				buffer--;
				buffer += get_buf_word(buffer,w);
				if (strcmp(w,"begin") == 0)
					{
					buffer++;
					buffer += get_buf_word(buffer,w);
					if (strcmp(w,"equation") == 0 ||
						strcmp(w,"eqnarray") == 0 ||
						strcmp(w,"displaymath") == 0)
						buffer += begin_to_end(buffer,w);
					}
				}
			break;

		case '$':
			buffer += dollar(buffer,out_file);
			break;
		case '%':
			buffer += comment(buffer);
			break;
/* erase these character */
		case '{':
			c=' ';
		case '}':
			c=' ';
		case '_':
			c=' ';
		case '^':
			c=' ';
		case '&':
			c=' ';
		case '#':
			c=' ';
/* default is doing nothing: pass the character to the output */
		default:
			putc(c,out_file);
			break;
		}
	}
}