To do this, we will not modify the Bibtex file, but rather create an auxiliary file where we will associate categories and comments to a number of the references. For instance, if we want to associate the category "Topological Recursion" and the comment "This article..." to the article whose Bibtex key is "cer12", we will add the following text in the auxiliary file:
\ArticleLabel{cer12}Why would we want to have such categories and comments? Categories are particularly useful if they match some classification of the articles, whether as files in a computer, or as physical printouts. If you keep articles in a number of folders, the program will enable you to find in which folder a given article is, and to list the articles in a given folder. As for comments, keeping them in a centralized file is safer than having them as annotations (handwritten or electronic) on a copy of an article, which might well get lost.
\ArticleCategory{Topological Recursion}
This article ...
The purpose of the program is to produce annotated bibliographies, which look like this and this. (See below for explanations.) As an example, let us assume we have the following Bibtex file called "test.bib":
@article{cer12,We will then write the following Latex file listing categories and comments, called "mcb.tex":
author = "Chekhov, Leonid and Eynard, Bertrand and Ribault,
Sylvain",
title = "{Seiberg-Witten equations and non-commutative spectral
curves in Liouville theory}",
year = "2012",
eprint = "1209.3984",
archivePrefix = "arXiv",
primaryClass = "hep-th",
reportNumber = "IPHT-T12-075",
SLACcitation = "%%CITATION = ARXIV:1209.3984;%%",
}
@Article{fr10,
author = "Fateev, Vladimir and Ribault, Sylvain",
title = "{Conformal Toda theory with a boundary}",
journal = "JHEP",
volume = "12",
year = "2010",
pages = "089",
eprint = "1007.1293",
archivePrefix = "arXiv",
primaryClass = "hep-th",
doi = "10.1007/JHEP12(2010)089",
SLACcitation = "%%CITATION = 1007.1293;%%"
}
@Article{rib03b,
author = "Ribault, Sylvain",
title = "Strings and D-branes in curved space-times. (In French)",
year = "2003",
eprint = "hep-th/0309272",
SLACcitation = "%%CITATION = HEP-TH 0309272;%%"
}
@Article{rib08b,
author = "Ribault, Sylvain",
title = "{On sl3 Knizhnik-Zamolodchikov equations and W3 null-vector
equations}",
journal = "JHEP",
volume = "10",
year = "2009",
pages = "002",
eprint = "0811.4587",
archivePrefix = "arXiv",
primaryClass = "hep-th",
doi = "10.1088/1126-6708/2009/10/002",
SLACcitation = "%%CITATION = 0811.4587;%%"
}
\documentclass[12pt,a4paper]{article}Notice that only one article has comments, and only three out of four have categories. (The article with label "rib08b" has neither.) Notice also that this file is executable by Latex, which can be useful for checking that the comments are written correctly. But what matters for our program is only the part which contains the specific commands "\ArticleLabel", "\ArticleCategory" and "%EndEntries". Notice finally that the order in which the references appear in this file has no more importance than in the Bibtex file.
\usepackage[margin=20mm]{geometry}
\usepackage{amsfonts}
\newcommand{\ArticleLabel}{\cite}
\newcommand{\ArticleCategory}[1]{\noindent {\it Category: #1}}
\usepackage{showkeys}
\begin{document} \ArticleLabel{cer12} \ArticleCategory{Topological Recursion} This article shows that the method of Topological Recursion can be used in Liouville theory, in particular for computing expansions of correlation functions near $c=\infty$. \ArticleLabel{fr10} \ArticleCategory{CFT} \ArticleLabel{rib03b} \ArticleCategory{CFT} %EndEntries \bibliographystyle{alpha} \bibliography{test} \end{document}\begin{document} \ArticleLabel{cer12} \ArticleCategory{Topological Recursion} This article shows that the method of Topological Recursion can be used in Liouville theory, in particular for computing expansions of correlation functions near $c=\infty$. \ArticleLabel{fr10} \ArticleCategory{CFT} \ArticleLabel{rib03b} \ArticleCategory{CFT} %EndEntries \bibliographystyle{alpha} \bibliography{test} \end{document}
We still need two more files: the program "bibcac.pl" itself, and a standard file "biblist.tex", both given at the end of this post. The file "bibcac.pl" should be in the "bin" folder and be executable. The file "biblist.tex" should be in the same folder as the auxiliary file "mcb.tex". And the Bibtex file can be in any place -- provided the files "mcb.tex" and "biblist.tex" can find it, just as any other Latex file calling this Bibtex file would need to find it. (One way to do it is of course to have the Bibtex file in the same folder as the other two.)
So what happens when we run the program? We do this by calling "bibcac.pl" in the folder where our files "mcb.tex" and "biblist.tex" are -- here the folder "Desktop/bib_test". We could use the command
bibcac.pl -e mcb.tex biblist.bblbut we use the shorter command "bibcac.pl", where the names of the files "mcb.tex" and "biblist.bbl" need not be given because these default names are included in the program file "bibcac.pl", where they can easily be modified. So here is what happens:
~/Desktop/bib_test$ bibcac.plMost of this are the usual comments which are printed whenever running Latex and Bibtex. At the end we obtain the DVI file "biblist.dvi", which is automatically opened by "evince" -- but we can easily change the choice of this DVI viewer, or further convert the resulting file to the PS or PDF format, by modifying the program file "bibcac.pl". The resulting DVI file, after conversion to the PDF format, looks as follows:
bibcac.pl: "unlinking of biblist.bbl failed" at /home/ribault/bin/bibcac.pl line 113.
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./biblist.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo))
(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf-texlive/tex/latex/tools/multicol.sty)
No file biblist.aux.
No file biblist.bbl.
(./biblist.aux) )
No pages of output.
Transcript written on biblist.log.
This is BibTeX, Version 0.99c (TeX Live 2009/Debian)
The top-level auxiliary file: biblist.aux
The style file: alpha.bst
Database file #1: test.bib
Warning--empty journal in cer12
Warning--empty journal in rib03b
(There were 2 warnings)
bibcac.pl: "Reorganizing the bibliography..."
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./biblist.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo))
(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf-texlive/tex/latex/tools/multicol.sty) (./biblist.aux)
(./biblist.bbl (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd)
(/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd)) [1] (./biblist.aux)
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
)
Output written on biblist.dvi (1 page, 1616 bytes).
Transcript written on biblist.log.
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./biblist.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo))
(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf-texlive/tex/latex/tools/multicol.sty) (./biblist.aux)
(./biblist.bbl (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd)
(/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd)) [1] (./biblist.aux) )
Output written on biblist.dvi (1 page, 1616 bytes).
Transcript written on biblist.log.
bibcac.pl --> biblist_.pdfSo this is a bibliography where articles are listed according to their category -- here we have the two categories "CFT" or "Topological Recursion". We also have the category "Miscellaneous Articles" for the articles which are not mentioned in the file "mcb.tex" and therefore have no associated category. Comments associated to articles are displayed. We may add the option "-l" to get a list of categories with an article count. (The article count is however not supposed to work for the "Miscellaneous Articles".)
bibcac.pl -l --> biblist_l.pdfFinally, we may want to know in which category a given article is. To do this we use the option "-c", which produces the following result:
bibcac.pl -c --> biblist_c.pdfThis is a bibliography in the normal order (as specified by the bibliography style file), where categories are indicated, and comments are omitted but their existence is indicated by an asterisk.
Hopefully the explanations given so far are enough for installing and running the program, but it does not hurt to reproduce the help page which is normally obtained by the command "bibcac.pl -h":
~/Desktop/bib_testbibcac.pl−hbibcac.pl:"Justprintinghelp:"Usage:bibcac.pl[options][file1][file2]wherethe2filesareneededonlywiththeoption−e,otherwisedefaultnamesareused.Optionscanbeconcatenated,forinstance′bibcac.pl−vim′.MakesnewversionoftheBBLfile′file2′,wherereferencesarereorderedbycategoriesandcommentedaccordingtotheinputintheTEXfile′file1′(whichcanbecompiledbyitselfasatest).Thisinputshouldbealistofentriesofthetype\ArticleLabelbp00(samelabelasinBBLfile)\ArticleCategoryStringsin$AdS3$(acategoryname)NicearticleaboutAdS_3$ (TEX comments)Then here are the two files promised above: first the short Latex file "biblist.tex":
...
%EndEntries (end of all entries)
A backup copy is made of the BBL file, with additional extension
'.bak'. Unless the option -m is called, the files will be
automatically compiled, and the resulting DVI file will be opened
with 'evince'.
Options:
-v indicates -version number.
-h prints the present -help and dies.
-t prints the lists of labels and categories as a -test, but
does not modify the BBL file.
-e expects names of two files to be -entered explicitly.
-c only -comments the bibliography without reordering it:
categories of articles which have one are indicated, and possible
comments are indicated by a * but not printed.
-m only modifies BBL file: TEX and BIBTEX should be called
-manually.
-i makes an -incomplete bibliography excluding articles with
neither category nor comments.
-l -lists existing categories. Requires \usepackage{multicol}.
\documentclass[12pt]{article}Then the program itself, called "bibcac.pl". Notice the parameters at the beginning, including the default names of the files "mcb.tex" and "biblist.bbl".
\setlength{\textwidth}{17cm} \setlength{\textheight}{25.2cm}
\hoffset -20mm \topmargin= -13mm
\usepackage{amsfonts}
\usepackage{multicol}
\begin{document} \nocite{*} \small % Here we must give the full path to files. \bibliographystyle{alpha} \bibliography{test} \end{document}
eval '(exit ?0)' && eval 'exec perl -x -S0 {1+"$@"}' && eval 'exec perl -x -S0 argv:q' if 0; #!/usr/local/bin/perl -w #use File::Basename; use strict; # Default file names: mymcb_name = "mcb.tex"; # default name of TeX file with categories and comments
my bbl_name = "biblist.bbl"; # default name of bbl file to be treated # Version details: mymy_name = "bibcac.pl";
my versionnum=′1.00′;myversion_details = "mynameversion_num, by Sylvain Ribault";
# Configuration variables:
my viewer = "evince"; # to view resulting DVI file mybib_env = "thebibliography";
my misc_cat = "Miscellaneous Articles"; # default category mycat_cmd = "ArticleCategory"; # name of TeX command declaring category
my label_cmd = "ArticleLabel"; # name of TeX command declaring label myend_cmd = "EndEntries"; # name of TeX command declaring end of file
my cat_string = "\\hspace\{-1.3cm\} \$\\rightarrow\$ \{\\it"; # TeX commands before # a category for 'add_cat' myexcerpt_string = "\\hspace\{-.35cm\} *\\ "; # TeX commands after a \bibitem if
# there is a corresponding text for 'add_cat'
my cat_head = "\\vspace\{5mm\} \\hspace\{-2cm\} \\underline\{\\large Category\\bf\\ "; # Category head for 'order_cat' myexcerpt_head = "\\hspace\{-7mm\} $\\triangleright$ \\hspace\{1mm\} "; # Excerpt head for 'order_cat'
my aux_file = "bibcac_aux_file.bbl"; # Name of auxiliary file mynb_col = 3; # Number of columns in listing of categories (if option -l)
# Options
my do_incomplete = 1; # 1 if we list even articles with neither comments nor category mydo_test = 0; # 1 if we just print lists
my do_comment = 0; # 1 if we run add_cat instead of order_cat mydo_help = 0; # 1 if we just print help
my do_enter = 0; # 1 if we manually enter file names mydo_manual = 0; # 1 if we automatically compile
my do_version = 0; # 1 if we want version details mydo_list = 0; # 1 if we want list of categories
# Some global variables:
my mcbbase="";mybbl_base = "";
my bbltex="";mybbl_dvi = "";
my bbl_ps = ""; # List variables: my @cat_list; my %label_excerpt; my %label_cat; my @labels; my %cat_label_list; my %label_bibitem = (); # will contain bibitem entries of worthy labels # Program while (_ = ARGV[0])if(/−/)if(/i/)$doincomplete=0;if(/t/)$dotest=1;if(/c/)$docomment=1;if(/h/)$dohelp=1;if(/e/)$doenter=1;if(/m/)$domanual=1;if(/v/)$doversion=1;if(/l/)$dolist=1;elsif($doenter==0)if(/§/)print"$myname:\"Superfluousarguments.Iignorethemandproceed.\"\n";last;else$mcbname=$ARGV[0];$bblname=$ARGV[1];last;shift;if(do_version == 1 ){
print "Running version_details\n"; } if (do_help == 1 ){
print "my_name: \"Just printing help:\"\n"; print_help(); exit 0; } check_names(); if (do_test == 1 ){
print "my_name: \"Just testing the lists:\"\n"; test_lists(); exit 0; } if (do_manual == 0 ){
unlink bblnameorwarn"my_name: \"unlinking of bbl_name failed\""; # Avoids a bug if abbl_name file is leftover from interrupted execution
system("latex",bbltex)==0ordie"my_name: \"system latex bbltexfailed:?\"";
# print "myname:firstcompilationsuccessful";system("bibtex",bbl_base) == 0
or warn "myname:\"systembibtexbbl_base claims failure: ?\""; # print "my_name: bibtex successful";
# NB: sometimes bibtex wrongly claims it failed.
}
if ( docomment==1)print"$myname:\"Commentingthebibliography...\"\n";addcat($mcbname,$bblname);elseprint"$myname:\"Reorganizingthebibliography...\"\n";ordercat($mcbname,$bblname);if(do_manual == 0 ){
system("latex",bbltex)==0ordie"my_name: \"system latex bbltexfailed:?\"";
system("latex",bbltex)==0ordie"my_name: \"system latex bbltexfailed:?\"";
system(viewer."".bbl_dvi." &") == 0
or die "myname:\"systemviewer bbldvifailed:?\"";
}
exit 0;
#========================================================================
sub test_lists{
# Generates and prints various lists produced by subroutines
list_cat(mcbname);listlabels(mcb_name);
cat_contents(bblname);print"Commentsonarticles:\n";while((mykey, my value)=eachkey, my value)=eachkey, my value)=eachkey, my value)=eachkey --> value\n"; # } } #========================================================================= sub list_cat{ #_[0] = name of input TeX file
# Extracts list of categories from the file. Spaces are removed from
# the beginning of category names. List ends with category misc_cat of # articles with comments but no specific category myin_file = [0];@catlist=();mycat_name;
my test;local∗IN;open(IN,"<in_file" )
or die "Cannot read \"in_file\"\n"; while (<IN> ) { if ( /$end_cmd/ ){ last; } if ( /^[\s]*\\$cat_cmd[\s]*\{[\s]*([^\}]+)/ ){ $cat_name = $1; $test = 0; for (my $i = 0; $i <= $#cat_list; $i++ ) { if ($cat_list[$i] eq $cat_name ) { $test = 1; } } if ($test == 0 ) { push @cat_list, $cat_name; } } } @cat_list = sort {remove_tex($a) cmp remove_tex($b)} @cat_list; push @cat_list,misc_cat;
close IN;
}
#========================================================================
sub remove_tex{
# _[0] = a string # Output is the same string where and other symbols are removed
my improvedstring=_[0];
if (improvedstring= /([\w\s]+)/)$improvedstring=$1;returnimproved_string;
}
#=========================================================================
sub list_labels{
# _[0] = name of input TeX file # Extracts list of labels and makes two hashes: corresponding text (with # initial and final spaces removed), corresponding categories myin_file = [0];mytest = 0; # will become 1 when looking for a category
my state = 0; # will become 1 iflabel_cmd, 2 if endcmdin_file" )
or die "Cannot read \"infile\"\n";myexcerpt = "";
my currentcat="";mycurrent_label = "";
my new_label = ""; while (<IN>) { if ( /^[\s]*\\label_cmd[\s]*\{[\s]*([^\}\s]+)/ ){
state=1;new_label = 1; } if ( /^[\s]*\%end_cmd/ ){
state = 2; } if (state != 0 ){
if ( current_label ne "" &&excerpt =~ /^\s*(\S[\S\s]*\S)\s*/)$labelcat$currentlabel=$misccat;$labelexcerpt$currentlabel=$1;if(current_label ne "" && currentcatne"")$labelcat$currentlabel=$currentcat;current_label = newlabel;test = 1;
currentcat="";excerpt = "";
}
if ( state==2)last;if(/[\s]∗cat_cmd[\s]*\{[\s]*([^\}]+)/ && test==1)$currentcat=$1;$test=0;if(!/[\s]∗cat_cmd/ && ! /^[\s]*\$label_cmd/ ){
excerpt=excerpt._; }state = 0;
}
}
#=============================================================================
sub add_cat{
# _[0] = name of input TeX file linking labels with categories #_[1] = name of BBL file
# Extracts categories for labels listed in _[0], adds these categories # in the file_[1], plus a star if comments are associated to the label
my infile=_[0];
my outfile=_[1];
list_labels(infile);mybak_file = "outfile.bak";rename(out_file,bakfile)ordie"Cannotcreatebackupfile\"out_file.bak\"\n";
local *IN;
local *OUT;
open ( IN, "<bakfile")ordie"Cannotread\"bak_file\"\n";
open ( OUT, ">outfile")ordie"Cannotread\"out_file\"\n";
my state = 0; #will jump to 1 if known label detected mybbl_label;
my current_cat; while (<IN>) { myline = ;if(/[\s]∗bibitem[{]∗{[\s]∗([\s}]+)/)$bbllabel=$1;if(defined($labelcat$bbllabel))$state=1;$currentcat=$labelcat$bbllabel;if(defined($labelexcerpt$bbllabel))$line="$line$excerptstring";if(state == 1 && /^/ ) {state = 0;
print OUT line;printOUT"cat_string currentcat}\n";printOUTline;
}
else {
print OUT line; } } close IN; close OUT; } #================================================================================= sub cat_contents{ #_[0] = name of BBL file
# From existing list @cat_list and hash %label_cat,
# produces a hash %cat_label_list which associates to each
# category the list of relevant labels, in the order of the BBL file
my infile=_[0];
my bbllabel;for(myi = 0; i<=#cat_list; i++)$catlabellist$catlist[$i]=[];local∗IN;open(IN,"<in_file" );
while ( <IN> ){
if ( /^[\s]*\\bibitem[^\{]*\{[\s]*([^\s\}]+)/ ) {
bbllabel=1;
if (defined( label_cat{bbl_label} )) {
push @{cat_label_list{$label_cat{$bbl_label}}} ,bbl_label;
}
}
}
close IN;
}
#==================================================================================
sub order_cat{
# _[0] = name of input TeX file linking labels with categories #_[1] = name of BBL file
# Extracts categories and comments for labels listed in _[0], rewrites # a BBL file ordered by categories, including comments. Adds all other labels # ifcomplete_list == 1.
my infile=_[0];
my outfile=_[1];
my bbllabel="";mybegin_line = "";
my endline="";listlabels(in_file);
list_cat(infile);catcontents(out_file);
my bakfile="out_file.bak";
my state = 0; # becomes 1 if worthy label is detected rename(out_file,bakfile)ordie"Cannotcreatebackupfile\"out_file.bak\"\n";
local *IN;
local *OUT;
open ( IN, "<bakfile")ordie"Cannotread\"bak_file\"\n";
open ( OUT, ">outfile")ordie"Cannotread\"out_file\"\n";
local *REST;
open ( REST, ">auxfile")ordie"Cannotcreate\"aux_file\"\n";
while (<IN>){
my line=_;
if ( /^[\s]*\\bibitem[^\{]*\{[\s]*([^\s\}]+)/ ) {
bbllabel=1;
if (defined( labelcat$bbllabel)||defined(label_excerpt{bbl_label} ) ) { $state = 1; $label_bibitem{$bbl_label} = ""; } else { $state = 0; } } if ( /\\begin[\s]*\{bib_env\}/ ) {
state = 2; } if (state == 2 ) {
beginline=begin_line.line; } if ( /^[\s]*\\end[\s]*\{bib_env\}/ ) {
endline=line;
last;
}
if ( state==1)$labelbibitem$bbllabel=$labelbibitem$bbllabel.$line;if(state == 0 ){
print REST line; } } print OUT "begin_line\n\n\\bibitem\{\}\\ ";
if ( do_list == 1 ){ print OUT "\{\\it List of categories: \}\n\n \\begin\{multicols\}\{$nb_col\}\n\n"; LISTCATS: for (my $k=0; $k <= $#cat_list; $k++ ) { my $current_cat = $cat_list[$k]; my $cat_size = $#{$cat_label_list{$current_cat}}+1; print OUT "($cat_size) $current_cat\n\n"; } print OUT "\\end\{multicols\}"; } print OUT "\n\n"; WRITEMAIN: for (myi=0; i<=#cat_list; i++ ) { my $current_cat = $cat_list[$i]; my @current_labels = @{$cat_label_list{$current_cat}}; print OUT "$cat_head$current_cat\}\n\n"; for (my $j=0; $j <= $#current_labels; $j++ ) { my $label = $current_labels[$j]; if (defined( $label_bibitem{$label} )) { print OUT "$label_bibitem{$label}\n"; if (defined( $label_excerpt{$label} )) { print OUT "$excerpt_head$label_excerpt{$label}\n\n"; } } } } if (do_incomplete ne 1) {
print OUT "end_line\n"; } else { print REST "$end_line\n"; close REST; open ( REST, "<$aux_file" ) or die "Cannot read \"$aux_file\"\n"; while ( <REST> ){ print OUT; } } close IN; close OUT; close REST; unlinkaux_file;
}
#=======================================================================
sub print_help{
print <<HELP;
Usage:
myname[options][file1][file2]wherethe2filesareneededonlywiththeoption−e,otherwisedefaultnamesareused.Optionscanbeconcatenated,forinstance′my_name -vim'.
Makes new version of the BBL file 'file2', where references are
reordered by categories and commented according to the input in
the TEX file 'file1' (which can be compiled by itself as a test).
This input should be a list of entries of the type
\$label_cmd\{bp00\} (same label as in BBL file)
\$cat_cmd\{Strings in $AdS_3$\} (a category name)
Nice article about $AdS_3$ (TEX comments)
...
\%endcmd(endofallentries)AbackupcopyismadeoftheBBLfile,withadditionalextension′.bak′.Unlesstheoption−miscalled,thefileswillbeautomaticallycompiled,andtheresultingDVIfilewillbeopenedwith′viewer'.
Options:
-v indicates -version number.
-h prints the present -help and dies.
-t prints the lists of labels and categories as a -test, but
does not modify the BBL file.
-e expects names of two files to be -entered explicitly.
-c only -comments the bibliography without reordering it:
categories of articles which have one are indicated, and possible
comments are indicated by a * but not printed.
-m only modifies BBL file: TEX and BIBTEX should be called
-manually.
-i makes an -incomplete bibliography excluding articles with
neither category nor comments.
-l -lists existing categories. Requires \\usepackage\{multicol\}.
HELP
}
#========================================================================
sub check_names{
# Extracts names of input files, adds extensions if necessary.
# Mab be simpler with command fileparse() from package File::Basename!
if ( mcbname= /([§]+)\.tex/ ) {
mcbbase="1";
}
else {
mcbbase="mcb_name";
mcbname="mcb_base.tex";
}
# print "mcbbase\nmcb_name\n";
if ( bblname= /([§]+)\.bbl/ ) {
bblbase="1";
}
else {
bblbase="bbl_name";
bblname="bbl_base.bbl";
}
bbltex="bbl_base.tex";
bbldvi="bbl_base.dvi";
bblps="bbl_base.ps";
# print "bblbase\nbbl_name\nbbltex\nbbl_dvi\n";
}
No comments:
Post a Comment