[texhax] What program can I use to edit TeX files?

Thomas Schneider schneidt at mail.nih.gov
Fri Mar 22 01:31:17 CET 2013


Steve:

> Here is a sample file (.txt) I edited (along with original ".tex"
> file).
> Without being specific, the publisher told me I could not give them a
> "txt" file because "characters will not appear correctly in ASCII
> format."

It's the operating system that decides what to do with the file.  You
can name a file anything (on Unix systems like the Mac or Linux) but
the .txt or .tex helps programs know what they can work with.  (Also
the first two characters of a file are, I believe, a 'magic cookie'
that helps programs.)

> So, all "wars" aside, what I guess I need to know is that if Word could
> inadvertently introduce artifacts that would prevent or interfere with
> TeX compiling the file correctly, all I need to use is a bare bones
> editor that will enable me to give a ".tex" file back to the publisher.

Vim, emacs or other straight text editors will do it.  Word or other
word processors take a long time to start and are awkward to
manipulate in comparison.  On a mac, just open a Terminal.app and type

  vim myfile

and away you go!

> I am not creating dvi files. I am not 'typesetting' the book.
> I am only doing "language editing," not actually editing the equations

As others have said, it would be much better if you have an active
typesetting system going.  Then you can edit not only the text but
everything and you will know if you messed up the typesetting.

Out of curiousity I looked at your two files.  They apparently have
non-standard commands in them that your publisher must have defined:
\Chapter \autoref \citep.  I went into both files and removed the '\'
on them to get them out of the way.  I then added:

\documentclass[12pt]{article}
\begin{document}

to the start of each file and

\end{document}

the the end of each file.  This was sufficient to make LaTeX happy with each.
So I just typed:

latex 1.tex
latex rev.tex

and latex happely generated the usual files:

 1.aux  1.dvi  1.log
 rev.aux  rev.dvi  rev.log

Then I did something you will really like.

latexdiff 1.tex rev.tex > paper.tex
latex paper       # run latex to make dvi file
dvips paper       # run dvips to make postscript paper.ps file
ps2pdf paper.ps   # convert postscript to pdf

Then I looked at the paper.pdf and VOILA - there were the changes you
made nicely marked out!

I'm on a Mac and so use the Skim PDF reader so I look at it with that.
(It can be set to automatically update.  So while I'm editing the
source latex .tex file in vim, I type a single ',' and my scripts
automatically typeset and Skim redisplays without me taking my hands
off the keyboard.)

I put the entire directory in an attachment.  Check out the paper.pdf
file first.  The 'mk' file is a script that does the job.

Tom

  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research
  Gene Regulation and Chromosome Biology Laboratory
  Molecular Information Theory Group
  Frederick, Maryland  21702-1201
  schneidt at mail.nih.gov
  http://alum.mit.edu/www/toms
-------------- next part --------------
A non-text attachment was scrubbed...
Name: latexdiffdemo.zip
Type: application/x-zip-compressed
Size: 171605 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20130321/02ca238c/attachment-0001.bin>


More information about the texhax mailing list