Built-in night mode + LaTeX (background color problem)

Vinicius's Avatar

Vinicius

26 May, 2020 01:15 AM

I make some cards in LaTeX. Sometimes there are problems with LaTeX color inversion — which there wasn't in the Night mode add-on — in the night mode built into Anki, what happens is that the background color becomes black instead of the standard background color of the built-in night mode.

There are times that even plain text gets the wrong background color, as you can see on the images.)

  1. 1 Posted by Vinicius on 26 May, 2020 03:19 AM

    Vinicius's Avatar

    At first sight, I managed to fix this problem. I needed to install Edit LaTeX build add-on (https://ankiweb.net/shared/info/937148547) and change the default option (Add-ons -> Edit LaTeX build -> Config) to

    {
        "pngCommands": [
            [
                "latex",
                "-interaction=nonstopmode",
                "tmp.tex"
            ],
            [
                "dvipng",
                "-D",
                "200",
                "-T",
                "tight",
                "-bg",
                "Transparent",
                "tmp.dvi",
                "-o",
                "tmp.png"
            ]
        ],
        "svgCommands": [
            [
                "latex",
                "-interaction=nonstopmode",
                "tmp.tex"
            ],
            [
                "dvisvgm",
                "--no-fonts",
                "-Z",
                "2",
                "tmp.dvi",
                "-o",
                "tmp.svg"
            ]
        ]
    }

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac