]> git.lyx.org Git - features.git/commit
tex2lyx: improve module support
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 4 Apr 2019 13:46:49 +0000 (15:46 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:24 +0000 (15:48 +0200)
commit2e0e1ad8cc068dccac1d824ea27b5cb6bfdfbd11
treeb14549dab9bbc55dcd60a71498742b6d6a6c6b75
parentde6cef898c996c72498073ce471f112af2a6ec67
tex2lyx: improve module support

The current heuristics only considered modules with styles that defined
a searched command in their preamble, and only for commands/environments
that were defined in the document's preamble. This limited the module
support drastically.

The new heuristics also checks for commands coming from packages. If the
command is not (re-)defined in the document preamble, it checks modules
that provide a style with a matching LaTeXName, checks for their
requirements and matches those with the packages loaded by the document.

If no module provides a searched style, but we found modules that load
packages that are loaded in the imported tex file, and if those packages
are not auto-loaded by LyX anyway, we also load this module.

fixes: #11259, part of #8229
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/tex2lyx/TODO.txt
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/tex2lyx.cpp