Code Monkey home page Code Monkey logo

Comments (6)

mgieseki avatar mgieseki commented on July 28, 2024 1

Thanks for reporting the issue. It's a bug in dvisvgm's character handler that's easy to fix. I'll push the patch shortly.

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on July 28, 2024

A simplified example:

\ifnum\pdfoutput>0 % pdf output
  \documentclass[tikz, margin=5pt]{standalone}
\else % dvi output
  \documentclass[dvisvgm, tikz, margin=5pt]{standalone}
\fi

\begin{document}
\begin{tikzpicture}
  \node[draw] {before {\color{gray}GRAY} after};
\end{tikzpicture}
\end{document}
  • Expected (pdflatex output):
    image
  • Actual (latex -> dvisvgm output):
    image

Rrelevant .dvi content (dumped using dviasm). I'm far from familiar with dvi operations hence not able to say if they are alright.

tikz dvips backend
push:
  xxx: 'ps: 0 setgray '
  push:
    fnt: cmr10 at 10pt
    set: 'b'
    right: 0.277786pt
    set: 'efore'
    w: 3.333328pt
    xxx: 'color push gray 0.5'
    set: 'GRA'
    right: -0.833344pt
    set: 'Y'
    xxx: 'color pop'
    w0:
    set: 'after'
  pop:
pop:
xxx: 'ps::[begin]'
xxx: 'ps:: pgfr'
xxx: 'ps:: restore '
xxx: 'ps:: restore '
tikz dvisvgm backend (with document class option `dvisvgm`)
push:
  xxx: 'dvisvgm:raw <g fill="#000">{?nl} '
  xxx: 'dvisvgm:raw <g stroke="none"> '
  push:
    fnt: cmr10 at 10pt
    set: 'b'
    right: 0.277786pt
    set: 'efore'
    w: 3.333328pt
    xxx: 'dvisvgm:raw <g fill="black">'
    xxx: 'color push gray 0.5'
    set: 'GRA'
    right: -0.833344pt
    set: 'Y'
    xxx: 'dvisvgm:raw </g>'
    xxx: 'color pop'
    w0:
    set: 'after'
  pop:
  right: 83.041794pt
  xxx: 'dvisvgm:raw </g> '
  xxx: 'dvisvgm:raw </g>{?nl} '
pop:

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on July 28, 2024

Just a workaround: Since this picture is simple (from ps-special's view, for example no shading no pattern), dvisvgm is able to process the .dvi output of latex without setting tikz backend to dvisvgm (default backend is dvips I think).

Hence the original \documentclass[tikz,border=5mm]{standalone} works.

Unfortunately, this workaround doesn't help automatic compiling required by yuzutech/kroki#1440.

from dvisvgm.

rfdonnelly avatar rfdonnelly commented on July 28, 2024

Thank you for minimizing the example!

from dvisvgm.

muzimuzhi avatar muzimuzhi commented on July 28, 2024

Wow, this once again pushes me to try compiling dvisvgm on macOS, instead of waiting for the update from texlive once a year.

from dvisvgm.

rfdonnelly avatar rfdonnelly commented on July 28, 2024

Thank you @mgieseki!

from dvisvgm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.