Related to this question I am trying to generate a figure using package chemfig. Actually, my problem is that the lower part of the figure is cropped, specifically the H under the N.

This is the code:


Below, you see the figure as I got:

enter image description here

and as it should be:

enter image description here

  • Is there an environment version of \chemfig? e.g. \begin{chemfig}... \end{chemfig}? If so, use that and add \standaloneenv{chemfig} to the preamble. – cfr Aug 16 '15 at 14:07
  • @cfr I'm curious: why would or should that help? – clemens Aug 16 '15 at 14:31
  • 1
    @clements In fact, it does not help. – werty Aug 16 '15 at 14:56
  • @clemens It might not but it does with e.g. forest. If you are using forest, setting \standaloneenv{forest helps standalone get the cropping etc. correct. Especially if you are using multi because standalone starts a new page for each standaloneenv, which does not include forest by default. But I don't know if there is a macro equivalent e.g. \standalonecmd{} - I've never seen this. Then again, maybe I've just not looked in the right place? – cfr Aug 16 '15 at 16:17
  • @cfr Ah OK. I never used forest so I can't compare if the problems are anywhere similar to \chembelow in this case… – clemens Aug 16 '15 at 16:31

Use \Chembelow (upper case!) instead of \chembelow. From the manual (emphasis by me):

The macro[...]


place[s] the <stuff> [...] below the <code> [...] without changing the bounding box of <code>.

The uppercase version on the other hand does extend the bounding box. (\lewis and \Lewis have the same relationship, by the way.)

  • It works! Great! – werty Aug 16 '15 at 14:57

The Chembelow macro can be used but the result is not perfect since the bounding box (too high) modifies the position of bonds coming and leaving N:

enter image description here

\Chembelow cannot give a good result and \chembelow sends H outside the croping. A solution is to use an invisible bond (the .25 lenght found with try/error):


enter image description here

Pershaps the better solution, but more verbose, is to use \chemfig* (with a star) since it the length of the invisible bond can be set to 0 (0 is 0.0001 for tikz):


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.