Ignore optional args provided to heading commands

`\chapter`, `\section`, and etc. commands can take optional arguments in square brackets.  Current implementation does not take account for the presence of the optional arguments.  My patch simply skips the optional arguments inside square brackets.