mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Add Landscape module
Support for the (pdf)lscape package. Fixes: #10801
This commit is contained in:
parent
feab528fd1
commit
2551614ff1
@ -7,6 +7,10 @@ changes happened in particular if possible. A good example would be
|
||||
|
||||
-----------------------
|
||||
|
||||
2018-04-18 Jürgen Spitzmüller <spitz@lyx.org>
|
||||
* format incremented to 546: Add Landscape flex inset in Landscape module.
|
||||
\begin{landscape}...\end{landscape} > \begin_inset Flex Landscape
|
||||
|
||||
2018-03-14 Yuriy Skalko <yuriy.skalko@gmail.com>
|
||||
* Format incremented to 547: support for Charter font from XCharter package.
|
||||
|
||||
|
@ -2212,6 +2212,7 @@ dist_layouts_DATA =\
|
||||
layouts/jss.layout \
|
||||
layouts/kluwer.layout \
|
||||
layouts/knitr.module \
|
||||
layouts/landscape.module \
|
||||
layouts/latex8.layout \
|
||||
layouts/letter.layout \
|
||||
layouts/lettre.layout \
|
||||
|
23
lib/layouts/landscape.module
Normal file
23
lib/layouts/landscape.module
Normal file
@ -0,0 +1,23 @@
|
||||
#\DeclareLyXModule{Landscape}
|
||||
#DescriptionBegin
|
||||
#Output parts of the document in landscape mode.
|
||||
#DescriptionEnd
|
||||
#
|
||||
#Author: Jürgen Spitzmüller <spitz@lyx.org>
|
||||
|
||||
Format 67
|
||||
|
||||
InsetLayout Flex:Landscape
|
||||
LyXType custom
|
||||
Decoration classic
|
||||
ResetsFont 0
|
||||
MultiPar 1
|
||||
LabelString Landscape
|
||||
LatexName landscape
|
||||
LatexType environment
|
||||
LabelFont
|
||||
Family Roman
|
||||
Color red
|
||||
EndFont
|
||||
Requires lscape
|
||||
End
|
@ -24,16 +24,16 @@ import sys, os
|
||||
|
||||
# Uncomment only what you need to import, please.
|
||||
|
||||
from parser_tools import (find_end_of_inset, find_token, get_bool_value, get_value)
|
||||
from parser_tools import (find_end_of_inset, find_end_of_layout, find_token, get_bool_value, get_value)
|
||||
# del_token, del_value, del_complete_lines,
|
||||
# find_complete_lines, find_end_of, find_end_of_layout,
|
||||
# find_complete_lines, find_end_of,
|
||||
# find_re, find_substring, find_token_backwards,
|
||||
# get_containing_inset, get_containing_layout, get_value,
|
||||
# get_quoted_value, is_in_inset, set_bool_value
|
||||
# find_tokens, find_token_exact, check_token, get_option_value
|
||||
|
||||
from lyx2lyx_tools import (add_to_preamble)
|
||||
# put_cmd_in_ert, revert_font_attrs, insert_to_preamble, latex_length
|
||||
from lyx2lyx_tools import (put_cmd_in_ert, add_to_preamble)
|
||||
# revert_font_attrs, insert_to_preamble, latex_length
|
||||
# get_ert, lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets
|
||||
# revert_flex_inset, hex2ratio, str2bool
|
||||
|
||||
@ -153,6 +153,29 @@ def revert_xcharter(document):
|
||||
add_to_preamble(document, ["\\usepackage%s{XCharter}"%options])
|
||||
|
||||
|
||||
def revert_lscape(document):
|
||||
" Reverts the landscape environment (Landscape module) to TeX-code "
|
||||
|
||||
if not "landscape" in document.get_module_list():
|
||||
return
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
i = find_token(document.body, "\\begin_inset Flex Landscape", i)
|
||||
if i == -1:
|
||||
return
|
||||
j = find_end_of_inset(document.body, i)
|
||||
if j == -1:
|
||||
document.warning("Malformed LyX document: Can't find end of Landscape inset")
|
||||
i += 1
|
||||
continue
|
||||
|
||||
document.body[j - 2 : j + 1] = put_cmd_in_ert("\\end{landscape}")
|
||||
document.body[i : i + 4] = put_cmd_in_ert("\\begin{landscape}")
|
||||
add_to_preamble(document, ["\\usepackage{pdflscape}"])
|
||||
# no need to reset i
|
||||
|
||||
|
||||
##
|
||||
# Conversion hub
|
||||
#
|
||||
@ -161,10 +184,12 @@ supported_versions = ["2.4.0", "2.4"]
|
||||
convert = [
|
||||
[545, [convert_lst_literalparam]],
|
||||
[546, []],
|
||||
[547, []]
|
||||
[547, []],
|
||||
[548, []]
|
||||
]
|
||||
|
||||
revert = [
|
||||
[547, [revert_lscape]],
|
||||
[546, [revert_xcharter]],
|
||||
[545, [revert_paratype]],
|
||||
[544, [revert_lst_literalparam]]
|
||||
|
@ -58,6 +58,9 @@ Format LaTeX feature LyX feature
|
||||
\begin{btUnit}...\end{btUnit} \multibib {none|part|chapter|section|subsection}
|
||||
(if a part, chapter, section etc.
|
||||
follows the \begin...)
|
||||
546 Landscape support
|
||||
\begin{landscape}...\end{landscape} \begin_inset Flex Landscape
|
||||
with longtable content: <features rotate ="90"...>
|
||||
|
||||
|
||||
|
||||
|
@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
|
||||
|
||||
// Do not remove the comment below, so we get merge conflict in
|
||||
// independent branches. Instead add your own.
|
||||
#define LYX_FORMAT_LYX 547 // Yuriy Skalko: support for XCharter font
|
||||
#define LYX_FORMAT_TEX2LYX 547
|
||||
#define LYX_FORMAT_LYX 548 // spitz: landscape module
|
||||
#define LYX_FORMAT_TEX2LYX 548
|
||||
|
||||
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
|
||||
#ifndef _MSC_VER
|
||||
|
Loading…
Reference in New Issue
Block a user