会议标题应用于所有页面

会议标题应用于所有页面

我当前的代码(基本上是@Werner 的触摸)将标题添加到每个页面,而它只能添加到第一页。

您能给我一些建议来解决这个问题吗?

我可以添加\thispagestyle{empty}到其他页面以删除页眉。但这听起来像是一个肮脏的解决方案!

%% bare_conf.tex
%% V1.4b
%% 2015/08/26
\documentclass[conference]{IEEEtran}

\usepackage[mathlines,switch]{lineno}

\makeatletter

%%%%%%%%%%%for copyright notice
\def\ps@IEEEtitlepagestyle{%
    \def\@oddfoot{\mycopyrightnotice}%
    \def\@evenfoot{}%
}
\def\mycopyrightnotice{%
    {\footnotesize  978-1-4799-6773-5/14/\$31.00 \textcopyright2017 Crown\hfill}
    \gdef\mycopyrightnotice{}
}
%%%%%%%%%%%

\let\old@ps@headings\ps@headings
\let\old@ps@IEEEtitlepagestyle\ps@IEEEtitlepagestyle
\def\confheader#1{%
    % for all pages except the first
    \def\ps@headings{%
        \old@ps@headings%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    % for the first page
    \def\ps@IEEEtitlepagestyle{%
        \old@ps@IEEEtitlepagestyle%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    \ps@headings%
}
\makeatother

\confheader{%
        \parbox{20cm}{2017 14th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE)\\, Mexico, City. Mexico. September 20-22, 2017.}
}

\begin{document}

    \title{X}

    \author{\IEEEauthorblockN{{X}
            \IEEEauthorblockA{H}\\
            J\\
            I\\
            Email: [email protected]}
    }

    \maketitle

    \begin{abstract}

    \end{abstract}

    \IEEEpeerreviewmaketitle

\end{document}

答案1

您在所有页面上\@oddhead都使用相同的...\@evenhead

因此替换

\let\old@ps@headings\ps@headings
\let\old@ps@IEEEtitlepagestyle\ps@IEEEtitlepagestyle
\def\confheader#1{%
    % for all pages except the first
    \def\ps@headings{%
        \old@ps@headings%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    % for the first page
    \def\ps@IEEEtitlepagestyle{%
        \old@ps@IEEEtitlepagestyle%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    \ps@headings%
}

只需

\let\old@ps@IEEEtitlepagestyle\ps@IEEEtitlepagestyle
\def\confheader#1{%
    % for the first page
    \def\ps@IEEEtitlepagestyle{%
        \old@ps@IEEEtitlepagestyle%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    \ps@headings%
}

梅威瑟:

%% bare_conf.tex
%% V1.4b
%% 2015/08/26
\documentclass[conference]{IEEEtran}

\usepackage[mathlines,switch]{lineno}

\usepackage{lipsum}

\makeatletter

%%%%%%%%%%%for copyright notice
\def\ps@IEEEtitlepagestyle{%
    \def\@oddfoot{\mycopyrightnotice}%
    \def\@evenfoot{}%
}
\def\mycopyrightnotice{%
    {\footnotesize  978-1-4799-6773-5/14/\$31.00 \textcopyright2017 Crown\hfill}
    \gdef\mycopyrightnotice{}
}
%%%%%%%%%%%

\let\old@ps@IEEEtitlepagestyle\ps@IEEEtitlepagestyle
\def\confheader#1{%
    % for the first page
    \def\ps@IEEEtitlepagestyle{%
        \old@ps@IEEEtitlepagestyle%
        \def\@oddhead{\strut\hfill#1\hfill\strut}%
        \def\@evenhead{\strut\hfill#1\hfill\strut}%
    }%
    \ps@headings%
}
\makeatother

\confheader{%
        \parbox{20cm}{2017 14th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE)\\, Mexico, City. Mexico. September 20-22, 2017.}
}

\begin{document}

    \title{X}

    \author{\IEEEauthorblockN{{X}%
            \IEEEauthorblockA{H}\\
            J\\
            I\\
            Email: [email protected]}
    }

    \maketitle

    \begin{abstract}

    \end{abstract}

    \IEEEpeerreviewmaketitle

    \lipsum[1-10]

\end{document} 

输出:

在此处输入图片描述

相关内容