diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 4a384e3882..324720a07a 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2005-03-15 Eitan Frachtenberg + + * biblio.C (getInfo): Show BibTeX annotation in citation preview + (parseBibTex): Treat \% as percent, not comment + 2005-02-23 Angus Leeming * ControlForks.[Ch]: removed. diff --git a/src/frontends/controllers/biblio.C b/src/frontends/controllers/biblio.C index ad680646a8..07eca7a420 100644 --- a/src/frontends/controllers/biblio.C +++ b/src/frontends/controllers/biblio.C @@ -208,6 +208,7 @@ string const getInfo(InfoMap const & map, string const & key) 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()) @@ -236,6 +237,8 @@ string const getInfo(InfoMap const & map, string const & key) result << ", pp. " << pages; if (!year.empty()) result << ", " << year; + if (!annote.empty()) + result << "\n\n" << annote; string const result_str = rtrim(STRCONV(result.str())); if (!result_str.empty()) @@ -365,7 +368,11 @@ string const parseBibTeX(string data, string const & findkey) 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