创建用于制作脚注的新命令

创建用于制作脚注的新命令

跟随一些我之前得到的代码,我正在为论文的元数据(如标题、作者等)创建宏。现在我想创建自己的\thanks宏,该宏应跟在标题后面。但在这种情况下,结果只是在标题后面打印了内容\mythanks,而不是创建脚注。我怎样才能让它生成脚注呢?

\documentclass{article}

\makeatletter
    \newcommand\@mytitle{} % create macro for title
    \newcommand\mytitle[1]{\renewcommand\@mytitle{#1}}
    \newcommand\@mythanks{\footnote} % create macro for thanks note
    \newcommand\mythanks[1]{\renewcommand\@mythanks{#1}}
    \newcommand\@myauthor{} % create macro for author
    \newcommand\myauthor[1]{\renewcommand\@myauthor{#1}}
    \newcommand{\articletitle}{%
        \begingroup%
            \centering%
            \fontsize{18bp}{18bp}\selectfont%
            \@mytitle\@mythanks\par%
            \vspace{\baselineskip}%
            \fontsize{14bp}{14bp}\selectfont%
            \@myauthor\par%
            \fontsize{12bp}{12bp}\selectfont%
            \vspace{2\baselineskip}%
        \endgroup}
\makeatother

\mytitle{This is my title}
\mythanks{These are my acknowledgements}
\myauthor{This is the author}

\AtBeginDocument{\articletitle}

\begin{document}
I start writing here
\end{document}

在此处输入图片描述

答案1

在此处输入图片描述

在此处输入图片描述

平均能量损失

\documentclass{article}

\makeatletter
    \newcommand\@mytitle{} % create macro for title
    \newcommand\mytitle[1]{\renewcommand\@mytitle{#1}}
    \newcommand\@mythanks{} % create macro for thanks note
    \newcommand\mythanks[1]{\renewcommand\@mythanks{%
      \gdef\@thefnmark{*}\@footnotetext{#1}}
    }
    \newcommand\@myauthor{} % create macro for author
    \newcommand\myauthor[1]{\renewcommand\@myauthor{#1}}
    \newcommand{\articletitle}{%
        \begingroup%
            \centering%
            \fontsize{18bp}{18bp}\selectfont%
            \@mytitle%
            \@mythanks%
            \par
            \vspace{\baselineskip}%
            \fontsize{14bp}{14bp}\selectfont%
            \@myauthor\par%
            \fontsize{12bp}{12bp}\selectfont%
            \vspace{2\baselineskip}%
        \endgroup}
\makeatother

\mytitle{This is my title}
\mythanks{These are my acknowledgements}
\myauthor{This is the author}

\AtBeginDocument{\articletitle}

\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}

相关内容