Text Formattingachemso vs. abbreviation in reference

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
dfodor
Posts: 6
Joined: Sun Nov 01, 2009 8:28 pm

achemso vs. abbreviation in reference

Post by dfodor »

Hi!

I would like to ask for some help. I would like to use achemso package for formatting the references. They are actually fine and formatted as requested by the American Chemical Society. The only problem is that the journals are not abbreviated automatically. I do not see anything in the logfile and also did not find any hint how to solve it.

I use texlive on debian squeeze. Texlive is installed from regular repositories.

I would appreciate any kind of help.

Best regards

dfodor

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

achemso vs. abbreviation in reference

Post by josephwright »

Hello dfodor,

I've thought about automated abbreviation, but there are issues. If you use a word-by-word system, then things like "Chemistry---A European Journal" versus "Journal of Physical Chemistry A" are a problem: one looses the A, the other doesn't. On the other hand, you can do things for the full text of a journal title but this needs lots of entries to cover even the base of chemistry. There are also some low-level problems (how to handle spaces, commas, case changes, etc.). So at the moment there is nothing automatic in achemso (or I think any other BibTeX bundle). I might be persuaded to look again at this, but I'll need to think of a reliable way to make it work!

Joseph
Joseph Wright
dfodor
Posts: 6
Joined: Sun Nov 01, 2009 8:28 pm

Re: achemso vs. abbreviation in reference

Post by dfodor »

Hi Joseph!

Thank you for your reply. The thing is that achemso should make the abbreviation. I already worked with this bibliography style and did really well. This is from achemso documentation:

"A number of journal abbreviations are defined in the .bst files. The abbreviations cover a number ACS journals, several other physical chemistry publications and other journals listed as highly cited by Chem. Abs. The interested user should consult the .bst files for full details."

So, I checked the bst file, the abbreviations are really there but do not understand, why they are not used. Of course it will not work with all the chemistry journals but as far as I remember I did not really have to search for official abbreviations. Achemso abbreviated them itself.

It only would make my job easier because if it worked I would not need to search for the abbreviations of the journals I refer to.

Thanks again for your reply.

Daniel
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

achemso vs. abbreviation in reference

Post by josephwright »

dfodor wrote:"A number of journal abbreviations are defined in the .bst files. The abbreviations cover a number ACS journals, several other physical chemistry publications and other journals listed as highly cited by Chem. Abs. The interested user should consult the .bst files for full details."
I should, I think, make clear that these are BibTeX macros and are really intended for people who used older versions of achemso. These only work if you use them in your .bib file, for example

Code: Select all

  journal = jacsat,
will turn into "J. Am. Chem. Soc.". However, this does nothing to your database entries if they contain normal text:

Code: Select all

  journal = {Journal of the American Chemical Society},
I'll perhaps take a look at this.
Joseph Wright
dfodor
Posts: 6
Joined: Sun Nov 01, 2009 8:28 pm

Re: achemso vs. abbreviation in reference

Post by dfodor »

Thanks a lot Joseph for your replies.
crispy_chunks
Posts: 11
Joined: Wed Oct 27, 2010 2:59 pm

achemso vs. abbreviation in reference

Post by crispy_chunks »

I have created a small bash script which takes in a bibtex file, copies it and replaces all journal titles with abbreviated journal titles. The script takes two files, each with a list of journal names or abbreviations.

The script requires a file called: JournalAbbreviationList and a file called: JournalNamesList. These names should be self explanatory. Each line in these files must of course correspond to a journal name and its abbreviation on the same line in the other file.

This command will on ubuntu create a file called abbreviated-articles.bib when running this command:

./Abbreviabitex replace articles.bib

This command will print a list of unique journal titles to see which have been replaced.

./Abbreviabitex list articles.bib


File Abbribiabitex:

Code: Select all

#!/bin/bash

if [ -z $1 ]; then
	echo "No command selected"
	exit
fi

# Check that necessary files exist.
if [ ! -f $2 ]; then
	echo "Input bibliography file does not exist"
	exit
fi

if [ ! -f JournalAbbreviationList ]; then
	echo "JournalAbbreviationList files does not exist"
	exit
fi

if [ ! -f JournalNamesList ]; then
	echo "JournalNamesList files does not exist"
	exit
fi

if [ $1 = "list" ]; then
	if [ -f "abbreviated-"$2 ]; then
		cat "abbreviated-"$2 | grep journal | uniq -u
		exit
	else
		echo "Run replace command first"
	fi
fi

if [ ! "$1" = "replace" ]; then
	exit
fi

# Check that JournalAbbreviationList and JournalNamesList corresponds
if [ ! $(cat JournalAbbreviationList | wc -l) = $(cat JournalNamesList | wc -l) ]; then
	exit
#	else 
#	echo "JournalNamesList and JournalAbbreviationList checks out."
fi

# Setup variables and inform user

outfile="abbreviated-"$2
IFS=$'\n'
Abbrlines=($(cat JournalAbbreviationList))
Namelines=($(cat JournalNamesList))
echo ""
echo "WARNING!: Continuing will remove $outfile and write new bibliography to this."
read -p "Do you want to continue [y/n]? "
if [ ! "$REPLY" = "y" ]; then
	exit
fi
rm $outfile
cp $2 $outfile


# Command to insert abbreviations
function replace() {
        # Generate search regex
	echo "Replacing \"$journal\" with \"$jabbrev\""
	searchregex="^.*journal = \""$journal
	replaceregex="	journal = \"$jabbrev"
	sedcommand="s/"$searchregex"/"$replaceregex"/"
	escapedchar="'"
	eval "sed -i $escapedchar$sedcommand$escapedchar $outfile"
}

for i in $(seq 1 $(cat JournalNamesList | wc -l) ); do
	journal=${Namelines[$i-1]}
	jabbrev=${Abbrlines[$i-1]}
	replace
done
File JournalAbbreviationList:

Code: Select all

J. Org. Chem.
Angew. Chem. Int. Ed. Engl.
Angew. Chem. Int. Ed.
R. Soc. Chem.
Tetrahedron Lett.
J. Fluorine Chem.
J. Chem. Soc., Chem. Commun.
Bioorg. Med. Chem. Lett.
Ann. Chim. Phys.
Pure Appl. Chem.
Acc. Chem. Res.
J. Am. Chem. Soc.
J. Organomet. Chem.
Eur. J. Org. Chem.
Catal. Rev. -- Sci. Eng.
Chem. Nat. Compd.
Chem. Eur. J.
Chem. Eur. J.
J. Heterocycl. Chem.
Synth.
Chem. Rev.
Org. Lett.
Helv. Chim. Acta
Chem. Res. Toxicol.
Recl. Trav. Chim. Pays-Bas

File JournalNamesList:

Code: Select all

The Journal of Organic Chemistry
Angewandte Chemie International Edition in English
Angewandte Chemie International Edition
Royal Society of Chemistry
Tetrahedron Letters
Journal of Fluorine Chemistry
Journal Of The Chemical Society-Chemical Communications
Bioorganic and Medicinal Chemistry Letters
Annales de Chimie et de Physique
Pure and Applied Chemistry
Accounts of Chemical Research
Journal of the American Chemical Society
Journal of Organometallic Chemistry
European Journal of Organic Chemistry
Catalysis Reviews: Science and Engineering
Chemistry of Natural Compounds
Chemistry - A European Journal
Chemistry -- A European Journal
Journal of Heterocyclic Chemistry
Synthesis
Chemical Reviews
Organic Letters
Helvetica Chimica Acta
Chemical Research in Toxicology
Recueil des Travaux Chimiques des Pays-Bas
Post Reply