2007-08-14 16:50:51 +00:00
|
|
|
/**
|
2007-08-20 16:30:02 +00:00
|
|
|
* \file BiblioInfo.cpp
|
2007-08-14 16:50:51 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Herbert Voß
|
2007-08-20 16:30:02 +00:00
|
|
|
* \author Richard Heck
|
2007-08-14 16:50:51 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-14 22:18:27 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-20 17:04:36 +00:00
|
|
|
#include "BiblioInfo.h"
|
2007-08-20 16:30:02 +00:00
|
|
|
#include "Buffer.h"
|
|
|
|
#include "BufferParams.h"
|
2007-08-15 08:57:58 +00:00
|
|
|
#include "buffer_funcs.h"
|
2009-01-16 23:42:16 +00:00
|
|
|
#include "Encoding.h"
|
2007-08-14 16:50:51 +00:00
|
|
|
#include "InsetIterator.h"
|
|
|
|
#include "Paragraph.h"
|
2010-01-08 16:40:41 +00:00
|
|
|
#include "TocBackend.h"
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
#include "insets/Inset.h"
|
|
|
|
#include "insets/InsetBibitem.h"
|
|
|
|
#include "insets/InsetBibtex.h"
|
|
|
|
#include "insets/InsetInclude.h"
|
|
|
|
|
2010-01-08 18:19:13 +00:00
|
|
|
#include "support/convert.h"
|
2007-11-01 22:17:22 +00:00
|
|
|
#include "support/docstream.h"
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/gettext.h"
|
2008-11-19 03:52:22 +00:00
|
|
|
#include "support/lassert.h"
|
2007-11-29 07:04:28 +00:00
|
|
|
#include "support/lstrings.h"
|
2009-01-04 23:35:08 +00:00
|
|
|
#include "support/textutils.h"
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2007-08-14 22:18:27 +00:00
|
|
|
#include "boost/regex.hpp"
|
|
|
|
|
2010-01-08 16:40:41 +00:00
|
|
|
#include <set>
|
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
using namespace std;
|
2007-12-12 18:57:56 +00:00
|
|
|
using namespace lyx::support;
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
namespace lyx {
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2009-04-09 12:55:47 +00:00
|
|
|
namespace {
|
2009-01-17 00:16:31 +00:00
|
|
|
|
2009-04-09 12:55:47 +00:00
|
|
|
// gets the "family name" from an author-type string
|
2008-04-25 20:03:03 +00:00
|
|
|
docstring familyName(docstring const & name)
|
2007-11-05 20:33:20 +00:00
|
|
|
{
|
|
|
|
if (name.empty())
|
|
|
|
return docstring();
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2009-01-04 23:35:08 +00:00
|
|
|
// first we look for a comma, and take the last name to be everything
|
|
|
|
// preceding the right-most one, so that we also get the "jr" part.
|
|
|
|
docstring::size_type idx = name.rfind(',');
|
2007-11-05 20:33:20 +00:00
|
|
|
if (idx != docstring::npos)
|
2009-01-04 23:35:08 +00:00
|
|
|
return ltrim(name.substr(0, idx));
|
|
|
|
|
|
|
|
// OK, so now we want to look for the last name. We're going to
|
|
|
|
// include the "von" part. This isn't perfect.
|
|
|
|
// Split on spaces, to get various tokens.
|
|
|
|
vector<docstring> pieces = getVectorFromString(name, from_ascii(" "));
|
|
|
|
// If we only get two, assume the last one is the last name
|
|
|
|
if (pieces.size() <= 2)
|
|
|
|
return pieces.back();
|
|
|
|
|
|
|
|
// Now we look for the first token that begins with a lower case letter.
|
|
|
|
vector<docstring>::const_iterator it = pieces.begin();
|
|
|
|
vector<docstring>::const_iterator en = pieces.end();
|
|
|
|
for (; it != en; ++it) {
|
|
|
|
if ((*it).size() == 0)
|
|
|
|
continue;
|
|
|
|
char_type const c = (*it)[0];
|
|
|
|
if (isLower(c))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (it == en) // we never found a "von"
|
|
|
|
return pieces.back();
|
|
|
|
|
|
|
|
// reconstruct what we need to return
|
|
|
|
docstring retval;
|
|
|
|
bool first = true;
|
|
|
|
for (; it != en; ++it) {
|
|
|
|
if (!first)
|
|
|
|
retval += " ";
|
|
|
|
else
|
|
|
|
first = false;
|
|
|
|
retval += *it;
|
|
|
|
}
|
|
|
|
return retval;
|
2007-11-05 20:33:20 +00:00
|
|
|
}
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2009-04-09 12:55:47 +00:00
|
|
|
// converts a string containing LaTeX commands into unicode
|
|
|
|
// for display.
|
|
|
|
docstring convertLaTeXCommands(docstring const & str)
|
|
|
|
{
|
|
|
|
docstring val = str;
|
|
|
|
docstring ret;
|
|
|
|
|
|
|
|
bool scanning_cmd = false;
|
|
|
|
bool scanning_math = false;
|
|
|
|
bool escaped = false; // used to catch \$, etc.
|
|
|
|
while (val.size()) {
|
|
|
|
char_type const ch = val[0];
|
|
|
|
|
|
|
|
// if we're scanning math, we output everything until we
|
|
|
|
// find an unescaped $, at which point we break out.
|
|
|
|
if (scanning_math) {
|
|
|
|
if (escaped)
|
|
|
|
escaped = false;
|
|
|
|
else if (ch == '\\')
|
|
|
|
escaped = true;
|
|
|
|
else if (ch == '$')
|
|
|
|
scanning_math = false;
|
|
|
|
ret += ch;
|
|
|
|
val = val.substr(1);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// if we're scanning a command name, then we just
|
|
|
|
// discard characters until we hit something that
|
|
|
|
// isn't alpha.
|
|
|
|
if (scanning_cmd) {
|
|
|
|
if (isAlphaASCII(ch)) {
|
|
|
|
val = val.substr(1);
|
|
|
|
escaped = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// so we're done with this command.
|
|
|
|
// now we fall through and check this character.
|
|
|
|
scanning_cmd = false;
|
|
|
|
}
|
|
|
|
|
2009-12-13 21:14:36 +00:00
|
|
|
// was the last character a \? If so, then this is something like:
|
|
|
|
// \\ or \$, so we'll just output it. That's probably not always right...
|
2009-04-09 12:55:47 +00:00
|
|
|
if (escaped) {
|
2009-12-13 09:50:30 +00:00
|
|
|
// exception: output \, as THIN SPACE
|
|
|
|
if (ch == ',')
|
|
|
|
ret.push_back(0x2009);
|
|
|
|
else
|
|
|
|
ret += ch;
|
2009-04-09 12:55:47 +00:00
|
|
|
val = val.substr(1);
|
|
|
|
escaped = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ch == '$') {
|
|
|
|
ret += ch;
|
|
|
|
val = val.substr(1);
|
|
|
|
scanning_math = true;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// we just ignore braces
|
|
|
|
if (ch == '{' || ch == '}') {
|
|
|
|
val = val.substr(1);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// we're going to check things that look like commands, so if
|
|
|
|
// this doesn't, just output it.
|
|
|
|
if (ch != '\\') {
|
|
|
|
ret += ch;
|
|
|
|
val = val.substr(1);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ok, could be a command of some sort
|
|
|
|
// let's see if it corresponds to some unicode
|
|
|
|
// unicodesymbols has things in the form: \"{u},
|
|
|
|
// whereas we may see things like: \"u. So we'll
|
|
|
|
// look for that and change it, if necessary.
|
|
|
|
static boost::regex const reg("^\\\\\\W\\w");
|
|
|
|
if (boost::regex_search(to_utf8(val), reg)) {
|
|
|
|
val.insert(3, from_ascii("}"));
|
|
|
|
val.insert(2, from_ascii("{"));
|
|
|
|
}
|
|
|
|
docstring rem;
|
2009-06-12 14:03:57 +00:00
|
|
|
docstring const cnvtd = Encodings::fromLaTeXCommand(val, rem,
|
|
|
|
Encodings::TEXT_CMD);
|
2009-04-09 12:55:47 +00:00
|
|
|
if (!cnvtd.empty()) {
|
|
|
|
// it did, so we'll take that bit and proceed with what's left
|
|
|
|
ret += cnvtd;
|
|
|
|
val = rem;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// it's a command of some sort
|
|
|
|
scanning_cmd = true;
|
|
|
|
escaped = true;
|
|
|
|
val = val.substr(1);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // anon namespace
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// BibTeXInfo
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
BibTeXInfo::BibTeXInfo(docstring const & key, docstring const & type)
|
2010-01-11 16:11:55 +00:00
|
|
|
: is_bibtex_(true), bib_key_(key), entry_type_(type), info_(),
|
|
|
|
modifier_(0)
|
2009-04-09 12:55:47 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring const BibTeXInfo::getAbbreviatedAuthor() const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2008-11-19 03:52:22 +00:00
|
|
|
if (!is_bibtex_) {
|
2009-06-11 20:29:37 +00:00
|
|
|
docstring const opt = label();
|
2008-11-19 03:52:22 +00:00
|
|
|
if (opt.empty())
|
|
|
|
return docstring();
|
|
|
|
|
|
|
|
docstring authors;
|
2010-01-21 19:48:53 +00:00
|
|
|
docstring const remainder = trim(split(opt, authors, '('));
|
|
|
|
if (remainder.empty())
|
|
|
|
// in this case, we didn't find a "(",
|
|
|
|
// so we don't have author (year)
|
|
|
|
return docstring();
|
2008-11-19 03:52:22 +00:00
|
|
|
return authors;
|
|
|
|
}
|
|
|
|
|
2009-06-12 14:29:39 +00:00
|
|
|
docstring author = convertLaTeXCommands(operator[]("author"));
|
2007-08-14 16:50:51 +00:00
|
|
|
if (author.empty()) {
|
2009-06-12 14:29:39 +00:00
|
|
|
author = convertLaTeXCommands(operator[]("editor"));
|
2007-08-20 16:30:02 +00:00
|
|
|
if (author.empty())
|
2008-02-14 17:00:40 +00:00
|
|
|
return bib_key_;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
// OK, we've got some names. Let's format them.
|
|
|
|
// Try to split the author list on " and "
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> const authors =
|
|
|
|
getVectorFromString(author, from_ascii(" and "));
|
2008-11-19 03:52:22 +00:00
|
|
|
|
2007-08-14 16:50:51 +00:00
|
|
|
if (authors.size() == 2)
|
|
|
|
return bformat(_("%1$s and %2$s"),
|
2007-08-20 16:30:02 +00:00
|
|
|
familyName(authors[0]), familyName(authors[1]));
|
2007-11-05 20:33:20 +00:00
|
|
|
|
|
|
|
if (authors.size() > 2)
|
2007-08-14 16:50:51 +00:00
|
|
|
return bformat(_("%1$s et al."), familyName(authors[0]));
|
2007-11-05 20:33:20 +00:00
|
|
|
|
|
|
|
return familyName(authors[0]);
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring const BibTeXInfo::getYear() const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2009-04-04 21:04:26 +00:00
|
|
|
if (is_bibtex_)
|
|
|
|
return operator[]("year");
|
2008-11-19 03:52:22 +00:00
|
|
|
|
2009-06-11 20:29:37 +00:00
|
|
|
docstring const opt = label();
|
2009-04-04 21:04:26 +00:00
|
|
|
if (opt.empty())
|
|
|
|
return docstring();
|
2008-11-19 03:52:22 +00:00
|
|
|
|
2009-04-04 21:04:26 +00:00
|
|
|
docstring authors;
|
2010-01-21 19:48:53 +00:00
|
|
|
docstring tmp = split(opt, authors, '(');
|
|
|
|
if (tmp.empty())
|
|
|
|
// we don't have author (year)
|
|
|
|
return docstring();
|
2009-04-04 21:04:26 +00:00
|
|
|
docstring year;
|
2010-01-21 19:48:53 +00:00
|
|
|
tmp = split(tmp, year, ')');
|
2007-08-14 16:50:51 +00:00
|
|
|
return year;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring const BibTeXInfo::getXRef() const
|
|
|
|
{
|
|
|
|
if (!is_bibtex_)
|
|
|
|
return docstring();
|
|
|
|
return operator[]("crossref");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-17 00:29:32 +00:00
|
|
|
docstring const & BibTeXInfo::getInfo(BibTeXInfo const * const xref) const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2009-01-16 23:40:37 +00:00
|
|
|
if (!info_.empty())
|
|
|
|
return info_;
|
|
|
|
|
2008-02-14 17:00:40 +00:00
|
|
|
if (!is_bibtex_) {
|
2007-08-20 16:30:02 +00:00
|
|
|
BibTeXInfo::const_iterator it = find(from_ascii("ref"));
|
2009-01-16 23:40:37 +00:00
|
|
|
info_ = it->second;
|
|
|
|
return info_;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
2007-08-16 01:59:20 +00:00
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
// FIXME
|
2009-01-17 00:29:32 +00:00
|
|
|
// This could be made a lot better using the entry_type_
|
2007-11-05 20:33:20 +00:00
|
|
|
// field to customize the output based upon entry type.
|
2007-08-16 01:59:20 +00:00
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
// Search for all possible "required" fields
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring author = getValueForKey("author", xref);
|
2007-08-14 16:50:51 +00:00
|
|
|
if (author.empty())
|
2009-01-17 00:16:31 +00:00
|
|
|
author = getValueForKey("editor", xref);
|
2007-08-16 01:59:20 +00:00
|
|
|
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring year = getValueForKey("year", xref);
|
|
|
|
docstring title = getValueForKey("title", xref);
|
|
|
|
docstring docLoc = getValueForKey("pages", xref);
|
2007-08-16 01:59:20 +00:00
|
|
|
if (docLoc.empty()) {
|
2009-01-17 00:16:31 +00:00
|
|
|
docLoc = getValueForKey("chapter", xref);
|
2007-08-16 01:59:20 +00:00
|
|
|
if (!docLoc.empty())
|
2009-01-17 18:12:02 +00:00
|
|
|
docLoc = _("Ch. ") + docLoc;
|
2007-11-05 20:33:20 +00:00
|
|
|
} else {
|
2009-01-17 18:12:02 +00:00
|
|
|
docLoc = _("pp. ") + docLoc;
|
2007-11-05 20:33:20 +00:00
|
|
|
}
|
|
|
|
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring media = getValueForKey("journal", xref);
|
2007-11-05 20:33:20 +00:00
|
|
|
if (media.empty()) {
|
2009-01-17 00:16:31 +00:00
|
|
|
media = getValueForKey("publisher", xref);
|
2007-08-16 01:59:20 +00:00
|
|
|
if (media.empty()) {
|
2009-01-17 00:16:31 +00:00
|
|
|
media = getValueForKey("school", xref);
|
2007-11-05 20:33:20 +00:00
|
|
|
if (media.empty())
|
2009-01-17 00:16:31 +00:00
|
|
|
media = getValueForKey("institution");
|
2007-08-16 01:59:20 +00:00
|
|
|
}
|
2007-11-05 20:33:20 +00:00
|
|
|
}
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring volume = getValueForKey("volume", xref);
|
2007-11-05 20:33:20 +00:00
|
|
|
|
|
|
|
odocstringstream result;
|
|
|
|
if (!author.empty())
|
|
|
|
result << author << ", ";
|
|
|
|
if (!title.empty())
|
|
|
|
result << title;
|
|
|
|
if (!media.empty())
|
|
|
|
result << ", " << media;
|
|
|
|
if (!year.empty())
|
2009-01-17 00:16:31 +00:00
|
|
|
result << " (" << year << ")";
|
2007-11-05 20:33:20 +00:00
|
|
|
if (!docLoc.empty())
|
|
|
|
result << ", " << docLoc;
|
|
|
|
|
|
|
|
docstring const result_str = rtrim(result.str());
|
2009-01-16 23:40:37 +00:00
|
|
|
if (!result_str.empty()) {
|
2009-01-16 23:42:16 +00:00
|
|
|
info_ = convertLaTeXCommands(result_str);
|
2009-01-16 23:40:37 +00:00
|
|
|
return info_;
|
|
|
|
}
|
2007-11-05 20:33:20 +00:00
|
|
|
|
|
|
|
// This should never happen (or at least be very unusual!)
|
2009-01-17 00:29:32 +00:00
|
|
|
static docstring e = docstring();
|
|
|
|
return e;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-09 12:55:47 +00:00
|
|
|
docstring const & BibTeXInfo::operator[](docstring const & field) const
|
|
|
|
{
|
|
|
|
BibTeXInfo::const_iterator it = find(field);
|
|
|
|
if (it != end())
|
|
|
|
return it->second;
|
|
|
|
static docstring const empty_value = docstring();
|
|
|
|
return empty_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
docstring const & BibTeXInfo::operator[](string const & field) const
|
|
|
|
{
|
|
|
|
return operator[](from_ascii(field));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
docstring BibTeXInfo::getValueForKey(string const & key,
|
|
|
|
BibTeXInfo const * const xref) const
|
|
|
|
{
|
|
|
|
docstring const ret = operator[](key);
|
|
|
|
if (!ret.empty() || !xref)
|
|
|
|
return ret;
|
|
|
|
return (*xref)[key];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2007-08-20 16:30:02 +00:00
|
|
|
//
|
|
|
|
// BiblioInfo
|
|
|
|
//
|
2007-11-05 20:33:20 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2007-08-20 16:30:02 +00:00
|
|
|
|
2007-08-14 16:50:51 +00:00
|
|
|
namespace {
|
2007-12-12 19:28:07 +00:00
|
|
|
// A functor for use with sort, leading to case insensitive sorting
|
|
|
|
class compareNoCase: public binary_function<docstring, docstring, bool>
|
2007-08-20 16:30:02 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool operator()(docstring const & s1, docstring const & s2) const {
|
|
|
|
return compare_no_case(s1, s2) < 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} // namespace anon
|
|
|
|
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> const BiblioInfo::getKeys() const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> bibkeys;
|
|
|
|
BiblioInfo::const_iterator it = begin();
|
|
|
|
for (; it != end(); ++it)
|
|
|
|
bibkeys.push_back(it->first);
|
2007-12-12 19:28:07 +00:00
|
|
|
sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
|
2007-08-20 16:30:02 +00:00
|
|
|
return bibkeys;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> const BiblioInfo::getFields() const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> bibfields;
|
2008-02-14 17:00:40 +00:00
|
|
|
set<docstring>::const_iterator it = field_names_.begin();
|
|
|
|
set<docstring>::const_iterator end = field_names_.end();
|
2007-08-20 16:30:02 +00:00
|
|
|
for (; it != end; ++it)
|
|
|
|
bibfields.push_back(*it);
|
2007-12-12 19:28:07 +00:00
|
|
|
sort(bibfields.begin(), bibfields.end());
|
2007-08-20 16:30:02 +00:00
|
|
|
return bibfields;
|
|
|
|
}
|
2007-08-14 16:50:51 +00:00
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
|
|
|
|
vector<docstring> const BiblioInfo::getEntries() const
|
|
|
|
{
|
|
|
|
vector<docstring> bibentries;
|
2008-02-14 17:00:40 +00:00
|
|
|
set<docstring>::const_iterator it = entry_types_.begin();
|
|
|
|
set<docstring>::const_iterator end = entry_types_.end();
|
2007-08-20 16:30:02 +00:00
|
|
|
for (; it != end; ++it)
|
|
|
|
bibentries.push_back(*it);
|
2007-12-12 19:28:07 +00:00
|
|
|
sort(bibentries.begin(), bibentries.end());
|
2007-08-20 16:30:02 +00:00
|
|
|
return bibentries;
|
|
|
|
}
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring const BiblioInfo::getAbbreviatedAuthor(docstring const & key) const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2007-08-20 16:30:02 +00:00
|
|
|
BiblioInfo::const_iterator it = find(key);
|
|
|
|
if (it == end())
|
|
|
|
return docstring();
|
|
|
|
BibTeXInfo const & data = it->second;
|
|
|
|
return data.getAbbreviatedAuthor();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-11 16:11:55 +00:00
|
|
|
docstring const BiblioInfo::getCiteNumber(docstring const & key) const
|
|
|
|
{
|
|
|
|
BiblioInfo::const_iterator it = find(key);
|
|
|
|
if (it == end())
|
|
|
|
return docstring();
|
|
|
|
BibTeXInfo const & data = it->second;
|
|
|
|
return data.citeNumber();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
docstring const BiblioInfo::getYear(docstring const & key, bool use_modifier) const
|
2007-08-20 16:30:02 +00:00
|
|
|
{
|
|
|
|
BiblioInfo::const_iterator it = find(key);
|
|
|
|
if (it == end())
|
|
|
|
return docstring();
|
|
|
|
BibTeXInfo const & data = it->second;
|
2009-01-17 00:16:31 +00:00
|
|
|
docstring year = data.getYear();
|
2010-01-11 16:11:55 +00:00
|
|
|
if (year.empty()) {
|
|
|
|
// let's try the crossref
|
|
|
|
docstring const xref = data.getXRef();
|
|
|
|
if (xref.empty())
|
|
|
|
return _("No year"); // no luck
|
|
|
|
BiblioInfo::const_iterator const xrefit = find(xref);
|
|
|
|
if (xrefit == end())
|
|
|
|
return _("No year"); // no luck again
|
|
|
|
BibTeXInfo const & xref_data = xrefit->second;
|
|
|
|
year = xref_data.getYear();
|
|
|
|
}
|
|
|
|
if (use_modifier && data.modifier() != 0)
|
|
|
|
year += data.modifier();
|
|
|
|
return year;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring const BiblioInfo::getInfo(docstring const & key) const
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2007-08-20 16:30:02 +00:00
|
|
|
BiblioInfo::const_iterator it = find(key);
|
|
|
|
if (it == end())
|
2007-08-14 16:50:51 +00:00
|
|
|
return docstring();
|
2007-08-20 16:30:02 +00:00
|
|
|
BibTeXInfo const & data = it->second;
|
2009-01-17 00:16:31 +00:00
|
|
|
BibTeXInfo const * xrefptr = 0;
|
|
|
|
docstring const xref = data.getXRef();
|
|
|
|
if (!xref.empty()) {
|
|
|
|
BiblioInfo::const_iterator const xrefit = find(xref);
|
|
|
|
if (xrefit != end())
|
|
|
|
xrefptr = &(xrefit->second);
|
|
|
|
}
|
|
|
|
return data.getInfo(xrefptr);
|
2007-08-20 16:30:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-13 15:22:49 +00:00
|
|
|
bool BiblioInfo::isBibtex(docstring const & key) const
|
2010-02-12 16:08:30 +00:00
|
|
|
{
|
|
|
|
BiblioInfo::const_iterator it = find(key);
|
|
|
|
if (it == end())
|
|
|
|
return false;
|
|
|
|
return it->second.isBibTeX();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
vector<docstring> const BiblioInfo::getCiteStrings(
|
|
|
|
docstring const & key, Buffer const & buf) const
|
|
|
|
{
|
2008-04-20 15:00:11 +00:00
|
|
|
CiteEngine const engine = buf.params().citeEngine();
|
|
|
|
if (engine == ENGINE_BASIC || engine == ENGINE_NATBIB_NUMERICAL)
|
2007-08-20 16:30:02 +00:00
|
|
|
return getNumericalStrings(key, buf);
|
|
|
|
else
|
|
|
|
return getAuthorYearStrings(key, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vector<docstring> const BiblioInfo::getNumericalStrings(
|
|
|
|
docstring const & key, Buffer const & buf) const
|
|
|
|
{
|
|
|
|
if (empty())
|
|
|
|
return vector<docstring>();
|
|
|
|
|
|
|
|
docstring const author = getAbbreviatedAuthor(key);
|
|
|
|
docstring const year = getYear(key);
|
|
|
|
if (author.empty() || year.empty())
|
|
|
|
return vector<docstring>();
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
vector<CiteStyle> const & styles = citeStyles(buf.params().citeEngine());
|
2007-08-20 16:30:02 +00:00
|
|
|
|
|
|
|
vector<docstring> vec(styles.size());
|
2008-04-20 15:00:11 +00:00
|
|
|
for (size_t i = 0; i != vec.size(); ++i) {
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring str;
|
|
|
|
|
|
|
|
switch (styles[i]) {
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITE:
|
|
|
|
case CITEP:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = from_ascii("[#ID]");
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case NOCITE:
|
2007-12-20 15:46:14 +00:00
|
|
|
str = _("Add to bibliography only.");
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITET:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author + " [#ID]";
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEALT:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author + " #ID";
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEALP:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = from_ascii("#ID");
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEAUTHOR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEYEAR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = year;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEYEARPAR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = '(' + year + ')';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
vec[i] = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
return vec;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vector<docstring> const BiblioInfo::getAuthorYearStrings(
|
|
|
|
docstring const & key, Buffer const & buf) const
|
|
|
|
{
|
|
|
|
if (empty())
|
|
|
|
return vector<docstring>();
|
|
|
|
|
|
|
|
docstring const author = getAbbreviatedAuthor(key);
|
|
|
|
docstring const year = getYear(key);
|
|
|
|
if (author.empty() || year.empty())
|
|
|
|
return vector<docstring>();
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
vector<CiteStyle> const & styles = citeStyles(buf.params().citeEngine());
|
2007-08-20 16:30:02 +00:00
|
|
|
|
|
|
|
vector<docstring> vec(styles.size());
|
2008-04-20 15:00:11 +00:00
|
|
|
for (size_t i = 0; i != vec.size(); ++i) {
|
2007-08-20 16:30:02 +00:00
|
|
|
docstring str;
|
|
|
|
|
|
|
|
switch (styles[i]) {
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITE:
|
2007-08-20 16:30:02 +00:00
|
|
|
// jurabib only: Author/Annotator
|
|
|
|
// (i.e. the "before" field, 2nd opt arg)
|
|
|
|
str = author + "/<" + _("before") + '>';
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case NOCITE:
|
2007-12-20 15:46:14 +00:00
|
|
|
str = _("Add to bibliography only.");
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITET:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author + " (" + year + ')';
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEP:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = '(' + author + ", " + year + ')';
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEALT:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author + ' ' + year ;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEALP:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author + ", " + year ;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEAUTHOR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = author;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEYEAR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = year;
|
|
|
|
break;
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
case CITEYEARPAR:
|
2007-08-20 16:30:02 +00:00
|
|
|
str = '(' + year + ')';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
vec[i] = str;
|
|
|
|
}
|
|
|
|
return vec;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-20 16:30:02 +00:00
|
|
|
|
2008-04-25 20:03:03 +00:00
|
|
|
void BiblioInfo::mergeBiblioInfo(BiblioInfo const & info)
|
|
|
|
{
|
|
|
|
bimap_.insert(info.begin(), info.end());
|
2007-08-20 16:30:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-08 16:40:41 +00:00
|
|
|
namespace {
|
|
|
|
// used in xhtml to sort a list of BibTeXInfo objects
|
|
|
|
bool lSorter(BibTeXInfo const * lhs, BibTeXInfo const * rhs)
|
|
|
|
{
|
2010-01-11 16:11:55 +00:00
|
|
|
docstring const lauth = lhs->getAbbreviatedAuthor();
|
|
|
|
docstring const rauth = rhs->getAbbreviatedAuthor();
|
|
|
|
docstring const lyear = lhs->getYear();
|
|
|
|
docstring const ryear = rhs->getYear();
|
|
|
|
docstring const ltitl = lhs->operator[]("title");
|
|
|
|
docstring const rtitl = rhs->operator[]("title");
|
|
|
|
return (lauth < rauth)
|
|
|
|
|| (lauth == rauth && lyear < ryear)
|
|
|
|
|| (lauth == rauth && lyear == ryear && ltitl < rtitl);
|
2010-01-08 16:40:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void BiblioInfo::collectCitedEntries(Buffer const & buf)
|
|
|
|
{
|
|
|
|
cited_entries_.clear();
|
|
|
|
// We are going to collect all the citation keys used in the document,
|
|
|
|
// getting them from the TOC.
|
|
|
|
// FIXME We may want to collect these differently, in the first case,
|
|
|
|
// so that we might have them in order of appearance.
|
|
|
|
set<docstring> citekeys;
|
|
|
|
Toc const & toc = buf.tocBackend().toc("citation");
|
|
|
|
Toc::const_iterator it = toc.begin();
|
|
|
|
Toc::const_iterator const en = toc.end();
|
|
|
|
for (; it != en; ++it) {
|
|
|
|
if (it->str().empty())
|
|
|
|
continue;
|
|
|
|
vector<docstring> const keys = getVectorFromString(it->str());
|
|
|
|
citekeys.insert(keys.begin(), keys.end());
|
|
|
|
}
|
|
|
|
if (citekeys.empty())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// We have a set of the keys used in this document.
|
|
|
|
// We will now convert it to a list of the BibTeXInfo objects used in
|
|
|
|
// this document...
|
|
|
|
vector<BibTeXInfo const *> bi;
|
|
|
|
set<docstring>::const_iterator cit = citekeys.begin();
|
|
|
|
set<docstring>::const_iterator const cen = citekeys.end();
|
|
|
|
for (; cit != cen; ++cit) {
|
|
|
|
BiblioInfo::const_iterator const bt = find(*cit);
|
|
|
|
if (bt == end() || !bt->second.isBibTeX())
|
|
|
|
continue;
|
|
|
|
bi.push_back(&(bt->second));
|
|
|
|
}
|
|
|
|
// ...and sort it.
|
|
|
|
sort(bi.begin(), bi.end(), lSorter);
|
|
|
|
|
|
|
|
// Now we can write the sorted keys
|
|
|
|
vector<BibTeXInfo const *>::const_iterator bit = bi.begin();
|
|
|
|
vector<BibTeXInfo const *>::const_iterator ben = bi.end();
|
|
|
|
for (; bit != ben; ++bit)
|
|
|
|
cited_entries_.push_back((*bit)->key());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-08 18:19:13 +00:00
|
|
|
void BiblioInfo::makeCitationLabels(Buffer const & buf)
|
|
|
|
{
|
|
|
|
collectCitedEntries(buf);
|
2010-01-11 16:11:55 +00:00
|
|
|
CiteEngine const engine = buf.params().citeEngine();
|
|
|
|
bool const numbers =
|
|
|
|
(engine == ENGINE_BASIC || engine == ENGINE_NATBIB_NUMERICAL);
|
|
|
|
|
|
|
|
int keynumber = 0;
|
|
|
|
char modifier = 0;
|
|
|
|
// used to remember the last one we saw
|
|
|
|
// we'll be comparing entries to see if we need to add
|
|
|
|
// modifiers, like "1984a"
|
|
|
|
map<docstring, BibTeXInfo>::iterator last;
|
|
|
|
|
2010-01-08 18:19:13 +00:00
|
|
|
vector<docstring>::const_iterator it = cited_entries_.begin();
|
|
|
|
vector<docstring>::const_iterator const en = cited_entries_.end();
|
|
|
|
for (; it != en; ++it) {
|
|
|
|
map<docstring, BibTeXInfo>::iterator const biit = bimap_.find(*it);
|
|
|
|
// this shouldn't happen, but...
|
|
|
|
if (biit == bimap_.end())
|
2010-01-11 16:11:55 +00:00
|
|
|
// ...fail gracefully, anyway.
|
2010-01-08 18:19:13 +00:00
|
|
|
continue;
|
|
|
|
BibTeXInfo & entry = biit->second;
|
2010-01-11 16:11:55 +00:00
|
|
|
if (numbers) {
|
|
|
|
docstring const num = convert<docstring>(++keynumber);
|
|
|
|
entry.setCiteNumber(num);
|
|
|
|
} else {
|
|
|
|
if (it != cited_entries_.begin()
|
|
|
|
&& entry.getAbbreviatedAuthor() == last->second.getAbbreviatedAuthor()
|
|
|
|
// we access the year via getYear() so as to get it from the xref,
|
|
|
|
// if we need to do so
|
|
|
|
&& getYear(entry.key()) == getYear(last->second.key())) {
|
|
|
|
if (modifier == 0) {
|
|
|
|
// so the last one should have been 'a'
|
|
|
|
last->second.setModifier('a');
|
|
|
|
modifier = 'b';
|
|
|
|
} else if (modifier == 'z')
|
|
|
|
modifier = 'A';
|
|
|
|
else
|
|
|
|
modifier++;
|
|
|
|
} else {
|
|
|
|
modifier = 0;
|
|
|
|
}
|
|
|
|
entry.setModifier(modifier);
|
|
|
|
// remember the last one
|
|
|
|
last = biit;
|
|
|
|
}
|
2010-01-08 18:19:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-05 20:33:20 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2007-08-20 16:30:02 +00:00
|
|
|
//
|
|
|
|
// CitationStyle
|
|
|
|
//
|
2007-11-05 20:33:20 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2007-08-20 16:30:02 +00:00
|
|
|
|
2007-08-14 16:50:51 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
|
|
char const * const citeCommands[] = {
|
2008-10-25 13:26:30 +00:00
|
|
|
"cite", "citet", "citep", "citealt", "citealp",
|
|
|
|
"citeauthor", "citeyear", "citeyearpar", "nocite" };
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
unsigned int const nCiteCommands =
|
|
|
|
sizeof(citeCommands) / sizeof(char *);
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
CiteStyle const citeStylesArray[] = {
|
2008-09-25 18:13:25 +00:00
|
|
|
CITE, CITET, CITEP, CITEALT, CITEALP,
|
|
|
|
CITEAUTHOR, CITEYEAR, CITEYEARPAR, NOCITE };
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
unsigned int const nCiteStyles =
|
2008-04-20 15:00:11 +00:00
|
|
|
sizeof(citeStylesArray) / sizeof(CiteStyle);
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
CiteStyle const citeStylesFull[] = {
|
|
|
|
CITET, CITEP, CITEALT, CITEALP, CITEAUTHOR };
|
|
|
|
|
|
|
|
unsigned int const nCiteStylesFull =
|
|
|
|
sizeof(citeStylesFull) / sizeof(CiteStyle);
|
|
|
|
|
|
|
|
CiteStyle const citeStylesUCase[] = {
|
|
|
|
CITET, CITEP, CITEALT, CITEALP, CITEAUTHOR };
|
|
|
|
|
|
|
|
unsigned int const nCiteStylesUCase =
|
|
|
|
sizeof(citeStylesUCase) / sizeof(CiteStyle);
|
|
|
|
|
|
|
|
} // namespace anon
|
|
|
|
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
CitationStyle citationStyleFromString(string const & command)
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2008-04-20 15:00:11 +00:00
|
|
|
CitationStyle s;
|
2007-08-14 16:50:51 +00:00
|
|
|
if (command.empty())
|
2008-04-20 15:00:11 +00:00
|
|
|
return s;
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
string cmd = command;
|
|
|
|
if (cmd[0] == 'C') {
|
2008-04-20 15:00:11 +00:00
|
|
|
s.forceUpperCase = true;
|
2007-08-14 16:50:51 +00:00
|
|
|
cmd[0] = 'c';
|
|
|
|
}
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
size_t const n = cmd.size() - 1;
|
2007-08-14 16:50:51 +00:00
|
|
|
if (cmd != "cite" && cmd[n] == '*') {
|
2008-04-20 15:00:11 +00:00
|
|
|
s.full = true;
|
2008-09-08 01:18:33 +00:00
|
|
|
cmd = cmd.substr(0, n);
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
char const * const * const last = citeCommands + nCiteCommands;
|
2007-12-12 19:28:07 +00:00
|
|
|
char const * const * const ptr = find(citeCommands, last, cmd);
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
if (ptr != last) {
|
|
|
|
size_t idx = ptr - citeCommands;
|
2008-04-20 15:00:11 +00:00
|
|
|
s.style = citeStylesArray[idx];
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
2008-04-20 15:00:11 +00:00
|
|
|
return s;
|
2007-08-14 16:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
string citationStyleToString(const CitationStyle & s)
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
2008-04-20 15:00:11 +00:00
|
|
|
string cite = citeCommands[s.style];
|
|
|
|
if (s.full) {
|
2007-08-14 16:50:51 +00:00
|
|
|
CiteStyle const * last = citeStylesFull + nCiteStylesFull;
|
2009-11-07 12:50:30 +00:00
|
|
|
if (std::find(citeStylesFull, last, s.style) != last)
|
2007-08-14 16:50:51 +00:00
|
|
|
cite += '*';
|
|
|
|
}
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
if (s.forceUpperCase) {
|
2007-08-14 16:50:51 +00:00
|
|
|
CiteStyle const * last = citeStylesUCase + nCiteStylesUCase;
|
2009-11-07 12:50:30 +00:00
|
|
|
if (std::find(citeStylesUCase, last, s.style) != last)
|
2007-08-14 16:50:51 +00:00
|
|
|
cite[0] = 'C';
|
|
|
|
}
|
|
|
|
|
|
|
|
return cite;
|
|
|
|
}
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
vector<CiteStyle> citeStyles(CiteEngine engine)
|
2007-08-14 16:50:51 +00:00
|
|
|
{
|
|
|
|
unsigned int nStyles = 0;
|
|
|
|
unsigned int start = 0;
|
|
|
|
|
|
|
|
switch (engine) {
|
|
|
|
case ENGINE_BASIC:
|
2007-12-20 15:46:14 +00:00
|
|
|
nStyles = 2;
|
2007-08-14 16:50:51 +00:00
|
|
|
start = 0;
|
|
|
|
break;
|
|
|
|
case ENGINE_NATBIB_AUTHORYEAR:
|
|
|
|
case ENGINE_NATBIB_NUMERICAL:
|
|
|
|
nStyles = nCiteStyles - 1;
|
|
|
|
start = 1;
|
|
|
|
break;
|
|
|
|
case ENGINE_JURABIB:
|
|
|
|
nStyles = nCiteStyles;
|
|
|
|
start = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
vector<CiteStyle> styles(nStyles);
|
2007-11-05 20:33:20 +00:00
|
|
|
size_t i = 0;
|
2007-08-14 16:50:51 +00:00
|
|
|
int j = start;
|
|
|
|
for (; i != styles.size(); ++i, ++j)
|
2008-04-20 15:00:11 +00:00
|
|
|
styles[i] = citeStylesArray[j];
|
2007-08-14 16:50:51 +00:00
|
|
|
|
|
|
|
return styles;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|