Commit Graph

1320 Commits

Author SHA1 Message Date
Juergen Spitzmueller
3efd64696f Consider required modules when checking for layout definitions in modules
Fixes: #11156.
(cherry picked from commit 8b4c76fb24)
2018-09-09 12:25:57 +02:00
Juergen Spitzmueller
c41f9f7ed7 tex2lyx: extend titling support
Rather than checking for hardcoded title commands such as \maketitle,
use the titlename and titletype as defined in the layout.

This now also includes title environments.

Fixes part of #6461

(cherry picked from commit 429edc0a59)
2018-09-09 11:33:25 +02:00
Richard Heck
bcb002039b Merge branch '2.3.2-staging' into 2.3.x 2018-04-14 23:52:31 -04:00
Uwe Stöhr
c690e8880b tex2lyx: parse \xymatrix
LyX's \xymatrix support relies on math therefore put it into math and parse its content

fixes bug #10638

(cherry picked from commit 1174279967)
2018-04-07 00:19:10 -04:00
Juergen Spitzmueller
d549330760 Handle comments in options
Things like
pdfpagemode=UseOutlines%None,UseOutlines,UseThumbs,FullScreen

was not imported correctly (the comment was not stripped)

Fixes the rest of #5737

(cherry picked from commit 820ec38da7)
2018-03-29 09:42:00 +02:00
Juergen Spitzmueller
c52baa7d81 tex2lyx: handle whitespace in table column declaration.
Fixes: #10804
(cherry picked from commit 247e1a223d)
2018-03-17 15:44:05 -04:00
Juergen Spitzmueller
11d20e132a tex2lyx: do not force default bibliography style if none is set
Some classes provide a \bibliographystyle, so we must not output any
\bibliographystyle if none is set in the TeX file.

Fixes: #10673
(cherry picked from commit ed331bedd6)
2018-03-17 15:44:05 -04:00
Juergen Spitzmueller
f711e44bcf tex2lyx: complete minted support (inputminted)
Also fix some whitespace issues in minted inset import.

(cherry picked from commit f3c5bcd2be)
2018-03-17 18:16:46 +01:00
Juergen Spitzmueller
ded23e1f9a tex2lyx: add support for lstinputlisting
(cherry picked from commit d325f79f5c)
2018-03-17 17:14:11 +01:00
Juergen Spitzmueller
910daa27e4 tex2lyx: add beamer test file
(cherry picked from commit 63b67fee83)
2018-03-17 14:36:45 +01:00
Juergen Spitzmueller
b0c9da0da1 tex2lyx: do not eat empty paragraphs if keepempty is true
Fixes: #11078
(cherry picked from commit 79728dcde9)
2018-03-17 13:55:33 +01:00
Juergen Spitzmueller
cfc2f0681e tex2lyx: handle makebeamertitle
(cherry picked from commit d93076c128)
2018-03-17 13:54:57 +01:00
Juergen Spitzmueller
5170efe2c9 tex2lyx: clear latexparam after use.
(cherry picked from commit 7e3a41bd15)
2018-03-17 13:54:36 +01:00
Juergen Spitzmueller
ce5b420a44 tex2lyx: add support for LaTeXParam
Part of #11068

(cherry picked from commit 506ae2d2ea)
2018-03-17 13:54:02 +01:00
Juergen Spitzmueller
42863eac92 tex2lyx: support for beamer text styles with overlays
E.g. things like \textbf<article>{foo} have to be imported as insets.

Part of #11068

(cherry picked from commit c74e399981)
2018-03-17 13:49:33 +01:00
Juergen Spitzmueller
7c816488b6 tex2lyx: More work on beamer support
* Implement list item overlay support (\item<arg>)
* Implement itemcommand support (e.g., \overprint<arg>)
* Fix general list argument placement

Part of: #11068

(cherry picked from commit e51265b5f3)
2018-03-17 13:49:13 +01:00
Juergen Spitzmueller
31c293dec3 tex2lyx: towards beamer overlay argument support.
Implemented: Overlay and standard overlay arguments for commands
and environments.

Still missing:
* List item overlay
* itemcommand overlay (\overprint)
* overlay via LatexParam (e.g., Flex:ArticleMode)

Needs fixing:
* General list argument (\begin{itemize}[arg])
* nested content in a frame with no title (empty par)

(cherry picked from commit 949de66956)
2018-03-17 13:48:46 +01:00
Juergen Spitzmueller
f01369a56f Fix known_escaped_chars
(this includes the amend)
2018-03-13 17:39:40 +01:00
Juergen Spitzmueller
cedb4838f0 update tex2lyx tests 2018-03-12 09:35:39 +01:00
Juergen Spitzmueller
d263ca0529 tex2lyx: update quote handling
* Consider new quote styles
* Consider changed quote styles
* Try to be a bit smarter with ambiguous quotation marks

(cherry picked from commit 8184f08f4a)
2018-03-12 09:19:17 +01:00
Juergen Spitzmueller
59449063df tex2lyx: support tipa \t*{} macro.
(cherry picked from commit cc6f2dae82)
2018-03-12 09:15:57 +01:00
Juergen Spitzmueller
fff6d35cff update tex2lyx tests once more. 2018-03-11 19:56:04 +01:00
Juergen Spitzmueller
bbaf2b6a29 amend 11e4a24e6e
(cherry picked from commit 386d9953e8)
2018-03-11 19:51:53 +01:00
Juergen Spitzmueller
64981aa48c update tex2lyx tests. 2018-03-11 19:32:21 +01:00
Juergen Spitzmueller
624a6642e9 tex2lyx: make nested CJK parsing slightly less dumb.
Fixes: #9562
(cherry picked from commit 0f4c902705)
2018-03-11 18:29:50 +01:00
Juergen Spitzmueller
590185d3ef tex2lyx: honor grouping in optional arguments.
E.g., \cite[{a literal ] character}]{key}

