0

I am trying to create custom environment (using environ package) which have a vertical line at the left. The height of this line have to equal my environment height.

Bu how to get current environment height?

\NewEnviron{defblock}{%
        \rule{1pt}{ >>?height?<< }\BODY
}
  • 1
    There is a better way, see for example the mdframed or tcolorbox packages. They can do this out of the box. If you do it by hand you need to place the env in a box and measure the total height of that box. This approach will loose you the ability to break your env over two pages. Again those two packages I mentioned, can handle this just fine – daleif Nov 5 '16 at 8:44
  • 1
    Btw: thanks for explaining what you want to do, instead of just plain asking how to get the height of the env, then it is easy to point you towards a better already existing solution to the problem – daleif Nov 5 '16 at 8:46
  • 1
    Update your question with the code you used. And you of course never mentioned any wrapfigure, which are a different beast Al together. Cannot help you there. – daleif Nov 5 '16 at 8:50
  • 2
    environments do not have a natural height, for example they may break over a page. You can put them in a box and measure the box, but that prevents page breaking, floats and most uses of wrapfig, so it all depends what you really want to achieve, and you have given no hints so far. – David Carlisle Nov 5 '16 at 9:22
  • 1
    The simplest is probably to insert it a leftbar environment, from the framed package. It can break across pages. – Bernard Nov 5 '16 at 10:35

Your Answer

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

Browse other questions tagged or ask your own question.