Add a version number to the title of a LaTeX document

前端 未结 8 1397
攒了一身酷
攒了一身酷 2021-02-04 07:17

The title section of my LaTeX documents usually look like

\\title{Title}
\\author{Me}
%\\date{}      %// Today\'s date will appear when this is commented out.

\         


        
8条回答
  •  伪装坚强ぢ
    2021-02-04 07:39

    For many version control systems, the checkin and checkout programs will expand certain strings in the documents into metadata the version control system has about the system, including the version number.

    If you include these strings in the body of Tex definitions, then you can use them in your documents.

    It's hard to say more without knowing which version control system you are using, but CTAN has the vc bundle, and rcs.sty is nice to use, for folks still using not only non-distributed, but not even concurrent VC...

    Once you've got the strings (oh, I see you said manual entry is OK), you can then typeset this using

    \title{Title\\\normalsize Version \versionnumber}
    

    If you really want the author in between, then you can't use \title and \author together in the usual way - you should put your name on another line in the \title command.

提交回复
热议问题