[Tex/LaTex] IEEE tran: How to left justify Single column headings in Lyx

horizontal alignmentieeetranlyxsectioning

I'm using LyX and have created an IEEE tran document. It says in the documentation that in order to make the document single column all one has to do is add the following to the class option:
journal,10pt,draftclsnofoot,onecolumn
I've done this and my document is now in a single column format. HOWEVER, my heading are all centered! I have read the documentation of the IEEE tran class (found at http://www.cs.cmu.edu/~steffan/personal/tmp/IEEEtran_HOWTO.pdf) and it says that the the default setting is to left justify headings, but for some reason that's not happening with my document.

Any help would really be appreciated!

Best Answer

The following does answer the question, but journal-specific alterations should be avoided.

To your Document > Settings... > LaTeX Preamble add

\usepackage{etoolbox}

% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\section}{\centering}{}{}{}

which removes the \centering definition from the \section command (taken from ieeetran.cls):

\def\section{\@startsection{section}{1}{\z@}{3.0ex plus 1.5ex minus 1.5ex}% V1.6 3.0ex from 3.5ex
  {0.7ex plus 1ex minus 0ex}{\normalfont\normalsize\centering\scshape}}%

enter image description here