#include "gettext.h"
#include "support/lstrings.h"
-#include "support/std_sstream.h"
#include <boost/regex.hpp>
#include <algorithm>
-
-using lyx::support::ascii_lowercase;
-using lyx::support::bformat;
-using lyx::support::compare_ascii_no_case;
-using lyx::support::contains;
-using lyx::support::getVectorFromString;
-using lyx::support::ltrim;
-using lyx::support::prefixIs;
-using lyx::support::rtrim;
-using lyx::support::split;
-using lyx::support::subst;
-using lyx::support::token;
-using lyx::support::trim;
+#include <sstream>
using std::string;
using std::ostringstream;
using std::vector;
+namespace lyx {
+
+using support::ascii_lowercase;
+using support::bformat;
+using support::compare_ascii_no_case;
+using support::contains;
+using support::getVectorFromString;
+using support::ltrim;
+using support::prefixIs;
+using support::rtrim;
+using support::split;
+using support::subst;
+using support::token;
+using support::trim;
+
namespace biblio {
namespace {
output = input;
// Jurabib does not support the 'full' natbib style.
- string::size_type const n = output.size() - 1;
- if (output != "cite*" && output[n] == '*')
- output = output.substr(0, n);
+ string::size_type const n = output.size() - 1;
+ if (output != "cite*" && output[n] == '*')
+ output = output.substr(0, n);
break;
}
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
}
} // namespace biblio
+} // namespace lyx