| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
%% |
| 3 |
%% This file is part of BibTool. |
| 4 |
%% It is distributed under the GNU General Public License. |
| 5 |
%% See the file COPYING for details. |
| 6 |
%% |
| 7 |
%% (c) 1995-2019 Gerd Neugebauer |
| 8 |
%% |
| 9 |
%% Net: [email protected] |
| 10 |
%% |
| 11 |
%% This program is free software; you can redistribute it and/or modify |
| 12 |
%% it under the terms of the GNU General Public License as published by |
| 13 |
%% the Free Software Foundation; either version 2, or (at your option) |
| 14 |
%% any later version. |
| 15 |
%% |
| 16 |
%% This program is distributed in the hope that it will be useful, |
| 17 |
%% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
%% GNU General Public License for more details. |
| 20 |
%% |
| 21 |
%% You should have received a copy of the GNU General Public License |
| 22 |
%% along with this program; if not, write to the Free Software |
| 23 |
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 24 |
%% |
| 25 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 26 |
% |
| 27 |
% Style Impovements. |
| 28 |
% |
| 29 |
% delete empty fields |
| 30 |
|
| 31 |
rewrite.rule {"^\" *\"$"} |
| 32 |
rewrite.rule {"^{ *}$"} |
| 33 |
|
| 34 |
% correct page ranges |
| 35 |
|
| 36 |
rewrite.rule {pages # "\([0-9]+\) *\(-\|---\) *\([0-9]+\)" = "\1--\3"} |
| 37 |
|
| 38 |
% delete delimiters if the field is purely numerical |
| 39 |
|
| 40 |
rewrite.rule {"^[\"{] *\([0-9]+\) *[\"}]$" "\1"} |