float margin differs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

float margin differs

patrix
In my document I am using a lot of floats and float groups to let text flow around images. However the margin around (at the left) of these images differ a lot and are often way too large.

I am not sure what I am doing wrong. This is the code I use to put floating images in the document:

[.clearfix]
.Process flow: Measure and Store
image::doc-images/doc-measure-and-store.svg[float="left", width=33%, scalewidth=5cm]
[.clearfix]

I have tried these with and without the <nabble_embed>[.clearfix]</nabble_embed> tags.

This renders (in HTML) to this (mark the distance between the float and the text):
float and text margin problem
Reply | Threaded
Open this post in threaded view
|

Re: float margin differs

patrix
I figured it out.

I need to clear the floats. I do this by adding [.clearfix] in front of all sections or at other relevant points.

What I do not like about this solution is that [.clearfix] generates a <div>, if there is no block after the [.clearfix] than it will not close the <div> (or it does it somewhere, where I did not expect it).

Can we detect this fact of not having a block after the [.clearfix] and (for those cases only) just add </div> in the same line?
Reply | Threaded
Open this post in threaded view
|

Re: float margin differs

mojavelinux
Administrator
I'm glad to hear you figured it out!

What you are asking is something you can do with your own converter. It's out of scope for the built-in converter in core. AsciiDoc is not a general purpose layout language. But you are free to customize the HTML that it generates using a custom converter.

Best,

-Dan

On Tue, Dec 10, 2019 at 8:51 AM patrix [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I figured it out.

I need to clear the floats. I do this by adding [.clearfix] in front of all sections or at other relevant points.

What I do not like about this solution is that [.clearfix] generates a <div>, if there is no block after the [.clearfix] than it will not close the <div> (or it does it somewhere, where I did not expect it).

Can we detect this fact of not having a block after the [.clearfix] and (for those cases only) just add </div> in the same line?


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/float-margin-differs-tp7403p7408.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux