[NTG-context] Conditional text appearing in a fixed vertical space

Aditya Mahajan adityam at umich.edu
Wed Jan 12 00:44:15 CET 2022

On Tue, 11 Jan 2022, Gavin via ntg-context wrote:

> Hello List,
> I am making problem sets for a physics class. Solutions use the style defined in the example below, and only appear if the “solution” mode is enabled. I am struggling to get a vertical space for the solution which is the same whether or not the solution is printed. Different problems require different amounts of space, so this should be an argument or key-value.

This is how I would do it: piggyback on framedtext. Note that framedtext doesn't break across pages. So, if you have long answers, a different mechanism is needed. 



% Doesn't work. Why?
% \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]}



Sample question. Always show answer.

\startsolution[height=1in, empty=no]
  Alotta wood!

How much wood? 

  Alotta wood!

You don't need to specify the height:

  \input ward

No more questions.

More information about the ntg-context mailing list