Excess whitespace below figure drawn in Texmacs

Hi,

I’ve been using Texmacs for writing notes for a while now. Only recently did I attempt to draw figures using Texmacs’ “Draw image…” mode. After drawing an image (not in a Figure environment), I do “crop” with the hope of tightly cropping in. But doing so always results in a lot of whitespace below the drawing.

Is there a way to remove that whitespace?

Thanks.

Hi @fyzx and welcome to the forum.
I have not been able to reproduce the effect you reported. Here is a screenshot of what I obtained:


Maybe you could post a short document where the whitespace appears (open the TeXmacs file with a text editor, copy all and paste here in a copy block).

G.

This is what I see, certainly with the whitespace:

I’m not sure how to share the .tm file, since the forum upload does not seem to allow non-image files

In an “artificial way”: open the TeXmacs file with a text editor, copy all and paste here in a code block (not “copy block” as I wrote in my previous message) :slight_smile:

I get something similar, seems a bug to me.

<with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0.5gw|0.5gh>>|gr-geometry|<tuple|geometry|1par|0.6par>|gr-auto-crop|true|<graphics||<line|<point|-6.7856|3.53423>|<point|-4.34778079110994|3.3556356660934>|<point|-4.44600806985051|1.52503638047361>|<point|-6.74095449133483|1.64112316443974>>>>

sdsad

Also, once cropping is enabled, editing figures can cause the graphics box to resize in strange way, getting way to big for the page with only minor shifts of the points.

So here is the contents of the .tm file:

<TeXmacs|1.99.20>

<style|generic>

<\body>
This is a test. Figure below:

<with|gr-mode|<tuple|edit|cline>|gr-frame|<tuple|scale|1cm|<tuple|0.5gw|0.5gh>>|gr-geometry|<tuple|geometry|1par|0.6par>|gr-grid|<tuple|empty>|gr-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-edit-grid-aspect|<tuple|<tuple|axes|none>|<tuple|1|none>|<tuple|10|none>>|gr-edit-grid|<tuple|empty>|gr-edit-grid-old|<tuple|cartesian|<point|0|0>|1>|gr-auto-crop|true|<graphics||<cline|<point|-4|4>|<point|-3.0|3.0>|<point|-4.0|2.0>|<point|-5.0|2.5>>>>

This is some text.

<\initial>
<\collection>
<associate|page-medium|paper>

1 Like

So what is the suggested way to draw an image with text wrapped tightly around it? (Or at least symmetrically around it)

I usually resize the graphics manually (Alt+arrow key shortcut on my systems) and then move the object to the center with the arrow keys.

1 Like

Now I have got both effects (tight cropping, and cropping with too much white space):

I paste below the file. I do not see significant differences between the tightly cropped drawing and the one with the white space below.

<TeXmacs|2.1>

<style|generic>

<\body>
  <with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0.5gw|0.5gh>>|gr-geometry|<tuple|geometry|1par|0.6par>|gr-auto-crop|true|<graphics||<point|-3.32086|1.60659>|<point|-2.10641|-0.197215>|<point|-0.838388|0.356429>|<line|<point|-3.32086|1.60659>|<point|-2.10641|-0.197215>|<point|-0.838388|0.356429>|<point|-3.32086|1.60659>|<point|-2.76721457864797|1.91020637650483>>>>

  Test

  <with|gr-mode|<tuple|edit|line>|gr-frame|<tuple|scale|1cm|<tuple|0.5gw|0.5gh>>|gr-geometry|<tuple|geometry|1par|0.6par>|gr-auto-crop|true|<graphics||<line|<point|-6.7856|3.53423>|<point|-4.34778079110994|3.3556356660934>|<point|-4.44600806985051|1.52503638047361>|<point|-6.74095449133483|1.64112316443974>>>>

  sdsad
</body>

<\initial>
  <\collection>
    <associate|page-medium|paper>
    <associate|preamble|false>
  </collection>
</initial>
1 Like

If we do not figure out the origin of the white space, it is best to submit a bug report.
Clicking on the “white-space” drawing, I see a gray frame surrounding the white space; the gray frame usually means that the environment you have selected (cyan frame) is nested within another environment (gray frame), but here I do not see the outer environment.

The result seems to depend on the initial position of the drawing when enabling cropping. I can get white spaces before or after when the drawing is positioned near the top or bottom edges of the drawing, but no spaces if it’s positioned in the center.

1 Like

I tested cropping a bit. They white space depends on the position of the drawing in the canvas, if you draw on the center, the cropping is tight, and on the left-upper corner one gets the white space. I would apply the suggestion of @jeroen and one of us can submit a bug report.

1 Like

I can also replicate this behavior: drawing in the center of the initial canvas crops in tight, whereas drawing elsewhere results in the whitespace. And I also see the gray outer box.

Indeed this sounds like a bug. Let me know if you need me to report it.

https://savannah.gnu.org/bugs/?group=texmacs
I searched for “crop” in the bugs and there is nothing, so I think you can report it.

Like @jeroen I use the manual method, never felt the need for a dedicated crop functionality (95% of my drawings are commutative diagrams)