I was asked to write the equation for a reaction between Pentanoic acid and ethanol.
In the markscheme the answer is in the structural formula, even though this wasn't specified in the question
Is the shorthand formula just as correct?
What exactly do you mean shorthand, eg C5H10O2? If the question didn't specify, you should be fine; what did the question ask for? In the real exam, to be safe, get in the habit of writing full structural for simple structures, but don't use that one for skeletal.