Add SVN branch name to LaTeX cover page

I want to add the name of the SVN branch (under the heading) as a kind of version information. I want this to be done automatically, so when copying files generating documentation to another (new) branch, I get this information automatically. Any clues?

Thanks!

+4
source share
2 answers

Thanks for pointing me in the right direction! Thus, the svn package (e.g. svn-multi ) and xstring .

  • First set the keywords property in the tex file:

    svn propset svn: keywords "URL Date Rev"> your_file <.tex

  • Next, add the .tex file to the beginning:

    \ svnidlong

    {$ HeadURL $}

    {$ LastChangedDate $}

    {$ LastChangedRevision $}

    {$ LastChangedBy $}

  • Then, add a line like this to the body of the document (depending on what you want to extract)

    \StrBetween{\svnmainurl}{branches/}{/sourcecode} \\

  • Complete the .tex file for svn so that the data fills up

And this!:)

+1
source

Look at keyword substitution:

http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html

Edit:

Or, alternatively, you can use the svn info to get the path from your working copy, write it to a file, read the contents and parse using a regular expression. I assume you have some kind of build process that you use to create an output from a LaTeX source?

Also the publication here: http://magic.aladdin.cs.cmu.edu/2006/09/28/subversion-keywords-and-latex/ contains additional information about how you do it.

And here: http://www.ctan.org/pkg/svninfo

+1
source

Source: https://habr.com/ru/post/1344595/


All Articles