gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Handle url fields in bib2dox.py (#184) and modify the bibtex file using url fields.
0 2 0
default
2 files changed with 17 insertions and 23 deletions:
↑ Collapse diff ↑
Show white space 24 line context
... ...
@@ -3,128 +3,117 @@
3 3
@misc{lemon,
4 4
  key =          {LEMON},
5 5
  title =        {{LEMON} -- {L}ibrary for {E}fficient {M}odeling and
6 6
                  {O}ptimization in {N}etworks},
7 7
  howpublished = {\url{http://lemon.cs.elte.hu/}},
8 8
  year =         2009
9 9
}
10 10

	
11 11
@misc{egres,
12 12
  key =          {EGRES},
13 13
  title =        {{EGRES} -- {E}gerv{\'a}ry {R}esearch {G}roup on
14 14
                  {C}ombinatorial {O}ptimization},
15
  howpublished = {\url{http://www.cs.elte.hu/egres/}},
16
  year =         2009
15
  url =          {http://www.cs.elte.hu/egres/}
17 16
}
18 17

	
19 18
@misc{coinor,
20 19
  key =          {COIN-OR},
21 20
  title =        {{COIN-OR} -- {C}omputational {I}nfrastructure for
22 21
                  {O}perations {R}esearch},
23
  howpublished = {\url{http://www.coin-or.org/}},
24
  year =         2009
22
  url =          {http://www.coin-or.org/}
25 23
}
26 24

	
27 25

	
28 26
%%%%% Other libraries %%%%%%
29 27

	
30 28
@misc{boost,
31 29
  key =          {Boost},
32 30
  title =        {{B}oost {C++} {L}ibraries},
33
  howpublished = {\url{http://www.boost.org/}},
34
  year =         2009
31
  url =          {http://www.boost.org/}
35 32
}
36 33

	
37 34
@book{bglbook,
38 35
  author =       {Jeremy G. Siek and Lee-Quan Lee and Andrew
39 36
                  Lumsdaine},
40 37
  title =        {The Boost Graph Library: User Guide and Reference
41 38
                  Manual},
42 39
  publisher =    {Addison-Wesley},
43 40
  year =         2002
44 41
}
45 42

	
46 43
@misc{leda,
47 44
  key =          {LEDA},
48 45
  title =        {{LEDA} -- {L}ibrary of {E}fficient {D}ata {T}ypes and
49 46
                  {A}lgorithms},
50
  howpublished = {\url{http://www.algorithmic-solutions.com/}},
51
  year =         2009
47
  url =          {http://www.algorithmic-solutions.com/}
52 48
}
53 49

	
54 50
@book{ledabook,
55 51
  author =       {Kurt Mehlhorn and Stefan N{\"a}her},
56 52
  title =        {{LEDA}: {A} platform for combinatorial and geometric
57 53
                  computing},
58 54
  isbn =         {0-521-56329-1},
59 55
  publisher =    {Cambridge University Press},
60 56
  address =      {New York, NY, USA},
61 57
  year =         1999
62 58
}
63 59

	
64 60

	
65 61
%%%%% Tools that LEMON depends on %%%%%
66 62

	
67 63
@misc{cmake,
68 64
  key =          {CMake},
69 65
  title =        {{CMake} -- {C}ross {P}latform {M}ake},
70
  howpublished = {\url{http://www.cmake.org/}},
71
  year =         2009
66
  url =          {http://www.cmake.org/}
72 67
}
73 68

	
74 69
@misc{doxygen,
75 70
  key =          {Doxygen},
76 71
  title =        {{Doxygen} -- {S}ource code documentation generator
77 72
                  tool},
78
  howpublished = {\url{http://www.doxygen.org/}},
79
  year =         2009
73
  url =          {http://www.doxygen.org/}
80 74
}
81 75

	
82 76

	
83 77
%%%%% LP/MIP libraries %%%%%
84 78

	
85 79
@misc{glpk,
86 80
  key =          {GLPK},
87 81
  title =        {{GLPK} -- {GNU} {L}inear {P}rogramming {K}it},
88
  howpublished = {\url{http://www.gnu.org/software/glpk/}},
89
  year =         2009
82
  url =          {http://www.gnu.org/software/glpk/}
90 83
}
91 84

	
92 85
@misc{clp,
93 86
  key =          {Clp},
94 87
  title =        {{Clp} -- {Coin-Or} {L}inear {P}rogramming},
95
  howpublished = {\url{http://projects.coin-or.org/Clp/}},
96
  year =         2009
88
  url =          {http://projects.coin-or.org/Clp/}
97 89
}
98 90

	
99 91
@misc{cbc,
100 92
  key =          {Cbc},
101 93
  title =        {{Cbc} -- {Coin-Or} {B}ranch and {C}ut},
102
  howpublished = {\url{http://projects.coin-or.org/Cbc/}},
103
  year =         2009
94
  url =          {http://projects.coin-or.org/Cbc/}
104 95
}
105 96

	
106 97
@misc{cplex,
107 98
  key =          {CPLEX},
108 99
  title =        {{ILOG} {CPLEX}},
109
  howpublished = {\url{http://www.ilog.com/}},
110
  year =         2009
100
  url =          {http://www.ilog.com/}
111 101
}
112 102

	
113 103
@misc{soplex,
114 104
  key =          {SoPlex},
115 105
  title =        {{SoPlex} -- {T}he {S}equential {O}bject-{O}riented
116 106
                  {S}implex},
117
  howpublished = {\url{http://soplex.zib.de/}},
118
  year =         2009
107
  url =          {http://soplex.zib.de/}
119 108
}
120 109

	
121 110

	
122 111
%%%%% General books %%%%%
123 112

	
124 113
@book{amo93networkflows,
125 114
  author =       {Ravindra K. Ahuja and Thomas L. Magnanti and James
126 115
                  B. Orlin},
127 116
  title =        {Network Flows: Theory, Algorithms, and Applications},
128 117
  publisher =    {Prentice-Hall, Inc.},
129 118
  year =         1993,
130 119
  month =        feb,
Show white space 24 line context
... ...
@@ -61,25 +61,25 @@
61 61
"""
62 62

	
63 63
import string, re
64 64

	
65 65
# set of valid name characters
66 66
valid_name_chars = '[\w\-:]'
67 67

	
68 68
#
69 69
# define global regular expression variables
70 70
#
71 71
author_rex = re.compile('\s+and\s+')
72 72
rembraces_rex = re.compile('[{}]')
73
capitalize_rex = re.compile('({\w*})')
73
capitalize_rex = re.compile('({[^}]*})')
74 74

	
75 75
# used by bibtexkeywords(data)
76 76
keywords_rex = re.compile('[,;]')
77 77

	
78 78
# used by concat_line(line)
79 79
concatsplit_rex = re.compile('\s*#\s*')
80 80

	
81 81
# split on {, }, or " in verify_out_of_braces
82 82
delimiter_rex = re.compile('([{}"])',re.I)
83 83

	
84 84
field_rex = re.compile('\s*(\w*)\s*=\s*(.*)')
85 85
data_rex = re.compile('\s*(\w*)\s*=\s*([^,]*),?')
... ...
@@ -354,24 +354,26 @@
354 354
                eline += ','
355 355
                entry.append(eline)
356 356
            else:
357 357
                if entrycont.has_key('pages') and (entrycont['pages'] != ''):
358 358
                    entry.append('pages ' + entrycont['pages'] + ',')
359 359
            if entrycont.has_key('year') and (entrycont['year'] != ''):
360 360
                if entrycont.has_key('month') and (entrycont['month'] != ''):
361 361
                    entry.append(entrycont['month'] + ' ' + entrycont['year'] + '.')
362 362
                else:
363 363
                    entry.append(entrycont['year'] + '.')
364 364
            if entrycont.has_key('note') and (entrycont['note'] != ''):
365 365
                entry.append(entrycont['note'] + '.')
366
            if entrycont.has_key('url') and (entrycont['url'] != ''):
367
                entry.append(entrycont['url'] + '.')
366 368

	
367 369
            # generate keys for sorting and for the output
368 370
            sortkey = ''
369 371
            bibkey = ''
370 372
            if entrycont.has_key('author'):
371 373
                for author in entrycont['author']['list']:
372 374
                    sortkey += copychars(author, author.rfind(' ')+1, len(author))
373 375
                bibkey = entrycont['author']['abbrev']
374 376
            else:
375 377
                bibkey = 'x'
376 378
            if entrycont.has_key('year'):
377 379
                sortkey += entrycont['year']
... ...
@@ -402,24 +404,27 @@
402 404
            # field = "data" entries
403 405
            elif quotedata_rex.match(line):
404 406
                field = quotefield_rex.sub('\g<1>', line)
405 407
                field = string.lower(field)
406 408
                data =  quotedata_rex.sub('\g<2>', line)
407 409

	
408 410
            # field = data entries
409 411
            elif data_rex.match(line):
410 412
                field = field_rex.sub('\g<1>', line)
411 413
                field = string.lower(field)
412 414
                data =  data_rex.sub('\g<2>', line)
413 415
            
416
            if field == 'url':
417
                data = '\\url{' + data.strip() + '}'
418
            
414 419
            if field in ('author', 'editor'):
415 420
                entrycont[field] = bibtexauthor(data)
416 421
                line = ''
417 422
            elif field == 'title':
418 423
                line = bibtextitle(data, entrytype)
419 424
            elif field != '':
420 425
                line = removebraces(transformurls(data.strip()))
421 426

	
422 427
            if line != '':
423 428
                line = latexreplacements(line)
424 429
                entrycont[field] = line
425 430

	
0 comments (0 inline)