Commit Graph

165 Commits

Author SHA1 Message Date
José Matos
940d3ceeb9 Make layout2layout compatible with Python 2 and 3 2022-01-03 19:59:42 +00:00
Thibaut Cuvelier
e93e50bf56 DocBook: add the DocBookRenderAsImage tag. 2021-10-13 19:26:48 +02:00
Thibaut Cuvelier
8b6e3d3749 DocBook: add more flexibility for floats.
Intended to fix #12371.
2021-09-20 00:06:20 +02:00
Thibaut Cuvelier
d18dff22b5 DocBook: add the DocBookNoFontInside layout configuration. 2021-02-13 05:09:59 +01:00
Juergen Spitzmueller
c567c78e90 Add ProvideInsetLayout and ModifyInsetLayout (#12098)
This complements ProvideStyle and ModifyStyle.
2021-01-30 15:56:31 +01:00
Juergen Spitzmueller
76eae4572e Introduce InputGlobal (#12087)
This is a variant of Input for layout files that only searches build
and system directories and thus allows "InputGlobal name.inc" in a user
file name.inc that attempts to modify its global counterpart.
2021-01-26 08:42:39 +01:00
Juergen Spitzmueller
91026711ae Introduce semantic label colors
This allows customization e.g. in dark mode and is a prerequisite
for color theming

Part of #8325
2020-12-11 11:44:45 +01:00
Richard Kimberly Heck
ae2ce7a86a LaTeXName tag for counters. Layout format change. 2020-12-05 16:46:33 -05:00
Thibaut Cuvelier
59acb375d1 DocBook: add layout parameters to control the special case and argument positioning.
Only for flex insets.

Also add similar checks in InsetText to avoid bibliographies in paragraphs.
2020-11-29 22:54:03 +01:00
Richard Kimberly Heck
060c3de2f0 StepMasterCounter --> StepParentCounter 2020-11-02 17:36:58 -05:00
Thibaut Cuvelier
149e1ccc02 DocBook: add DocBookSection parameter for styles that define new sections and implement argument parameters; improve Springer support.
For elements that should behave like sections (for now, mostly prefaces).

A second paragraph of PartBacktext can only wreak havok: it should start a section, and nothing else (otherwise, it's a real nightmare to implement).
2020-10-30 01:59:34 +01:00
Thibaut Cuvelier
0bd2978ac9 DocBook: add DocBookInnerTag and family.
This allows old DocBook documents to be valid when output.
2020-10-07 06:05:22 +02:00
Enrico Forestieri
77f9858388 Fix the layout2layout script
It was not correctly updated at dab71087, ad18c194, and 6998e764.
2020-09-28 22:29:28 +02:00
Thibaut Cuvelier
dd8660c07e layout2layout: use name instead of pseudonym. 2020-09-19 20:43:41 +02:00
Thibaut Cuvelier
6998e76495 DocBook: define new arguments in layouts to configure new-line behaviour. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
dab71087cf DocBook: add a layout tag to tell whether an item is the abstract or not. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
ad18c19492 DocBook: add new layout parameter DocBookWrapperMergeWithPrevious. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
fa38ae3fc0 Revert "DocBook: add new layout parameter DocBookWrapperMergeWithPrevious."
This reverts commit 59b0f88d2b.
2020-08-03 22:57:49 +02:00
Thibaut Cuvelier
f025538c95 Revert "DocBook: add a layout tag to tell whether an item is the abstract or not."
This reverts commit 5ccd63eff6.
2020-08-03 22:55:52 +02:00
Thibaut Cuvelier
5ccd63eff6 DocBook: add a layout tag to tell whether an item is the abstract or not. 2020-08-03 16:04:58 +02:00
Thibaut Cuvelier
59b0f88d2b DocBook: add new layout parameter DocBookWrapperMergeWithPrevious. 2020-08-03 16:04:57 +02:00
Pavel Sanda
28968b1f0d Add required elements in the layouts to support DocBook.
Slightly modified patch from Thibaut Cuvelier.
2020-07-07 09:49:48 +02:00
Richard Kimberly Heck
6f084c4c30 Some python cleanup from Thibault. 2020-06-21 11:37:23 -04:00
Richard Kimberly Heck
9bcb243ec6 Increment layout format. 2020-05-02 23:17:16 -04:00
Juergen Spitzmueller
cbfce678d8 Add Requires to float definition. 2019-08-12 12:18:28 +02:00
Juergen Spitzmueller
006f1cbe43 update layout formats 2019-08-07 17:10:58 +02:00
Juergen Spitzmueller
0b7305024a Use generic paper size names rather than LaTeXisms such as "letterpaper"
This allows to support classes that don't use the Xpaper wording.

Add support for KOMA font (keyval) syntax on top of that.

Also support class-specific font and paper sizes in tex2lyx.

File and layout format change.
2019-08-07 16:44:11 +02:00
Juergen Spitzmueller
50abaa0e57 Add FontSizeFormat textclass option
This allows to customize the way fontsizes are passed to the class (e.g.,
"fontsize=12", as used by KOMA, rather than "12pt").
2019-08-06 19:27:49 +02:00
Juergen Spitzmueller
c6f262a5b7 Add textclass options for paper size selection and default paper size
Fixes: #4506

Implementing this to the classes requires file format changes, as the
classes' page layout will likely differ from geometry's.
2019-08-06 17:34:16 +02:00
Juergen Spitzmueller
13b6632228 Add TextClass option BibInToc
Fixes #1889
2019-07-08 15:40:17 +02:00
Günter Milde
8556cb1c66 fix layout2layout with stdin/out for Py3.
sys.stdin and sys.stdout expect a Unicode string,
with bytes we must use sys.std(in|out).buffer.
2019-07-07 20:37:12 +02:00
Juergen Spitzmueller
c7efb677f8 New InsetLayout tag ParbreakIgnored
This effectively allow paragraph breaks in insets only for cosmetic
reasons (e.g., to align contents on different lines).

This is the last change necessary for an enhanced covington gloss support
(which uses the new covington gloss ui)
2019-06-02 18:16:30 +02:00
Juergen Spitzmueller
9e6d22ea9c Add InsertOnNewline argument tag
This adds a paragraph break before auto-inserting arguments in flex
insets.

Useful for specific arguments (particularly ling glosses)
2019-06-02 18:07:10 +02:00
Juergen Spitzmueller
9f04eeae03 Support FreeSpacing in InsetArgument 2019-06-02 16:33:06 +02:00
Juergen Spitzmueller
70b3d3adcc Add NewlineCmd InsetLayout and Argument option
This allows to specific an alternative macro for newlines

Fixes: #10407
2019-04-18 11:35:03 +02:00
Juergen Spitzmueller
ed44bbddee Add MenuString to InsetLayout
Fixes: #8818
2019-04-18 10:27:19 +02:00
Juergen Spitzmueller
4b3aacd13b Add TableStyle layout tag
Fixes: #8360
2019-03-26 17:42:56 +01:00
Juergen Spitzmueller
8b92a2a689 Add NeedMBoxProtect [inset]layout option
This accesses the inulemcmd output param which protects specific commands
(\cite, \ref) in an \mbox.

This is needed in ulem and soul commands, since their complex
detokenization makes such commands (who produce multiple words via local
assignment) fail.

So now it is possible to properly support ulem and soul via
[inset]layout

Fixes a case reported in #9404
2019-03-12 14:08:05 +01:00
Richard Kimberly Heck
e5fc7327e3 Extend fix for #7404 to allow any inset collapsible to be edited
externally.
2018-10-04 13:41:41 -04:00
Juergen Spitzmueller
b124adbd38 Introduce listpreamble argument type
This uses the InsetArgument interface to provide access to a document
part hitherto inaccessible by LyX: the part between \begin and the first
\item in a list (where lengths and counters can be redefined, for
instance).

Fixes: #11098

File format change, layout format change
2018-08-17 10:22:32 +02:00
Juergen Spitzmueller
bbf287a3c6 Allow for cite engine and format definitions/modifications in layouts
Now layout files and modules can extend the cite engines or completely
overwrite them, and modify the cite formats.

Any CiteEngine definition in a layout/module will completely overwrite
those by cite engine files.

AddToCiteEngine will extend them (add if they do not exist yet).

Any CiteFormat definition in a layout will be preferred to those in cite
engines. CiteFormat definitions that are not touched by the former are
still active, though (so, as opposed to CiteEngine, a CiteFormat does
not completely overwrite those by the engine files).

Layout format change.
2018-05-21 12:46:53 +02:00
Juergen Spitzmueller
e11bda2cea Layout format update after 2ba584957c 2018-04-14 10:28:22 +02:00
Juergen Spitzmueller
f3b89e4c72 Add IsAutoNestedBy
This is complementary to AutoNests: Styles can determine which other
style should auto-nest them. This is particularly useful for modules
that add new styles which should be auto-nested in a given context.
2017-12-29 10:36:03 +01:00
Juergen Spitzmueller
d6fb2abbea Some AutoNest polishment.
* Rename Nests to AutoNests
* Do it when changing from any style
2017-12-29 10:03:00 +01:00
Juergen Spitzmueller
99ecc6e2c9 Implement auto-nesting.
Now layouts can specify other layouts that should be nested in and
after the current one (if the layout is switched from the current one
and if it follows a paragraph in the current one).

This is particularly useful for things such as the beamer frames, where
particular layouts are practically always nested.
2017-12-28 17:44:54 +01:00
Juergen Spitzmueller
c466baaa5b Collapsable -> Collapsible (part 2)
The current spelling is not strictly wrong, but flagged as unusual or
historical by some authorities. It is also found fault with many
spell checkers. Thus we decided to move to the more standard "-ible"
form once and for all.

See #10678 for discussion

This part covers the most tricky part: the internal naming.
Translations and layouts will follow.

This will all also all be backported to 2.3.x, for the sake of backwards
compatibility (cherry-picking).
2017-10-16 10:12:21 +02:00
Juergen Spitzmueller
8fecdfc473 Fix literal string in binary context
In 1a26f9b26c, all strings in the context of regexes and
comparisons have been converted to byte-like objects for python2/3
compatibility reasons. This has not been considered in the later
commit 5c54557350, which makes layout2layout break with
TypeError: can't concat str to bytes.
2017-10-13 10:04:27 +02:00
Jean-Marc Lasgouttes
5c54557350 Honor trailing spaces in LabelString and friends
Remove the trimming operation on LabelString, LabelStringAppendix,
EndLabelString and LabelCounter. This trimming meant that quotes
strings were not preserved, which is wrong.

To preserve layouts, the Layout format has been updated to 64, so that
layout2layout can remove extra spaces on existing strings, which
ensures that behavior is unchanged for old layouts (courtesy of rgheck).

It is now possible to re-add spaces in label strings where it makes
sense.

Fixes bug #10723.
2017-08-31 13:59:37 +02:00
José Matos
cc7ca138da Fix call of layout2layout as a module.
If we call parser.parse_args(), thus with no arguments, the parser uses
sys.argv (because that is the default). We should pass argv since that was
the purpose of handling argv in the main function.

We pass argv[1:] since when parsing the arguments we always ignore the name
of the program.

Use the full power of argparse to declare the default value of the end_format.
2017-05-13 15:25:44 +01:00
José Matos
99cf71f8eb Fix call os lyx2lyx as a module.
If we call parser.parse_args(), thus with no arguments, the parser uses
sys.argv (because that is the default). We should pass argv since that was
the purpose of handling argv in the main function.
2017-05-13 13:39:02 +01:00