Placing double line conference name in the header in IEEEtran class

eso-picieeetran

I have been trying to add a conference name in the header of IEEEtran class. I have been following this format. It works fine for single line conference name. When the conference name is 2 line long, the second line become right aligned. I want to make it left aligned.

MWE is given below

\documentclass[conference]{IEEEtran}

\usepackage[T1] {fontenc}
\usepackage{textcomp}
\usepackage{lipsum}
\usepackage{eso-pic}


%------Conference Name-------%
\newcommand\AtPageUpperMyright[1]{\AtPageUpperLeft{%
        \put(\LenToUnit{0.0\paperwidth},\LenToUnit{-1cm}){%
            \parbox{.96\textwidth}{\raggedleft\fontsize{9}{11}\selectfont #1}}%
}}%
\newcommand{\conf}[1]{%
    \AddToShipoutPictureBG*{%
        \AtPageUpperMyright{#1}
    }
}


\begin{document}    
\title{A random xyz manuscript}
\maketitle

        %------conference Name-------%
\conf{2021 5th International Conference on Electrical Engineering and Information \& Communication Technology (ICEEICT)\\ 
    Military Institute of Science and Technology (MIST), Dhaka-1216, Bangladesh}

\begin{abstract}
\lipsum[2-3].
\end{abstract}

\section{Section 1}
\lipsum[1-2]

    \subsection{Subsection A}
    ........
    
\end{document}

Can anyone explain this part of the code – how it becomes right aligned

\newcommand\AtPageUpperMyright[1]{\AtPageUpperLeft{%
        \put(\LenToUnit{0.0\paperwidth},\LenToUnit{-1cm}){%
            \parbox{.96\textwidth}{\raggedleft\fontsize{9}{11}\selectfont #1}}%

Best Answer

So why not just insert a \parbox into the header? \headheight is big enough for two lines.

BTW, it just looked weird without \centering.

\documentclass[conference]{IEEEtran}

\usepackage[T1] {fontenc}
\usepackage{textcomp}
\usepackage{lipsum}
\usepackage{eso-pic}

\makeatletter
\newcommand{\conf}[1]{%
\def\ps@IEEEtitlepagestyle{% default title page headers, no footers
\def\@oddhead{\parbox[b]{\dimexpr \textwidth-\wd\headerbox-\columnsep}{\centering \@IEEEheaderstyle #1}}%
\let\@evenhead\@empty
\def\@oddfoot{\mycopyrightnotice}% 
\let\@evenfoot\@empty}}
\newcommand{\mycopyrightnotice}{\footnotesize 978-0-7381-1102-5/20/\$31.00 $\copyright$ 2021 IEEE\hfill}
\makeatother

%------conference Name-------%
\conf{2021 5th International Conference on Electrical Engineering and Information \& Communication Technology (ICEEICT)\\ 
    Military Institute of Science and Technology (MIST), Dhaka-1216, Bangladesh}

\begin{document}    
\title{A random xyz manuscript}
\maketitle

\begin{abstract}
\lipsum[2-3].
\end{abstract}

\section{Section 1}
\lipsum[1-2]

    \subsection{Subsection A}
    ........
    
\end{document}

If the conference has a logo, you could use that to balance the lopsidedness.

\documentclass[conference]{IEEEtran}
\usepackage{graphicx}
\usepackage[T1] {fontenc}
\usepackage{textcomp}
\usepackage{lipsum}

%------Conference Header-------%
\newsavebox\headerbox
\savebox\headerbox{\includegraphics[height=\headheight]{example-image}}

\makeatletter
\newcommand{\conf}[1]{%
\def\ps@IEEEtitlepagestyle{% default title page headers, no footers
\def\@oddhead{\parbox[b]{\dimexpr \textwidth-\wd\headerbox-\columnsep}{\@IEEEheaderstyle #1}\hfill{\usebox\headerbox}}\relax
\let\@evenhead\@empty
\def\@oddfoot{\mycopyrightnotice}% 
\let\@evenfoot\@empty}}
\newcommand{\mycopyrightnotice}{\footnotesize 978-0-7381-1102-5/20/\$31.00 $\copyright$ 2021 IEEE\hfill}
\makeatother

%------conference Name-------%
\conf{2021 5th International Conference on Electrical Engineering and Information \& Communication Technology (ICEEICT)\\ 
    Military Institute of Science and Technology (MIST), Dhaka-1216, Bangladesh}

\begin{document}    
\title{A random xyz manuscript}
\maketitle

\begin{abstract}
\lipsum[2-3].
\end{abstract}

\section{Section 1}
\lipsum[1-2]

    \subsection{Subsection A}
    ........
    
\end{document}