Re: Changebar module file
Le 01/11/2015 23:01, Jean-Marc Lasgouttes a écrit : Le 01/11/15 23:48, Guillaume Munch a écrit : List, is the attached correct? I'd say yes. I do not like much the extra redefinition, but the only other solution is plain \def. BTW, as it is implemented here, if it works reliably, this looks like something that is easy to add natively in LyX. Thanks. Yes, this has been discussed in the thread, but: 1) it does not work with XeTeX, and 2) nobody stepped forward. Guillaume
Re: Changebar module file
Le 01/11/2015 23:01, Jean-Marc Lasgouttes a écrit : Le 01/11/15 23:48, Guillaume Munch a écrit : List, is the attached correct? I'd say yes. I do not like much the extra redefinition, but the only other solution is plain \def. BTW, as it is implemented here, if it works reliably, this looks like something that is easy to add natively in LyX. It's in at 646be959.
Re: Changebar module file
Le 01/11/15 23:48, Guillaume Munch a écrit : List, is the attached correct? I'd say yes. I do not like much the extra redefinition, but the only other solution is plain \def. BTW, as it is implemented here, if it works reliably, this looks like something that is easy to add natively in LyX. JMarc
Re: Changebar module file
List, is the attached correct? >From 7879b81f3cd9fccdaa2dd16caa2e4e145753fd0a Mon Sep 17 00:00:00 2001 From: Guillaume MunchDate: Sun, 1 Nov 2015 22:30:38 + Subject: [PATCH] Module for the changebar package Author: Paul A. Rubin (ru...@msu.edu), based on code proposed by Juergen Spitzmueller (http://comments.gmane.org/gmane.editors.lyx.general/6). http://mid.gmane.org/562acbc5.8030...@msu.edu --- lib/Makefile.am | 1 + lib/layouts/changebars.module | 29 + 2 files changed, 30 insertions(+) create mode 100644 lib/layouts/changebars.module diff --git a/lib/Makefile.am b/lib/Makefile.am index 0b17eb1..2362e19 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2005,6 +2005,7 @@ dist_layouts_DATA =\ layouts/book.layout \ layouts/braille.module \ layouts/broadway.layout \ + layouts/changebars.module \ layouts/chess.layout \ layouts/cl2emult.layout \ layouts/ctex-article.layout \ diff --git a/lib/layouts/changebars.module b/lib/layouts/changebars.module new file mode 100644 index 000..6d28e57 --- /dev/null +++ b/lib/layouts/changebars.module @@ -0,0 +1,29 @@ +#\DeclareLyXModule[changebar.sty]{Change bars} +# +#DescriptionBegin +#Enables LyX to add vertical change bars in the margin of PDF output +#when change tracking is turned on and pdflatex output format is chosen. +#DescriptionEnd +# +#Author: Paul A. Rubin (ru...@msu.edu) +#Based on code proposed by Juergen Spitzmueller +#(http://comments.gmane.org/gmane.editors.lyx.general/6). +# +# Note: the \providecommand statements are necessary to avoid +# error messages from the \renewcommand statements if change +# tracking is turned off in the document. +# + +Format 49 + +AddToPreamble + \usepackage{changebar} + \providecommand{\lyxadded}[3]{} + \providecommand{\lyxdeleted}{} + \renewcommand{\lyxadded}[3]{ +{\protect\cbstart\color{lyxadded}{}#3\protect\cbend} + } + \renewcommand{\lyxdeleted}[3]{% +{\protect\cbstart\color{lyxdeleted}\sout{#3}\protect\cbend} + } +EndPreamble -- 2.1.4
Re: Changebar module file
Guillaume Munch lyx.org> writes: > > I see three propositions in this message: > > 1- Having it done natively by LyX instead of using a module. > 2- Having it enabled or disabled according to an option in the > preferences/menu. > 3- Fixing your LaTeX code so that it works for XeTeX. > > 1- would be great. Since it's adding some lines to some LaTeX code > already generated by LyX, it should not be too difficult. One has to be > careful of only doing it for the formats where it works, but it should > not be too difficult to do on LyX's side, or at least it is easy to do > in LaTeX with the package iftex (which includes commands \ifPDFTeX, > \ifXeTeX, and \ifLuaTeX). > > Although 1- seems easy, the surest way to see it done, and not added on > the top of the very long wish-list, is to try and do it yourself. I wish > I can succeed in encouraging you to do so. In particular, not all of us > are fond of C++; in my case I progressively became so overwhelmed with > bugs and annoyances that it became necessary to step up to help LyX go > in the good direction. Also, as I see it, it should be easy to make such > simple fixes without doing anything too C++-idiosyncratic. > > I do not see the rationale for 2-. To me, there are already too many > minuscule options in LyX. Being able to choose whether or not we want > bars in the margin like in the LyX window when showing the changes is > not important IMO. And it becomes much more complicated, because one has > to change the GUI, preferences, translation strings, etc. But even if a > patch implementing 2- was offered if would prefer not to have an > additional option for this and have it automatically (unless I am > missing some point). > > 3- does not seem urgent to me, since in it does not introduce any > regression as far as XeTeX is concerned. I agree that this would get > more confusing if 2- is implemented and the option has no effect in > XeTeX, but it is one more reason for not doing 2-. > > That being said, I can get the module in. Are you satisfied with it and > do you want it? > > Guillaume Guillaume, Regarding point 1, it's been 11 years or so since I last used C++, and I'm afraid that I have forgotten all the nonsense (excuse me, "complexities") of compiler options, linker options and so forth. Even relatively simple things such as I/O escape me now. The learning curve to get back into C++ would be a bit too much for me. That said, I do believe that the change tracking menu is the logical place to put this. On point 2, I personally would be happy to have change bars automatically included in the output whenever changes are being shown in the output. What I do not know is whether other users would agree. There might be a bit of conflict between change bars and margin notes (one overlapping the other). With regard to your third point, I agree that as long as change bars are a module, the problems with XeTeX and also with dvipdfm are not fatal. Going back to point 1, if the decision is that turn on changes in output automatically turns on change bars, it might be disconcerting for users to see them in some output versions but not others; so if this is folded into LyX's code, it might be more important to figure out why it does not work in some cases. Finally, I am satisfied with the module, and in fact I have posted a link to it in the wiki. If it seems to you and the other developers to be something worth bundling, then yes, I would appreciate your putting it in. Best regards, Paul
Re: Changebar module file
Le 25/10/2015 15:37, Paul A. Rubin a écrit : Pavel Sanda lyx.org> writes: This would be nice to have, though I am wondering whether such feature doesn't belong directly to menu, next to 'Show changes in output'. More work, I know... I was hoping it would be a menu choice in an upcoming release. Besides needing someone to do the coding (not me -- I'm severely allergic to C++), I think it would require a solution that works for all output formats (or at least all formats that can show changes). That's currently beyond my (very) limited command of LaTeX, but maybe someone else could pull it off. Paul I see three propositions in this message: 1- Having it done natively by LyX instead of using a module. 2- Having it enabled or disabled according to an option in the preferences/menu. 3- Fixing your LaTeX code so that it works for XeTeX. 1- would be great. Since it's adding some lines to some LaTeX code already generated by LyX, it should not be too difficult. One has to be careful of only doing it for the formats where it works, but it should not be too difficult to do on LyX's side, or at least it is easy to do in LaTeX with the package iftex (which includes commands \ifPDFTeX, \ifXeTeX, and \ifLuaTeX). Although 1- seems easy, the surest way to see it done, and not added on the top of the very long wish-list, is to try and do it yourself. I wish I can succeed in encouraging you to do so. In particular, not all of us are fond of C++; in my case I progressively became so overwhelmed with bugs and annoyances that it became necessary to step up to help LyX go in the good direction. Also, as I see it, it should be easy to make such simple fixes without doing anything too C++-idiosyncratic. I do not see the rationale for 2-. To me, there are already too many minuscule options in LyX. Being able to choose whether or not we want bars in the margin like in the LyX window when showing the changes is not important IMO. And it becomes much more complicated, because one has to change the GUI, preferences, translation strings, etc. But even if a patch implementing 2- was offered if would prefer not to have an additional option for this and have it automatically (unless I am missing some point). 3- does not seem urgent to me, since in it does not introduce any regression as far as XeTeX is concerned. I agree that this would get more confusing if 2- is implemented and the option has no effect in XeTeX, but it is one more reason for not doing 2-. That being said, I can get the module in. Are you satisfied with it and do you want it? Guillaume
Re: Changebar module file
Pavel Sanda lyx.org> writes: > > This would be nice to have, though I am wondering whether such feature doesn't > belong directly to menu, next to 'Show changes in output'. More work, I know... I was hoping it would be a menu choice in an upcoming release. Besides needing someone to do the coding (not me -- I'm severely allergic to C++), I think it would require a solution that works for all output formats (or at least all formats that can show changes). That's currently beyond my (very) limited command of LaTeX, but maybe someone else could pull it off. Paul
Re: Changebar module file
Paul A. Rubin wrote: > Hi all, > > Sorry if this breaks any threads, but per Guillaume's request, I'm > attaching the changebar.module file here to save anyone from having to > navigate the repo menu system. This would be nice to have, though I am wondering whether such feature doesn't belong directly to menu, next to 'Show changes in output'. More work, I know... Pavel