-
-
Save Lenchik/1cbb3933aeb58353deb82c932e45968f to your computer and use it in GitHub Desktop.
Код для печати git hash в колонтитуле
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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