Formatting specific text, headings, and footnotes in LaTeXI need to upda
December 5, 2014 5:01 PM   Subscribe

I need to update a complex LaTeX document (discussed here before). I also need to make all the changes obvious with some sort of distinctive formatting, like green text.

I can find instructions online for changing all the text or headings in a document, but what I really want is to define three new commands: one for modified text, one for new headings, and one for new footnotes.

Ideally, I want to be able to wrap any sort of text in \begin{newtext} and \end{newtext} and automatically have a style of formatting defined in the preamble applied.

Is the \newenvironment command the way to do this? And what sort of syntax would work?

Any suggestions about how to do this would be very much appreciated.
posted by sindark to Computers & Internet (12 answers total) 2 users marked this as a favorite
 
I am not enough of a TeXpert to help you out myself, but I can tell you that the folks at TeX Stack Exchange are consistently super helpful if you don't get an answer here.
posted by dfan at 5:17 PM on December 5, 2014


Response by poster: There are lots of confusing answers and bits of code there, and nobody seems to be asking for a solution that works for headings and footnotes as well as ordinary text.
posted by sindark at 5:18 PM on December 5, 2014


Do you want to be able to make changes to header/footnotes/sections etc. all automatically (e.g., by changing your style file)? Or do you just want to be able to change the text in a specific footnote and have it be red?

The latter option should be pretty easy: define a new command that goes inside the \footnote{} or \section{} that you wrap around the text. I think a newenvironment is more complicated than you need.

Try:
in your preamble

\usepackage{colors}

and then

\newcommand{\footnew}[1]{ {\color{red} #1} }

and then you would use it as

\footnote{ \footnew{this is the new text} and here's some text that was there already}

which would turn the "this is the new text" red. As far as I know (but I've not tested it explicilty) this kind of thing should be fine wherever you've got text, even if it's in a section or header.

The nice thing about this approach is that when you're done, you can change the command definition and replace red with black, and then all the recoloring would go away.

There's also the ulem package, which gives commands for strikeout and underline, etc. (I think).

But some more details about exactly what you want to be able to do would be helpful.
posted by leahwrenn at 5:34 PM on December 5, 2014


Response by poster: But some more details about exactly what you want to be able to do would be helpful.

The original document was created to conform with a specific university policy. Once it was finalized, 300 people had to attest that they had read it and agreed with it in full.

What I need to do now is add a lot of new information (the old document is more than a year old), and make it clear for anybody who cares what text was in the original and what text is part of the update.
posted by sindark at 5:40 PM on December 5, 2014


Best answer: You probably want the changes package. Basic added text/removed text/replaced text macros suitable for pretty much anywhere in a document, and lots of ways to visually present it.
posted by jackbishop at 5:45 PM on December 5, 2014 [3 favorites]


+1 to the changes package. (I think that's the one I used to automatically do a diff on the two tex files.) You do NOT want to have to do all that manually.
posted by supercres at 6:31 PM on December 5, 2014 [1 favorite]


I've always used latexdiff for this purpose, but it has some issues; I haven't tried the changes package, so I don't know if it is better or worse.
posted by nat at 6:53 PM on December 5, 2014 [1 favorite]


I was just reading the other day about keeping LaTeX documents in version control (e.g., git or whatever your preference is) on reddit:

http://www.reddit.com/r/LaTeX/comments/2mra3o/using_latex_with_version_control/

... and the recommendation there was also for latexdiff, which you can see a quick preview of here:

http://emeryblogger.com/2011/01/14/diff-your-latex-files-with-latexdiff/
posted by Brian Puccio at 8:35 PM on December 5, 2014 [1 favorite]


There are lots of confusing answers and bits of code there [TeX Stack Exchange], and nobody seems to be asking for a solution that works for headings and footnotes as well as ordinary text.
I was suggesting that you ask for such a solution. However, it looks like you might be getting sufficient help here in any case.
posted by dfan at 10:07 AM on December 6, 2014


Response by poster: I am definitely going to give the changes package a try.

Thanks for all the suggestions so far.

On a side note - I have long wanted a nice timeline package for LaTeX that can accept time values on different scales (seconds, hours, years) and which produces visually pleasant output. Have any of you come across and packages like that?
posted by sindark at 11:07 PM on December 8, 2014


Response by poster: P.S. It would be amazing if the timeline package could position both text and image elements with proportional spacing along a horizontal or vertical line. For instance, having a series of timestamped photographs across the top and timestamped text labels along the bottom.
posted by sindark at 11:08 PM on December 8, 2014


Response by poster: The changes package is working pretty nicely. It would be helpful if it could handle multiple paragraphs of text, as well as headings and footnotes more easily.

Nonetheless, I think it will serve our purpose in this case.

Thanks everyone!
posted by sindark at 8:36 AM on December 10, 2014 [1 favorite]


« Older Tubular Slippage: Fluted Knob Not Clamping   |   How do I make the most of my attendance at the... Newer »
This thread is closed to new comments.