Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color related issues #268

Open
mstsirkin opened this issue May 3, 2022 · 3 comments
Open

color related issues #268

mstsirkin opened this issue May 3, 2022 · 3 comments
Labels
Low On hold Waiting for more input from reporter

Comments

@mstsirkin
Copy link

we are changing colors for latexdiff: our document has lots of URLs
which are blue, so we are using green for added text.
Two issues arise:

  1. URLs within added text are still blue.
    would be nice to be able to change their color to green too (maybe
    a different shade).

  2. when there are differences within listings,
    these use styles from DIFCODE_UNDERLINE and seem to ignore whatever
    we put in preamble.

@ftilmann
Copy link
Owner

Sorry, this has been sitting around for some time. I hope answers are still useful. The request is probably a bit too niche compared to some other open issues, so that I will be not be able to tackle this myself in the foreseeable future, but I try to give some pointers. If you come up with a workable solution, we can see how to integrate it into latexdiff.

  1. URLs within added text are still blue.
    would be nice to be able to change their color to green too (maybe
    a different shade).

I presume the \url command (if that is what you are using) is excluded from the argument of \DIFadd to prevent interference. I don't know the hyperref package very well (if that is what you are using for url's but presumably there is a command to change link color locally, or an option to \url to choose the colour. If so you could redefine \DIFaddbegin to change link colour to green and \DIFaddend to change link colour back to blue. How to do this in TeX/latex is a bit involved but you can look at preamble section HIGHLIGHTGRAPHICS how such redefinitions are set up.

@ftilmann
Copy link
Owner

ftilmann commented Sep 25, 2022

  1. when there are differences within listings,
    these use styles from DIFCODE_UNDERLINE and seem to ignore whatever
    we put in preamble.

If you generate the diff file, the preamble should contain a section

%DIF DIFCODE_UNDERLINE %DIF PREAMBLE
  moredelim=[il][\color{red}\sout]{\%DIF\ <\ }, %DIF PREAMBLE
  moredelim=[il][\color{blue}\uwave]{\%DIF\ >\ } %DIF PREAMBLE
} %DIF PREAMBLE

You should simply be able to change blue to green here. Do you mean you do this and it still comes out blue? That would be a bug that I would feel compelled to tackle but would need more detail, e.g. a MWE. To avoid having to make this change every time you could save the whole latexdiff additions to preamble in a separate file and use --preamble option to load it. If you already do this and it comes out blue, then again that would be a bug, but more detail would help, ideally an MWE and your preamble file.

@ftilmann ftilmann added Low On hold Waiting for more input from reporter labels Sep 25, 2022
@cniethammer
Copy link

I would like to jump in and bump up this request for changing colors via the preamble file.

Currently I try to generate diffs for the MPI Standard that includes a lot of latex code in listing environments. Having a latexdiff related file in the main directory of this 1000+pdf pages document is not desirable. A single configuration file would be highly favored.
Note: An option I see would be to be able to give a custom latexdiff-configuration directory for these kind of extension files - if easier to implement.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Low On hold Waiting for more input from reporter
Projects
None yet
Development

No branches or pull requests

3 participants