-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
587 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
abbrs = { | ||
'China Physics C': 'Chin Phys C', | ||
'Chinese Physics Letters': 'Chin Phys Lett', | ||
'Nuclear Instruments and Methods in Physics Research Section A': 'Nucl Instr and Meth A', | ||
'Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment': 'Nucl Instr and Meth A', | ||
'Nuclear Instruments and Methods in Physics Research Section B': 'Nucl Instr and Meth B', | ||
'Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms': 'Nucl Instr and Meth B', | ||
'Physical Review C': 'Phys Rev C', | ||
'Physical Review D': 'Phys Rev D', | ||
'Physical Review E': 'Phys Rev E', | ||
'Physical Review Letters': 'Phys Rev Lett', | ||
'Physics Letters B': 'Phys Lett B', | ||
} | ||
|
||
lines = [] | ||
|
||
lines.append('''\ | ||
FUNCTION {abbreviate.journal} | ||
{ 't := | ||
t "l" change.case$ 's := | ||
''') | ||
|
||
# for k, v in abbrs.items(): | ||
# lines.append(f' s "{k.lower()}" =\n {{ "{v}" }} {{\n') | ||
# lines.append(f' t\n') | ||
# for _ in range(len(abbrs)): | ||
# lines.append(f' }} if$\n') | ||
|
||
for k, v in abbrs.items(): | ||
k = k.replace('.', '').lower() | ||
lines.append(f' s "{k}" =\n') | ||
lines.append(f' {{ "{v}" }}\n') | ||
lines.append(f' \'skip$\n') | ||
lines.append(f' if$\n') | ||
|
||
lines.append('''\ | ||
\'s := | ||
s empty$ | ||
{ t } | ||
{ s } | ||
if$ | ||
} | ||
''') | ||
|
||
|
||
for line in lines: | ||
print(line, end='') | ||
|
||
with open('abbr.bst', 'w') as f: | ||
f.writelines(lines) |
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
Oops, something went wrong.