[OS X TeX] Preparing large non-tex text for use in latex

Peter Dyballa Peter_Dyballa at Web.DE
Fri Jul 1 00:49:54 CEST 2011


Am 30.06.2011 um 23:33 schrieb Bobby Cheren:

> Any thoughts out there on this issue?

You can put your sed commands, each on one line, into a file, say,  
cases.sed. Then, on the command line, you can invoke:

	sed -f cases.sed cases.text > cases.tex

In your SED file you should put the first three line at the end. A  
problem are the two lines that convert a series of three accents. When  
they come first, then the lines with two accents could convert again  
the first conversion. It might be better to use at the SED file's  
beginning

	s/```/•/g
	s/'''/·/g

and at its end

	s/•/``\\,`/g
	s/·/'\\,''/g

that the occurrences of "```" and "'''" are first saved and then  
converted to the proper forms. "•" and "·" are just characters that  
don't appear in the original text.

If you have a lot of files to convert you can use the apply command:

	apply 'sed -f cases.sed %1 > `basename %1 .txt`.tex' *.txt


In any case, the original files don't get changed, new files are  
created with the TeX-ready output.

--
Greetings

   Pete

We are usually convinced more easily by reasons we have found  
ourselves than by those which have occurred to others.
				– Blaise Pascal




More information about the macostex-archives mailing list