Commit Graph

177 Commits

Author SHA1 Message Date
Thibaut Cuvelier
3973bbcf99 DocBook: authorsToDocBookAuthorGroup never needs to return anything. 2024-03-01 13:32:17 +01:00
Juergen Spitzmueller
ce27f5beca Consider biblatex author -> bookauthor mapping in preview 2024-02-25 08:10:23 +01:00
Juergen Spitzmueller
82064f7bff Properly parse biblatex crossref'ed book titles 2024-02-24 15:51:35 +01:00
Juergen Spitzmueller
3eaa374506 Fix name type parsing 2024-02-24 15:27:56 +01:00
Juergen Spitzmueller
5b11066a37 Properly resolve crossref'ed data in BiblioInfo
This needs to take the mappings into account as well, not just
plain fields.
2024-02-24 15:26:41 +01:00
Juergen Spitzmueller
ea55ca5e84 Handle bibtex location field syntax file1;file2
This is used, for instance, by zotero with the "betterbibtex" exporter

See #12896
2023-09-09 13:00:36 +02:00
Juergen Spitzmueller
117e259f0a Handle multiple files in file and localfile BibTeX field (#12896) 2023-09-08 14:02:23 +02:00
Richard Kimberly Heck
5cb80b867f Hack to display section symbol 2023-07-28 12:07:15 -04:00
Richard Kimberly Heck
d815f382fa Fix warning 2023-07-27 16:57:04 -04:00
Richard Kimberly Heck
8424213ae4 Use non breaking space 2023-07-27 16:36:11 -04:00
Richard Kimberly Heck
f393e6d219 Fix bug #8741 2023-07-27 00:09:26 -04:00
Juergen Spitzmueller
fcc139b06e Consider that "and" in BibTeX name lists is case-insensitive (#10465) 2022-02-19 11:58:11 +01:00
Yuriy Skalko
d3c335a5d5 Remove useless casts reported by GCC with -Wuseless-cast option 2021-09-30 10:37:24 +03:00
Richard Kimberly Heck
41216228c0 Change name in source files 2020-12-05 17:17:02 -05:00
Yuriy Skalko
7779316e6c Include standard <regex> 2020-11-29 15:27:28 +02:00
Yuriy Skalko
10272e4747 Move include of own header to the top. Fix dependencies 2020-10-25 19:58:57 +02:00
Yuriy Skalko
196d9caeb0 Clean includes using the output of iwyu tool 2020-10-20 11:38:55 +03:00
Yuriy Skalko
af29f02dd8 Reduce includes in header files (2) 2020-10-19 18:01:17 +03:00
Jean-Marc Lasgouttes
dd65a97b55 Pass parameters as const references when possible
Fixes some cppcheck warnings.
2020-10-02 18:56:01 +02:00
Thibaut Cuvelier
8f3d0fd88f DocBook: new-line behaviour in bibliographies. 2020-09-19 20:43:39 +02:00
Juergen Spitzmueller
39caa70100 Clear info_ cache if format changes 2020-08-27 12:41:40 +02:00
Juergen Spitzmueller
b4ca3e4fa4 Assure bibinfo is correctly processed 2020-08-27 11:42:03 +02:00
Juergen Spitzmueller
8365eabd6f Make paper search function accessible and customizable 2020-08-27 08:48:55 +02:00
Scott Kostyshak
4c0073cd03 Whitespace 2020-08-20 21:51:29 -04:00
Pavel Sanda
e648202e7e Allow LyX to find pdfs and urls of citation references and follow them from context menu.
Currently tested:
- url & doi fields for bibtex.
- all documented eprinttypes of biblatex
- absolute paths of first entry of 'file' field for jabref and kbibtex
- external script searching for author + year pdf

Additional polishing will follow.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg212505.html
2020-08-20 09:12:54 +02:00
Richard Kimberly Heck
8ae0841826 Whitespace 2020-07-08 12:38:05 -04:00
Thibaut Cuvelier
3883b85f49 New DocBook support 2020-07-08 08:42:16 +02:00
Thibaut Cuvelier
a6b07608d8 Rename XHTMLStream to XMLStream, move it to another file, and prepare for DocBook adoption.
xml.cpp/h also merges functionalities from sgml.cpp/h.
2020-06-15 13:01:56 +02:00
Richard Kimberly Heck
c506f304bc Fix a number of issues that were stopping compilation with MSVC 19.
Patch from Thibaut Cuvelier, modified slightly by me (mostly for style).
2020-05-04 19:45:58 -04:00
Richard Kimberly Heck
4a81983edd Avoid a copy. 2020-02-29 05:55:20 -05:00
Richard Kimberly Heck
5b5b6998cb Use more ranges 2020-02-28 01:06:22 -05:00
Jean-Marc Lasgouttes
d9edf32b67 Remove some useless expressions
Spotted by cppcheck
2019-10-27 00:09:05 +02:00
Richard Kimberly Heck
c2f5c850d9 Use const & 2019-09-13 11:49:29 -04:00
Jean-Marc Lasgouttes
714113655a Follow some of the performance advice from cppcheck
Most of that is changing string to string const &.
2019-09-13 16:23:49 +02:00
Juergen Spitzmueller
1386a3d8fd Allow for multiple use of same key in qualified citation lists
File format change

Fixes: #11618, #11632
2019-08-07 13:00:29 +02:00
Juergen Spitzmueller
623f7b4795 Truncate long citation label in the middle rather than the end.
Fixes: #10769
2019-07-09 14:48:11 +02:00
Juergen Spitzmueller
bebc184054 Display full author list with Natbib (non-BibTeX) if requested 2019-04-19 09:33:31 +02:00
Juergen Spitzmueller
5db4d712ef Differentiate Buffer strings and GUI strings in citeengines
The former need to be translated to the buffer language, the latter to
the GUI language.

Fixes: #10946
2018-01-27 14:29:41 +01:00
Jean-Marc Lasgouttes
eebea6284d Simplify code in BiblioInfo.cpp
... and avoid MSVC warning

Fixes bug #10905
2017-12-14 15:43:04 +01:00
Enrico Forestieri
c16ccdb5fd Fix issue with regular expressions
At least with gcc 6.4, if the first parameter passed to
regex_match() is afterward changed, the second one gets
corrupted. This is avoided by using a temporary string.
2017-10-15 15:29:33 +02:00
Christian Ridderström
e30f3d76d2 Bulk cleanup/fix incorrect annotation at the end of namespaces.
This commit does a bulk fix of incorrect annotations (comments) at the
end of namespaces.

The commit was generated by initially running clang-format, and then
from the diff of the result extracting the hunks corresponding to
fixes of namespace comments. The changes being applied and all the
results have been manually reviewed. The source code successfully
builds on macOS.

Further details on the steps below, in case they're of interest to
someone else in the future.

1. Checkout a fresh and up to date version of src/

    git pull && git checkout -- src && git status src

2. Ensure there's a suitable .clang-format in place, i.e. with options
   to fix the comment at the end of namespaces, including:

    FixNamespaceComments:                           true
    SpacesBeforeTrailingComments:                   1

and that clang-format is >= 5.0.0, by doing e.g.:

    clang-format -dump-config | grep Comments:
    clang-format --version

3. Apply clang-format to the source:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")

4. Create and filter out hunks related to fixing the namespace

    git diff -U0 src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace.patch

5. Filter out hunks corresponding to simple fixes into to a separate patch:

    pcregrep -M -e '^diff[^\n]+\nindex[^\n]+\n--- [^\n]+\n\+\+\+ [^\n]+\n'  \
        -e '^@@ -[0-9]+ \+[0-9]+ @@[^\n]*\n-\}[^\n]*\n\+\}[^\n]*\n'         \
        fix_namespace.patch > fix_namespace_simple.patch

6. Manually review the simple patch and then apply it, after first
   restoring the source.

    git checkout -- src
    patch -p1 < fix_namespace_simple.path

7. Manually review the (simple) changes and then stage the changes

    git diff src
    git add src

8. Again apply clang-format and filter out hunks related to any
   remaining fixes to the namespace, this time filter with more
   context. There will be fewer hunks as all the simple cases have
   already been handled:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")
    git diff src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace2.patch

9. Manually review/edit the resulting patch file to remove hunks for files
   which need to be dealt with manually, noting the file names and
   line numbers. Then restore files to as before applying clang-format
   and apply the patch:

    git checkout src
    patch -p1 < fix_namespace2.patch

10. Manually fix the files noted in the previous step. Stage files,
    review changes and commit.
2017-07-23 13:11:54 +02:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Juergen Spitzmueller
5685080356 Correct restoration of citation style selection between engine switches
We stored the combo position index, but this changes on engine switch.

This also fixes a crash due to out-of-bound index at engine switch.

Fixes: #10692
2017-06-10 14:29:07 +02:00
Juergen Spitzmueller
1a8fd56333 Consider text-mode accents of the form {\v a} in BiblioInfo
Fixes #9340.
2017-03-19 16:15:03 +01:00
Juergen Spitzmueller
1eba2c92da Improve BibTeX name parsing #4
Handle name prefix (aka "von" part) as a separate entity, just like
BibTeX and Biblatex do. This allows to omit or reposition it in
accordance to the current style ("Goethe, Johann Wolfgang" or
"von Goethe, Johann Wolfgang" or "Goethe, Johann Wolfgang von" are all
valid and used).

LyX's name parser should now be on par with BibTeX's.
2017-03-19 14:03:48 +01:00
Juergen Spitzmueller
7489cab6c9 Replace "junior" with the more generic term "suffix". 2017-03-19 13:33:56 +01:00
Juergen Spitzmueller
5fdcca4c06 Improve BibTeX name parsing #3
Correctly handle name suffix ("Jr.-part")
2017-03-19 12:42:18 +01:00
Juergen Spitzmueller
9f4df64f23 Allow for simple conditions in name scheme.
I.e., only output a comma between last and first name if there is
a first name.
2017-03-19 11:45:42 +01:00
Juergen Spitzmueller
08500c1a7c Improve BibTeX name parsing #2
Also consider grouping when looking for name separators.

Cases such as {{Barnes and Noble, Inc.}} are now handled correctly.
2017-03-19 11:44:22 +01:00
Juergen Spitzmueller
ee26e7fadf Improve BibTeX name parsing #1
Consider groupings of name parts via {...}
2017-03-19 11:41:33 +01:00