mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 03:03:06 +00:00
support \% in bib files; support annote field
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9732 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7a032c6b06
commit
f5bde88677
@ -1,3 +1,8 @@
|
||||
2005-03-15 Eitan Frachtenberg <sky8an@gmail.com>
|
||||
|
||||
* biblio.C (getInfo): Show BibTeX annotation in citation preview
|
||||
(parseBibTex): Treat \% as percent, not comment
|
||||
|
||||
2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
|
||||
|
||||
* ControlSpellchecker.C (nextWord): size() -> depth()
|
||||
|
@ -324,6 +324,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())
|
||||
@ -352,6 +353,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(result.str());
|
||||
if (!result_str.empty())
|
||||
@ -480,7 +483,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
|
||||
|
Loading…
Reference in New Issue
Block a user