Skip to content

Instantly share code, notes, and snippets.

@ScumCoder
Created August 7, 2016 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ScumCoder/9faf433ac9483e6eabe6b56083234c96 to your computer and use it in GitHub Desktop.
Save ScumCoder/9faf433ac9483e6eabe6b56083234c96 to your computer and use it in GitHub Desktop.
Код для печати git hash в колонтитуле
\usepackage{python}
%Добавляет на каждую страницу hash текущего git-коммита
\begin{python}
#! /usr/bin/python
import os, string
cmd = 'git rev-parse --verify HEAD'
fpipe = os.popen(cmd)
piperesult = fpipe.read()
fpipe.close()
filename='gitstatus.tex'
fout=open(filename,'w')
fout.write(piperesult)
fout.close()
\end{python}
\fancyfoot[R]{}
\fancyfoot[C]{\tiny Версия документа: \input{gitstatus}, компилирован \today}
\fancyfoot[L]{}
% Чтобы убрать полосу вверху страницы, отчёркивающую колонтитул от содержания страницы
\renewcommand{\headrulewidth}{0pt}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment