Question: document layout

hi everyone,
i'm trying do a tamplate for solving school problem. I need only input some variables at begining and it's should give me whole solution. But i need to print it so i have to use this layout style:

i have:
f:=y=x+5
then i use:
subs(x=2,f)

i wanna have inline form
y=x+5=2+5=7
but i can get only
f=y=x+5subs(x=2,f)=7
this is just for examle of layout i want to get but i don't know how...
if i turn off input the subs(x=2,f) dissappear but gap still remines..

btw does exist a statement by which can i control if expreson is inline or not?
Please Wait...