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

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

问题描述

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

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.

\begin{document}
\maketitle

我真的很想在标题部分添加另一行以获取版本号:

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

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

\begin{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天全站免登陆