Skip to content
Permalink
Browse files
Optimized.
  • Loading branch information
Robin Schneider committed Jun 16, 2013
1 parent 489927f commit 6d0ff0a6ae2baba715704f7dea23ebb0ac9ddc02
Showing with 53 additions and 26 deletions.
  1. +21 −15 scripts/latex-git-log/{README → README.md}
  2. +32 −11 scripts/latex-git-log/latex-git-log
@@ -1,28 +1,38 @@
latex-git-log
~~~~~~~~~~~~~
# latex-git-log
This program will output the entire version history as table written in LaTeX
if it is executed within a git repository.

It is intended that you redirect the standard output of this script to a file
which can then be included from your main TeX document.

The table is using the longtable package and the links to a web resource for
each commit use the \href macro from hyperref. So this two packages have to be
## Dependencies
### Of this script
This module requires these other modules and libraries:

IPC::System::Simple
Locale::Maketext::Simple

Everything else should already be installed.

### To compile the output
The table is using the B<longtable> package and the links to a web resource for
each commit use the \href macro from B<hyperref>. So this two packages have to be
loaded.

Furthermore you need to defined the macro \longtableendfoot which will be
Furthermore you need to defined the macro B<\longtableendfoot> which will be
expanded on the bottom of every page if the table will be continued on the next
page. You can defined it to a localized message to inform the reader that this
table is not complete and will be continued.

Because the table can be very large you might want to put the thing on a
landscape page.

## License and Copyright
Copyright (C) by Robin Schneider <ypid23@aol.de>
Source code repository: https://github.com/ypid/typesetting
Please report bugs and feature requests at https://github.com/ypid/typesetting/issues

Usage:
## Usage:
latex-git-log [options]

Options:
@@ -34,15 +44,17 @@ Usage:
--user set a github user to derive the base URL
--repo set a github repository to derive the base URL
--lang language of the legend and all strings in the output
--version, -v print version of this script
--help brief help message
--man full documentation

Options:
--width Set the width in cm of the commit message field in the LaTeX
table. If this parameter is not set then the table is not
verticly limited. That means that if you have a very long commit
message then the table will not actually on the page and you
will get a "Overfull" error message from TeX.
vertically limited. That means that if you have a very long
commit message then the table will not actually be completely
fit on the page and you will get a "Overfull" error message from
TeX.

In this case you should specify the width of the column
containing the commit messages. I normally use something like
@@ -60,9 +72,3 @@ Options:
need a translation to another language then you can either
create a .po file or I can register this project on one of those
websites for online translation.

Usage:
You can use it like this:

latex-git-log --width=6 --lang=en > example-output.tex

@@ -33,6 +33,7 @@ my $print_author = 0;
my $commit_count = 1;
my $width = 0;
my $lang = undef;
my $version = 0;
my $help = 0;
my $man = 0;
my ( $git_user, $git_repo, $git_commit_address );
@@ -44,11 +45,13 @@ GetOptions(
'user=s' => \$git_user,
'repo=s' => \$git_repo,
'lang=s' => \$lang,
'version' => \$version,
'help|?' => \$help,
'man' => \$man,
);
pod2usage(1) if $help;
pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;
pod2usage( -verbose => 2, -exitstatus => 0, ) if $man;
pod2usage( -verbose => 99, -sections => 'Version' ) if $version;
my $git_remote = ( split /\n/xms, capturex(qw(git remote -v)) )[0];

loc_lang($lang) if (defined $lang);
@@ -169,12 +172,12 @@ for (@lines) {
say '\end{longtable}';
# }}}

# Documentation {{{
__END__
# Documentation {{{
=head1 NAME
latex-git-log - output the version history of git as LaTeX source code.
latex-git-log - output the version history of a git project as LaTeX source code.
=head1 SYNOPSIS
@@ -189,6 +192,7 @@ Options:
--user set a github user to derive the base URL
--repo set a github repository to derive the base URL
--lang language of the legend and all strings in the output
--version, -v print version of this script
--help brief help message
--man full documentation
@@ -198,10 +202,11 @@ Options:
=item B<--width>
Set the width in cm of the commit message field in the LaTeX table. If this
parameter is not set then the table is not verticly limited. That means that if
you have a very long commit message then the table will not actually on the
page and you will get a "Overfull" error message from TeX.
Set the width in cm of the commit message field in the LaTeX table. If this
parameter is not set then the table is not vertically limited. That means that
if you have a very long commit message then the table will not actually be
completely fit on the page and you will get a "Overfull" error message from
TeX.
In this case you should specify the width of the column containing the commit messages.
I normally use something like --width=14 for DIN A4 in landscape.
@@ -222,23 +227,35 @@ this project on one of those websites for online translation.
=back
=head1 USAGE
=head1 Example
You can use it like this:
latex-git-log --width=6 --lang=en > example-output.tex
=head1 DEPENDENCIES
The table is using the longtable package and the links to a web resource for
each commit use the \href macro from hyperref. So this two packages have to be
=head2 Of this script
This module requires these other modules and libraries:
IPC::System::Simple
Locale::Maketext::Simple
Everything else should already be installed.
=head2 To compile the output
The table is using the B<longtable> package and the links to a web resource for
each commit use the \href macro from B<hyperref>. So this two packages have to be
loaded.
Furthermore you need to defined the macro \longtableendfoot which will be
Furthermore you need to defined the macro B<\longtableendfoot> which will be
expanded on the bottom of every page if the table will be continued on the next
page. You can defined it to a localized message to inform the reader that this
table is not complete and will be continued.
=head1 DESCRIPTION
B<This program> will output the entire version history as table written in
@@ -250,6 +267,10 @@ which can then be included from your main TeX document.
Because the table can be very large you might want to put the thing on a
landscape page.
=head1 Version
0.9
=head1 AUTHOR
Robin Schneider <ypid23@aol.de>

0 comments on commit 6d0ff0a

Please sign in to comment.