#485 latexdiff support within texstudio

open
nobody
5*
2016-11-21
2013-06-20
El Vierde
No

Some of the main users of latex are academics. When submitting a paper to a journal, often authors are required to either identify changes with bold or colored text or to enable "track changes" when using MS word.
This requires the author to manually identify the changed part of an article until final approval when the author has to once more go through the article and remove whatever command was used to identify those changes.
There is a nice packages that is available within most latex distributions: latexdiff.
This packages takes two documents and creates a third one with a visualization of changes very similar to the one provided by MS Word. There is no need to tag any section of the code.
It would be great if this could be integrated in texstudio in such a way that a button (or menu option) can be pressed and a pop-up window asks to select two file (maybe suggesting the current document as one of them) for input and an output (existing or suggesting a default name for a new one, maybe based on the current document). After clicking "ok", the document generated by latexdiff would magically appear as a new tab ready to be compiled and sent to the reviewers! ;-)

Thank you very much for your time and the wonderful piece of software that TeXstudio is!

Cheers,
El

Related

Feature Requests: #485
Feature Requests: #924

Discussion

  • Jan  Sundermeyer

    Jan Sundermeyer - 2013-06-25

    Sounds like a problem which can be solved using macros/script.

    On 20.06.2013 22:59, El Vierde wrote:


    [feature-requests:#485]
    http://sourceforge.net/p/texstudio/feature-requests/485/ latexdiff
    support within texstudio

    Status: open
    Labels: track changes review
    Created: Thu Jun 20, 2013 08:59 PM UTC by El Vierde
    Last Updated: Thu Jun 20, 2013 08:59 PM UTC
    Owner: nobody

    Some of the main users of latex are academics. When submitting a paper
    to a journal, often authors are required to either identify changes with
    bold or colored text or to enable "track changes" when using MS word.
    This requires the author to manually identify the changed part of an
    article until final approval when the author has to once more go through
    the article and remove whatever command was used to identify those changes.
    There is a nice packages that is available within most latex
    distributions: latexdiff.
    This packages takes two documents and creates a third one with a
    visualization of changes very similar to the one provided by MS Word.
    There is no need to tag any section of the code.
    It would be great if this could be integrated in texstudio in such a way
    that a button (or menu option) can be pressed and a pop-up window asks
    to select two file (maybe suggesting the current document as one of
    them) for input and an output (existing or suggesting a default name for
    a new one, maybe based on the current document). After clicking "ok",
    the document generated by latexdiff would magically appear as a new tab
    ready to be compiled and sent to the reviewers! ;-)

    Thank you very much for your time and the wonderful piece of software
    that TeXstudio is!

    Cheers,
    El


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/texstudio/feature-requests/485/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

    Related

    Feature Requests: #485

  • El Vierde

    El Vierde - 2013-07-02

    Hi Jan!
    It is definitely true. And it is the way that I'm addressing it right now, but I thought there could be a wide enough audience to have it implemented within the main code.

    Talking about scripts, is there a detailed guide (other than the main user manual) about the different classes provided and what methods do? Or maybe an external reference providing some more examples dealing with handling files?

    Thanks again for the great tool!
    El

     
    • Tim Hoffmann

      Tim Hoffmann - 2013-07-02

      Hi El,

      there is no detailed guide on the available classes and methods. This is partly because it's not an API. Instead you have direct access to the classes on which TXS is built. One the one hand, this gives you a great freedom to do almost anything you want. On the other hand, if we change something internally, this will change the interface for the script. For that reason, I don't favour documenting too much of it, because we might introduce changes that would break documented scripting functionality. Moreover, documenting all of it would be a lot of work.

      Now for more information:
      1) There is a collection of example scripts in the wiki.
      2) You can query the supported methods and attributes of an object by introspection. See script examples in the manual or the wiki.
      3) Finally, you might look into the corresponding classes of the TXS source code.

       
  • El Vierde

    El Vierde - 2014-01-19

    Should anybody else be interested, here is how I implemented track changing.

    Cheers,
    El

    %SCRIPT
    
    var cf = app.getCurrentFileName();
    
    var ld = new String(cf);
    ld=ld.substring(0,ld.lastIndexOf("/"));
    
    information("Select original file");
    fileChooser.setDir(ld);
    fileChooser.setFilter("TeX files (*.tex)");
    fileChooser.exec();
    var fold=new String();
    fold=fileChooser.fileName();
    fold=fold.substring(fold.lastIndexOf("/")+1);
    
    information("Select revised file");
    fileChooser.setDir(ld);
    fileChooser.setFilter("TeX files (*.tex)");
    fileChooser.exec();
    var fnew=new String();
    fnew=fileChooser.fileName();
    fnew=fnew.substring(fnew.lastIndexOf("/")+1);
    
    information("Select changes tracking file");
    fileChooser.setDir(ld);
    fileChooser.setFilter("TeX files (*.tex)");
    fileChooser.exec(fout);
    var fout=new String();
    fout=fileChooser.fileName();
    fout=fout.substring(fout.lastIndexOf("/")+1);
    
    var cmd=new String();
    cmd="bash -c \"cd "+ld+" ; latexdiff-so "+fold+" "+fnew+" > "+fout+"\"";
    dialog=new UniversalInputDialog();
    dialog.add(cmd,"run command?");
    var rpl=dialog.exec();
    if(rpl!=null){
        system(cmd);
    }
    
    delete(cmd);
    delete(dialog);
    delete(fold);
    delete(fnew);
    delete(fout);
    delete(ld);
    
     
  • Dnamarco

    Dnamarco - 2014-05-08

    Hi EI!
    Your script is exactly what I was looking for, many thanks!!

    I've been trying to use it but TeXstudio keeps giving me an error:

    Error: Could not start the command: bash -c "cd C:/Users/cvmd6/Desktop/canc ; latexdiff-so old.tex new.tex > diff.tex"

    Do you have any idea how I can solve it?

    Thanks in advance,

    Marco

     
  • Tim Hoffmann

    Tim Hoffmann - 2014-05-08

    You seem to try running linux commands on windows. Try this (not tested myself):

    cmd /c "cd C:/Users/cvmd6/Desktop/canc & latexdiff-so old.tex new.tex > diff.tex" 
    

    Also it may be that you need to have perl installed to run latexdiff (check by running it from the command line.

     
  • Kendon Bell

    Kendon Bell - 2015-05-26

    +1 for having this native in TexStudio

     
  • Rodrigo Falcao

    Rodrigo Falcao - 2016-11-21

    +1

    First, thanks for providing such great tool!

    This lack of support on track changes is the major drawback of TexStudio in comparison to MS Word! This would be a killer feature, can't get why this feature request is not priorized! :)

     

Log in to post a comment.