Giter VIP home page Giter VIP logo

Comments (5)

DavidGriffith avatar DavidGriffith commented on May 26, 2024

I was overthinking this. Apparently simply doing \includegraphics{foobar.svg} does the trick. I just need to make sure that command is protected by an \@ifundefined to make sure it doesn't happen when building to PDF.

from svg.

DavidGriffith avatar DavidGriffith commented on May 26, 2024

Thinking this over again, I think perhaps it would be best if the svg package simply passes a command of \includesvg{mysvgfile} along as \includegraphics{mysvgfile.svg}. Your thoughts?

from svg.

mrpiggi avatar mrpiggi commented on May 26, 2024

The basic intention of package svg is to support the LaTeX export capabilities of Inkscape to process all given textual content of svg files with the used document processor (pdflatex, lualatex etc.) in order to use the actual document font. So if you don't want the svg file to be processed by the svg package but include it directly, just do not use it.

Nevertheless I could try to create an optional shortcut when package tex4ebook was loaded. Could you please provide a MWE with the intended workflow?

from svg.

DavidGriffith avatar DavidGriffith commented on May 26, 2024

My intent for this passthrough is to allow for a document to be processed into a PDF document or an EPUB with as few changes or ifdefs as possible. Here's a MWE:

\documentclass[\ifdefined\HCode dvips\fi]{article}
\usepackage{graphicx}
\usepackage{svg}
\parindent=0pt
\begin{document}
Hello world!\\
\includesvg{glider}\\
Wasn't that fun?
\end{document}

That \ifdefined\HCode dvips\fi business is a workaround for a bug in tex4ht which is described here: michal-h21/tex4ebook#50.

Here's glider.svg

<?xml version="1.0" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="140" height="140"><g transform="matrix(20,0,0,20,10,10)"><path d="m0 0h6v6h-6zm0 2h6m-6 2h6m-4-4v6m2-6v6" style="fill:none;stroke:#000;stroke-width:.1;"/><circle cx="3" cy="1" r=".8"/><circle cx="5" cy="3" r=".8"/><circle cx="1" cy="5" r=".8"/><circle cx="3" cy="5" r=".8"/><circle cx="5" cy="5" r=".8"/></g></svg>

from svg.

mrpiggi avatar mrpiggi commented on May 26, 2024

michal-h21/tex4ebook#50 seems to be solved

from svg.

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.