Skip to content

Broken equations #10096

Closed
Closed
@meator

Description

@meator

Describe the bug
I am trying to render simple equations via doxygen's builtin LaTeX capabilities. But they seem to be (slightly) broken.

Here is my MRE:

/**
\mainpage
\f{align*}{
  \mathit{VAL} &= [7, 6, 3, 4, 3, 8, 1, 7, 9, 5, 4, 9] \\
  \mathit{IR} &= [1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 6, 6] \\
  \mathit{IC} &= [1, 3, 2, 4, 5, 3, 5, 6, 1, 5, 2, 6] \\
\f}
*/

I have named this file test.dox to make doxygen find it. It also requires EXTRA_PACKAGES = {amsmath} in the
Doxyfile for the align* environment.

The rendered equation has a weird gray background (it should be black) and the last line
(beginning with IC) doesn't have square brackets around 1, 3, 2, 4, 5, 3, 5, 6, 1, 5, 2, 6.

This is what doxygen produces for the dark version of the equation: _formulas_dark.txt (This file is actually .tex but GitHub doesn't allow me to upload files with that extension).

When I run pdflatex on this, I get the expected output: _formulas_dark.pdf. But doxygen's output is broken.

Screenshots
Here is the (broken) equation (generated by Dockerfile below):
image
This is the same example but with FORMULA_FONTSIZE = 20 to make it more visible:
image
It looks like there are some traces of the missing square brackets in the screenshots if you look carefully.

To Reproduce
Here is the entire directory: latex.tar.gz.

I have created a Dockerfile that can reproduce the problem:

FROM ghcr.io/void-linux/void-linux:latest-full-x86_64

# These commands can take a while to complete.
RUN <<EOF
# Update
echo noextract=/etc/hosts > /etc/xbps.d/hosts.conf
xbps-install -ySu xbps
xbps-install -ySu

# Install essential packages.
xbps-install -y gcc grml-zsh-config zsh ncurses-term texlive texlive-latexextra texlive-dvi nano
# Clear unnecessary cache.
rm /var/cache/xbps/*
EOF

# Use zsh (Void uses dash which is very limited).
RUN chsh -s /usr/bin/zsh
CMD ["/usr/bin/zsh"]

# XBPS doesn't package the latest version of doxygen yet, so this installs it.
ADD https://github.com/doxygen/doxygen/releases/download/Release_1_9_7/doxygen-1.9.7.linux.bin.tar.gz /
RUN tar --strip-components=1 -C /usr -xf doxygen-1.9.7.linux.bin.tar.gz doxygen-1.9.7/bin

# Set up the project.
RUN mkdir project
WORKDIR project
RUN cat <<EOF > test.dox
/**
\mainpage
\f{align*}{
  \mathit{VAL} &= [7, 6, 3, 4, 3, 8, 1, 7, 9, 5, 4, 9] \\\\
  \mathit{IR} &= [1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 6, 6] \\\\
  \mathit{IC} &= [1, 3, 2, 4, 5, 3, 5, 6, 1, 5, 2, 6] \\\\
\f}
*/
EOF
RUN doxygen -g && echo 'EXTRA_PACKAGES = {amsmath}' >> Doxyfile

RUN echo "echo Hi. Meator here. Use \\\'doxygen\\\' to reproduce." >> ~/.zshrc

Version
The Dockerfile uses version 1.9.7 (a2f34e1ed90f83713dc347b5134920f32c455d46), but I have tested this on 1.9.7
and 1.9.5 (both compiled through my package manager). I am running Void Linux.

Additional context
It was working flawlessly for me before but suddenly it broke. I have created the Dockerfile to try to verify that I didn't
break anything on my system but the clean Dockerfile is also broken. Could this be caused by a missing dependency?
I get no warnings nor errors when running doxygen.

Void is rolling release, so an update could have broken it. I know for sure that this wasn't caused by an update of doxygen
itself, it could have been one of the tools that are used by doxygen to convert LaTeX into image. If I knew exactly how
doxygen converts LaTeX into image, I could maybe debug this further. How does it do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions