namespace {
// A functor for use with std::sort, leading to case insensitive sorting
-struct compareNoCase: public std::binary_function<string, string, bool>
+class compareNoCase: public std::binary_function<string, string, bool>
{
+public:
bool operator()(string const & s1, string const & s2) const {
return compare_ascii_no_case(s1, s2) < 0;
}
string number = parseBibTeX(data, "number");
string volume = parseBibTeX(data, "volume");
string pages = parseBibTeX(data, "pages");
+ string annote = parseBibTeX(data, "annote");
string media = parseBibTeX(data, "journal");
if (media.empty())
result << ", pp. " << pages;
if (!year.empty())
result << ", " << year;
+ if (!annote.empty())
+ result << "\n\n" << annote;
string const result_str = rtrim(result.str());
if (!result_str.empty())
// A functor for use with std::find_if, used to ascertain whether a
// data entry matches the required regex_
-struct RegexMatch : public std::unary_function<string, bool>
+class RegexMatch : public std::unary_function<string, bool>
{
+public:
// re and icase are used to construct an instance of boost::RegEx.
// if icase is true, then matching is insensitive to case
RegexMatch(InfoMap const & m, string const & re, bool icase)
string::size_type const idx =
dummy.empty() ? string::npos : dummy.find('%');
if (idx != string::npos)
- dummy.erase(idx, string::npos);
+ // Check if this is really a comment or just "\%"
+ if (idx == 0 || dummy[idx - 1] != '\\')
+ dummy.erase(idx, string::npos);
+ else // This is "\%", so just erase the '\'
+ dummy.erase(idx - 1, 1);
// do we have a new token or a new line of
// the same one? In the first case we ignore
// the \n and in the second we replace it