I wanted to apply this in R markdown to a pdf output within a chunk, but I had the same issue as Jane Lu (all the subsequent content was centered. To fix this, I used \raggedright instead of the second \center (note the double \ because this is within an r chunk)
Strange that there is no \left or \right functionality, instead you need to use \raggedright or \raggedleft respectively!