在 LaTeX 文档的标题中添加版本号 [英] Add a version number to the title of a LaTeX document

查看:51
本文介绍了在 LaTeX 文档的标题中添加版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 LaTeX 文档的标题部分通常看起来像

The title section of my LaTeX documents usually look like

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

egin{document}
maketitle

我真的很想在标题部分添加另一行作为版本号:

I'd really like to add another line in the title section for a version number:

	itle{Title}
author{Me}
version{v1.2}
%date{}      %// Today's date will appear when this is commented out.

egin{document}
maketitle

不一定非得是一个名为 version 的命令,但我怎样才能让版本号出现在日期之后(即在作者之后)?我可以手动设置版本号.

It doesn't necessarily have to be a command named version, but how can I get a version number to appear after the date (which is after the author)? I can manually set the version number.

所以:

推荐答案

我的回答对于原线程来说可能已经来不及了,但是Latex有一个非常有趣的包叫做vrsion(没有'e'),这是标准分布的一部分.本质上,它对 .dvi 文件进行编号,即每次运行 Latex 时编号都会增加.

My answer is probably too late for the original thread, but Latex has a very interesting package called vrsion (there is no 'e'), which is part of the standard distribution. Essentially, it numbers the .dvi file, i.e the number is increased every time Latex is run.

就个人而言,我将其用作一个简单的解决方法,因为 Git 缺少对人类友好的文档版本号.不理想,但有时我有多个文档副本,这有助于避免一些混乱.

Personally, I use this as a simple work around for the lack of a human-friendly document version number from Git. Not ideal, but sometimes I have multiple copies of my documents and it helps avoid some confusion.

这篇关于在 LaTeX 文档的标题中添加版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