Feature Request: Support for `trim`and `clip` for images/figures

Jan 10, 2016 at 6:50 PM
Edited Jan 10, 2016 at 6:50 PM
As in latex: \includegraphics[width=\textwidth, trim=1cm 3cm 3cm 2.5cm, clip=true]{filename}

At the moment I have no idea how to accomplish this with pure madoko syntax. If this is already possible, I'd be thankful for a short hint (the request would be invalid then of course). :)
Jan 10, 2016 at 10:51 PM
ah, trimming is not yet possible; the width can be set using:
as an attribute. Other attributes include height, zoom, and transform-rotate (see here).

The reason I did not include trim is because there is no CSS alternative... I tried the deprecated clip property but it is not working in Chrome. I guess I could still support it so it comes out well in LaTeX but that means it will not show up well in HTML.... Personally, I think it is perhaps better to crop the image in a separate program in then include it in Madoko so it shows up across all platforms. What do you think?

-- Daan
Jan 10, 2016 at 11:21 PM
Yes, a solution that only works in latex isn't really worth the effort (I can do it in a tex block then anyway). Didn't really think about CSS not having any equivalent. My actual concern isn't really trimming but getting rid of margins (in my case lessen the white space between the graphic and the capture). I tried negative margins ({margin-bottom: -10px;}) but this doesn't seem to work. In the end you're right of course: Preparing the graphic in an external app is the cleanest solution. Thanks for your feedback! :)