Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm planning to write my master thesis using LyX. In order to keep track of recent changes, I want to export the LyX source files to normal LaTeX source files and put these in a Git repository. In the LaTeX source files, I want each sentence to be on its own line so that I can track changes of my text in a more fine-grained way.

Is there maybe a macro or a command with which I can tell LyX to put each sentence on its own line in the exported LaTeX source files? If not, is there a way to write my own macro which can achieve that? Thank you very much in advance!

share|improve this question
    
My first thought is to write a script that will search the .tex file for periods and insert a `\\` after each one to create a new line. The result probably won't be perfect but it should be a decent enough starting point. Are you comfortable in any scripting languages? –  Dennis Jan 1 '13 at 19:00
    
Have you seen latexdiff? –  Marc van Dongen Jan 1 '13 at 19:59
    
@Dennis Inserting a \\ doesn't help here because I don't want each sentence to be on a separate line in the generated PDF file but only in the LaTeX source file. –  pemistahl Jan 2 '13 at 10:52
    
@MarcvanDongen I know latexdiff but it's not as nice as a real version control system. Besides that, it's not an answer to my question. –  pemistahl Jan 2 '13 at 10:54
    
@PeterStahl Without some form of coding convention, version control is impossible. Personally I always format the LaTeX input by hand. Putting every sentence on one line may be regarded as a coding convention, but it'll be one that's going to make it very difficult to find bugs. –  Marc van Dongen Jan 2 '13 at 11:33

1 Answer 1

up vote 3 down vote accepted

You can also use Version Control in LyX. (At least in the Mac version there is a menuitem under File menu.) I have just tried it today and it works nicely, I can smoothly compare my newer submissions with older ones, with the modified interface in Version Control.

Im not sure what is the case in other systems, but on mac using the built-in Version Control is far better than using git.

UPDATE:

But be prepared for frequent of check-ins and outs as I have checked-in stuff after two days and it started counting the differences... I waited up to 5000, that was in 5mins and closed the comparison... :(

share|improve this answer
    
Ah, thanks for the note. I'm using the Mac version and wasn't aware that rcs is used for version control. I thought that svn would have been used instead. Since there doesn't seem to be a solution for my problem, I will probably stick to the LyX-internal version control and put the respective master file (extension *.lyx,v) in my Git repository. That should work as well. –  pemistahl Jan 3 '13 at 14:12
    
Yeah, I have just had some surprise :S Anyway, you can still use svn or git, with the .lyx files, since the actual text in .lyx files is quite well readable if you do not turn on compression. So you have a good chance at being able to see the differences. –  Barnabas Szabolcs Jan 3 '13 at 17:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.