(cherry picked from commit cba38881d6)
2018-03-11 18:27:23 +01:00
Juergen Spitzmueller
ce2e155490 Fix copy and paste error in 6659304f7f
(cherry picked from commit 0513622fd0)
2018-03-11 18:26:59 +01:00
Juergen Spitzmueller
bd876d8163 tex2lyx: towards proper support of "literal"/"latexified" inset commands
We now report whether the attempt to recode the macros to glyphs
succeeded. If yes, we set "literate" to false, if not to true.

Also, do not attempt to recode for non-latexifying fields.

Fixes: #9563
(cherry picked from commit 6659304f7f)
2018-03-11 18:26:33 +01:00
Juergen Spitzmueller
f183686505 tex2lyx: support for URW Classico, MinionPro and the new Libertine fonts.
(cherry picked from commit a3836d9909)
2018-03-11 18:23:35 +01:00
Juergen Spitzmueller
5fc0dafac3 tex2lyx: get rid of another large if-else if chain.
(cherry picked from commit 11e4a24e6e)
2018-03-11 09:24:02 +01:00
Juergen Spitzmueller
91ce18388e Amend 15fd17d83f
(cherry picked from commit b2ccdae228)
2018-03-10 14:24:38 +01:00
Juergen Spitzmueller
0f33720d29 tex2lyx: support for \includeonly
(cherry picked from commit 15fd17d83f)
2018-03-10 11:09:40 +01:00
Juergen Spitzmueller
42dd5f5cfa tex2lyx: chapterbib support
(cherry picked from commit af6933c06f)
2018-03-10 10:33:10 +01:00
Juergen Spitzmueller
30cb99503f tex2lyx: support alignment pseudo-environments.
Fixes: #7857
(cherry picked from commit 7a22ce7c09)
2018-03-06 18:27:13 +01:00
Juergen Spitzmueller
94fe126161 tex2lyx: fix subfloat import
Fixes: #10385
(cherry picked from commit 1dcb2a0976)
2018-03-06 18:22:12 +01:00
Uwe Stöhr
a1cdc1e723 tex2lyx/text.cpp: fix a typo
(cherry picked from commit a30972a39c)
2018-03-06 08:21:34 +01:00
Juergen Spitzmueller
5f359e27b0 Small update of TODO
(cherry picked from commit 4bc379ea67)
2018-03-06 08:21:16 +01:00
Juergen Spitzmueller
95d446eb4c parse_text (tex2lyx): get rid of the monstrous if-then-else clause
Rather than that, continue in the loop if a condition is met.

This fixes tex2lyx for MINGW, which has a cluase-nesting threshold.

Fixes: #9552
(cherry picked from commit b94bb37e53)
2018-03-06 08:20:44 +01:00
Juergen Spitzmueller
8d02bff57e tex2lyx: support qualified citation lists (biblatex)
(cherry picked from commit 0915e81481)
2018-03-06 08:20:18 +01:00
Juergen Spitzmueller
8ab9b8e0b6 tex2lyx: refsection and bibbysection support (biblatex)
(cherry picked from commit 1a3dbbf07a)
2018-03-06 08:19:54 +01:00
Juergen Spitzmueller
50b78507b9 tex2lyx: support biblatex
(qualified citation lists and multibib not yet supported)

(cherry picked from commit f22213a04f)
2018-03-06 08:19:35 +01:00
Juergen Spitzmueller
3e6a1eecc5 tex2lyx: consider options passed via \PassOptionsToPackage
(cherry picked from commit 476401a76f)
2018-03-06 08:18:43 +01:00
Juergen Spitzmueller
84b59c90e7 tex2lyx: import straight quotation marks as ERT
This assures that they are output as straight quotations marks (e.g.,
babel shorthands).

Fixes: #75 [sic!]
(cherry picked from commit ccb9ae9670)
2018-03-06 08:17:18 +01:00
Juergen Spitzmueller
04e995e807 tex2lyx: normalize bib and bst paths
Fixes: #7637
(cherry picked from commit 3cc98a9bf6)
2018-02-09 18:57:53 +01:00
Uwe Stöhr
e73164e25d tex2lyx: support to detect https:// links
- Preamble.cpp: use the occasion to backport JMarcs recent compiler warning fixe
2017-12-17 02:28:54 +01:00
Kornel Benko
29a735463a Adapt the check for configure need to the one used in LyX::queryUserLyXDir()
We should refactor the check
2017-08-08 12:23:15 +02:00
Jean-Marc Lasgouttes
15a87dd3a8 Check whether a class is known before loading it
Fixes bug #10719.
2017-07-25 11:57:29 +02:00
Juergen Spitzmueller
3c7b75c5bc Properly import \newtheorem*
Fixes: #10622
2017-07-23 13:20:56 +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
Jean-Marc Lasgouttes
64667735f4 h_use_minted is a bool, not a string
We have a mix in this file of boolean stored as such or as strings.
This translates to values written as true/false or 1/0 in .lyx files.

In this case, the value of use_minted could only be true, since the
char * pointer is non null.

Also add some else clauses.

Spotted by coverity.
2017-07-06 14:11:30 +02:00