DiffStyle

DiffStyle

is an option for Diff and related functions that specifies styles to use when viewing changes.

Details

  • DiffStyleassoc can use the following keys to describe different elements of the diff result:
  • "Added"style for added elements
    "Changed"style for changed elements
    "Conflict"style for conflicts
    "NotChanged"style for elements that have not changed
    "Removed"style for removed elements
  • Color directives such as Red, as well as text specifications such as Bold or Small, can be given in place of options, just as in Style.
  • Using DiffStyle<|keyspec|> is effectively equivalent to replacing the diff elements specified by key with Style[diffelement,spec].
  • DiffStyle is applied after DefaultDiffStyle.

Examples

Basic Examples  (3)

Increase the font size of added characters:

Italicize removed characters:

Customize styles in a unified diff:

Wolfram Research (2024), DiffStyle, Wolfram Language function, https://reference.wolfram.com/language/ref/DiffStyle.html.

Text

Wolfram Research (2024), DiffStyle, Wolfram Language function, https://reference.wolfram.com/language/ref/DiffStyle.html.

CMS

Wolfram Language. 2024. "DiffStyle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DiffStyle.html.

APA

Wolfram Language. (2024). DiffStyle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiffStyle.html

BibTeX

@misc{reference.wolfram_2024_diffstyle, author="Wolfram Research", title="{DiffStyle}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/DiffStyle.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_diffstyle, organization={Wolfram Research}, title={DiffStyle}, year={2024}, url={https://reference.wolfram.com/language/ref/DiffStyle.html}, note=[Accessed: 21-November-2024 ]}