Abstract: Highlights•Proposing a tree-based model for handwritten mathematical expression recognition.•Performing explicit symbol recognition and relationship prediction between symbols.•Proposing a query constructing module to decode the branches of trees in parallel.•Reducing the number of decoding steps and improving the recognition performance.