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: E T

⟦5af4fd86f⟧ TextFile

    Length: 2151 (0x867)
    Types: TextFile
    Names: »Eqn.c«

Derivation

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

TextFile

/* COPYRIGHT (C) 1987  Kamal Al-Yahya */
#include    "setups.h"
Eqn(buffer,out_file)			/* srips TEX equations */

FILE *out_file;
char *buffer;
{
int c,d;
int i;
char w[MAXLINE], ww[MAXWORD];
while ((c = *buffer++) != NULL)
	{
	if(c == '%')
		{
		while ((c = *buffer++) != NULL)
			if (c == '\n') break;
		}
	else if(c == '$')
		{
		if ((d = *buffer++) == '$')
			{
			putc(c,out_file);	putc(d,out_file);
			while ((c = *buffer++) != NULL)
				{
				if(c != '$')   putc(c,out_file);
				else
					{
					buffer++;
					fprintf(out_file,"$$ \n");
					break;
					}
				}
			}
		}
/* check for LaTeX \begin{equation}, \begin{eqnarray}, and \begin{displaymath} */
	else if(c == '\\')
		{
		c = *buffer++;
		if (c == '[')
			{
			putc('\\',out_file); putc(c,out_file);
			while((c = *buffer++) != NULL)
				{
				if(c == '\\')
					{
					c = *buffer++;
					fprintf(out_file,"\\%c",c);
					if (c == ']')
						{
						putc('\n',out_file);
						break;
						}
					}
				else
					putc(c,out_file);
				}
			continue;
			}
		buffer--;
		buffer += get_buf_word(buffer,w);
		if (strcmp(w,"begin") == 0)
			{
			buffer++;
			i = get_buf_word(buffer,w);
			buffer += i;
			if (strcmp(w,"equation") == 0 || strcmp(w,"eqnarray")
				== 0 || strcmp(w,"displaymath") == 0)
				{
				fprintf(out_file,"\\begin{%s}",w);
				buffer++;
				while ((c = *buffer++) != NULL)
					{
					putc(c,out_file);
					if (c == '\\')
						{
						i = get_buf_word(buffer,ww);
						buffer += i;
						fprintf(out_file,"%s",ww);
						if (strcmp(ww,"end") == 0)
							{
							buffer++;
							i = get_buf_word(buffer,ww);
							buffer += i;
							fprintf(out_file,
								"{%s}\n",ww);
							buffer++;
							if (strcmp(ww,"equation")
							    == 0 ||
							    strcmp(ww,"eqnarray")
							    == 0 ||
							    strcmp(ww,"displaymath")
							    == 0)
								break;
							}
						}
					}
				}
			}
		else if (strcmp(w,"def") == 0)
			{
			i = def(buffer,w);
			buffer += i;
			fprintf(out_file,"\\def%s\n",w);
			}
		else if (strcmp(w,"newcommand") == 0)
			{
			i = command(buffer,w);
			buffer += i;
			fprintf(out_file,"\\newcommand%s\n",w);
			}
		}
	}
}