mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Support half und full line parskip class options (#12946)
Currently only employed by the KOMA classes. Layout format change.
This commit is contained in:
parent
40ae8644f9
commit
2a7ec054be
@ -12201,6 +12201,108 @@ status collapsed
|
|||||||
\end_inset
|
\end_inset
|
||||||
|
|
||||||
.
|
.
|
||||||
|
\change_inserted -712698321 1717320820
|
||||||
|
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\begin_layout Description
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717321090
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320831
|
||||||
|
ParskipFull
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
[
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320820
|
||||||
|
string
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
] If the class has an option to set a full line paragraph skip,
|
||||||
|
specify it here (e.g.,
|
||||||
|
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320884
|
||||||
|
parskip=full
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
).
|
||||||
|
This then outputs the option rather than using the
|
||||||
|
\emph on
|
||||||
|
parskip
|
||||||
|
\emph default
|
||||||
|
package.
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\begin_layout Description
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717321094
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320913
|
||||||
|
ParskipHalf
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
[
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320909
|
||||||
|
string
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
] If the class has an option to set a half line paragraph skip,
|
||||||
|
specify it here (e.g.,
|
||||||
|
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\change_inserted -712698321 1717320920
|
||||||
|
parskip=half
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
).
|
||||||
|
This then outputs the option rather than using the
|
||||||
|
\emph on
|
||||||
|
parskip
|
||||||
|
\emph default
|
||||||
|
package.
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Description
|
\begin_layout Description
|
||||||
@ -20899,6 +21001,8 @@ status collapsed
|
|||||||
|
|
||||||
\change_inserted -712698321 1715685023
|
\change_inserted -712698321 1715685023
|
||||||
-1
|
-1
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
@ -20944,6 +21048,8 @@ status collapsed
|
|||||||
|
|
||||||
\change_inserted -712698321 1715685031
|
\change_inserted -712698321 1715685031
|
||||||
1
|
1
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
@ -20979,6 +21085,8 @@ status collapsed
|
|||||||
|
|
||||||
\change_inserted -712698321 1715685008
|
\change_inserted -712698321 1715685008
|
||||||
0
|
0
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
@ -20994,6 +21102,8 @@ status collapsed
|
|||||||
|
|
||||||
\backslash
|
\backslash
|
||||||
cprotect
|
cprotect
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
@ -21007,6 +21117,8 @@ status collapsed
|
|||||||
|
|
||||||
\change_inserted -712698321 1715685008
|
\change_inserted -712698321 1715685008
|
||||||
-1
|
-1
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
@ -21021,6 +21133,8 @@ status collapsed
|
|||||||
|
|
||||||
\backslash
|
\backslash
|
||||||
cprotect
|
cprotect
|
||||||
|
\change_unchanged
|
||||||
|
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
\end_inset
|
\end_inset
|
||||||
|
@ -10755,6 +10755,86 @@ status collapsed
|
|||||||
getrennt.
|
getrennt.
|
||||||
\end_layout
|
\end_layout
|
||||||
|
|
||||||
|
\begin_layout Description
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
ParskipFull
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
[
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
string
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
] Falls die Dokumentklasse eine Option zum Setzen eines ganzzeiligen Absatzabstandes bietet (bspw.
|
||||||
|
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
parskip=full
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
),
|
||||||
|
geben Sie diese hier an.
|
||||||
|
Dann wird statt des Pakets
|
||||||
|
\emph on
|
||||||
|
parskip
|
||||||
|
\emph default
|
||||||
|
diese Option verwendet.
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\begin_layout Description
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
ParskipHalf
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
[
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
string
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
] Falls die Dokumentklasse eine Option zum Setzen eines halbzeiligen Absatzabstandes bietet (bspw.
|
||||||
|
|
||||||
|
\begin_inset Flex Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
parskip=half
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
),
|
||||||
|
geben Sie diese hier an.
|
||||||
|
Dann wird statt des Pakets
|
||||||
|
\emph on
|
||||||
|
parskip
|
||||||
|
\emph default
|
||||||
|
diese Option verwendet.
|
||||||
|
\end_layout
|
||||||
|
|
||||||
\begin_layout Standard
|
\begin_layout Standard
|
||||||
Der Abschnitt
|
Der Abschnitt
|
||||||
\begin_inset Flex Code
|
\begin_inset Flex Code
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
# Labeling is now used also in non-KOMA classes
|
# Labeling is now used also in non-KOMA classes
|
||||||
|
|
||||||
|
|
||||||
Format 104
|
Format 105
|
||||||
|
|
||||||
SecNumDepth 2
|
SecNumDepth 2
|
||||||
TocDepth 2
|
TocDepth 2
|
||||||
DefaultStyle Standard
|
DefaultStyle Standard
|
||||||
@ -20,6 +21,8 @@ ClassOptions
|
|||||||
FontSizeFormat fontsize=$$s
|
FontSizeFormat fontsize=$$s
|
||||||
PageSize a0|a1|a2|a3|a4|a5|a6|b0|b1|b2|b3|b4|b5|b6|c0|c1|c2|c3|c4|c5|c6|executive|legal|letter
|
PageSize a0|a1|a2|a3|a4|a5|a6|b0|b1|b2|b3|b4|b5|b6|c0|c1|c2|c3|c4|c5|c6|executive|legal|letter
|
||||||
PageSizeFormat paper=$$s
|
PageSizeFormat paper=$$s
|
||||||
|
ParskipHalf parskip=half
|
||||||
|
ParskipFull parskip=full
|
||||||
End
|
End
|
||||||
|
|
||||||
Style Standard
|
Style Standard
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# This script will update a .layout file to current format
|
# This script will update a .layout file to current format
|
||||||
|
|
||||||
# The latest layout format is also defined in src/TextClass.cpp
|
# The latest layout format is also defined in src/TextClass.cpp
|
||||||
currentFormat = 104
|
currentFormat = 105
|
||||||
|
|
||||||
|
|
||||||
# Incremented to format 4, 6 April 2007, lasgouttes
|
# Incremented to format 4, 6 April 2007, lasgouttes
|
||||||
@ -351,6 +351,9 @@ currentFormat = 104
|
|||||||
# Incremented to format 104, 28 July 2023 by rikiheck
|
# Incremented to format 104, 28 July 2023 by rikiheck
|
||||||
# RefFormat for counters and PrettyFormat for floats
|
# RefFormat for counters and PrettyFormat for floats
|
||||||
|
|
||||||
|
# Incremented to format 105, 2 June 2024 by spitz
|
||||||
|
# ParskipFull and ParskipHalf class options
|
||||||
|
|
||||||
# Do not forget to document format change in Customization
|
# Do not forget to document format change in Customization
|
||||||
# Manual (section "Declaring a new text class").
|
# Manual (section "Declaring a new text class").
|
||||||
|
|
||||||
@ -598,7 +601,7 @@ def convert(lines, end_format):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 101 <= format <= 103:
|
if 101 <= format <= 104:
|
||||||
# nothing to do.
|
# nothing to do.
|
||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
@ -1831,6 +1831,13 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (paragraph_separation) {
|
||||||
|
if (!tclass.halfparskip().empty() && getDefSkip().kind() == VSpace::HALFLINE)
|
||||||
|
clsoptions << tclass.halfparskip() << ",";
|
||||||
|
if (!tclass.fullparskip().empty() && getDefSkip().kind() == VSpace::FULLLINE)
|
||||||
|
clsoptions << tclass.fullparskip() << ",";
|
||||||
|
}
|
||||||
|
|
||||||
// language should be a parameter to \documentclass
|
// language should be a parameter to \documentclass
|
||||||
if (language->babel() == "hebrew"
|
if (language->babel() == "hebrew"
|
||||||
@ -2154,6 +2161,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
// when skip separation
|
// when skip separation
|
||||||
string psopt;
|
string psopt;
|
||||||
bool default_skip = false;
|
bool default_skip = false;
|
||||||
|
bool by_class_option = false;
|
||||||
switch (getDefSkip().kind()) {
|
switch (getDefSkip().kind()) {
|
||||||
case VSpace::SMALLSKIP:
|
case VSpace::SMALLSKIP:
|
||||||
psopt = "\\smallskipamount";
|
psopt = "\\smallskipamount";
|
||||||
@ -2167,9 +2175,11 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
case VSpace::HALFLINE:
|
case VSpace::HALFLINE:
|
||||||
// default (no option)
|
// default (no option)
|
||||||
default_skip = true;
|
default_skip = true;
|
||||||
|
by_class_option = !tclass.halfparskip().empty();
|
||||||
break;
|
break;
|
||||||
case VSpace::FULLLINE:
|
case VSpace::FULLLINE:
|
||||||
psopt = "\\baselineskip";
|
psopt = "\\baselineskip";
|
||||||
|
by_class_option = !tclass.fullparskip().empty();
|
||||||
break;
|
break;
|
||||||
case VSpace::LENGTH:
|
case VSpace::LENGTH:
|
||||||
psopt = getDefSkip().length().asLatexString();
|
psopt = getDefSkip().length().asLatexString();
|
||||||
@ -2186,7 +2196,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
// explicitly reset default (might have been changed
|
// explicitly reset default (might have been changed
|
||||||
// in a class or package)
|
// in a class or package)
|
||||||
os << "\\parskip=.5\\baselineskip plus 2pt\\relax\n";
|
os << "\\parskip=.5\\baselineskip plus 2pt\\relax\n";
|
||||||
} else {
|
} else if (!by_class_option) {
|
||||||
// load parskip package with required options
|
// load parskip package with required options
|
||||||
string psopts;
|
string psopts;
|
||||||
if (!psopt.empty()) {
|
if (!psopt.empty()) {
|
||||||
|
@ -59,7 +59,7 @@ namespace lyx {
|
|||||||
// You should also run the development/tools/updatelayouts.py script,
|
// You should also run the development/tools/updatelayouts.py script,
|
||||||
// to update the format of all of our layout files.
|
// to update the format of all of our layout files.
|
||||||
//
|
//
|
||||||
int const LAYOUT_FORMAT = 104; // rkh: RefFormat for counters
|
int const LAYOUT_FORMAT = 105; // spitz: ParskipHalf and ParskipFull class options
|
||||||
|
|
||||||
|
|
||||||
// Layout format for the current lyx file format. Controls which format is
|
// Layout format for the current lyx file format. Controls which format is
|
||||||
@ -135,8 +135,8 @@ TextClass::TextClass()
|
|||||||
opt_enginetype_("authoryear|numerical"), opt_fontsize_("10|11|12"),
|
opt_enginetype_("authoryear|numerical"), opt_fontsize_("10|11|12"),
|
||||||
opt_pagesize_("default|a4|a5|b5|letter|legal|executive"),
|
opt_pagesize_("default|a4|a5|b5|letter|legal|executive"),
|
||||||
opt_pagestyle_("empty|plain|headings|fancy"), fontsize_format_("$$spt"), pagesize_("default"),
|
opt_pagestyle_("empty|plain|headings|fancy"), fontsize_format_("$$spt"), pagesize_("default"),
|
||||||
pagesize_format_("$$spaper"), pagestyle_("default"), tablestyle_("default"),
|
pagesize_format_("$$spaper"), pagestyle_("default"), parskip_full_(""), parskip_half_(""),
|
||||||
docbookroot_("article"), docbookforceabstract_(false),
|
tablestyle_("default"), docbookroot_("article"), docbookforceabstract_(false),
|
||||||
columns_(1), sides_(OneSide), secnumdepth_(3), tocdepth_(3), outputType_(LATEX),
|
columns_(1), sides_(OneSide), secnumdepth_(3), tocdepth_(3), outputType_(LATEX),
|
||||||
outputFormat_("latex"), has_output_format_(false), defaultfont_(sane_font),
|
outputFormat_("latex"), has_output_format_(false), defaultfont_(sane_font),
|
||||||
titletype_(TITLE_COMMAND_AFTER), titlename_("maketitle"),
|
titletype_(TITLE_COMMAND_AFTER), titlename_("maketitle"),
|
||||||
@ -1027,6 +1027,8 @@ void TextClass::readClassOptions(Lexer & lexrc)
|
|||||||
CO_PAGESIZE,
|
CO_PAGESIZE,
|
||||||
CO_PAGESIZE_FORMAT,
|
CO_PAGESIZE_FORMAT,
|
||||||
CO_PAGESTYLE,
|
CO_PAGESTYLE,
|
||||||
|
CO_PARSKIP_FULL,
|
||||||
|
CO_PARSKIP_HALF,
|
||||||
CO_OTHER,
|
CO_OTHER,
|
||||||
CO_END
|
CO_END
|
||||||
};
|
};
|
||||||
@ -1038,7 +1040,9 @@ void TextClass::readClassOptions(Lexer & lexrc)
|
|||||||
{"other", CO_OTHER },
|
{"other", CO_OTHER },
|
||||||
{"pagesize", CO_PAGESIZE },
|
{"pagesize", CO_PAGESIZE },
|
||||||
{"pagesizeformat", CO_PAGESIZE_FORMAT },
|
{"pagesizeformat", CO_PAGESIZE_FORMAT },
|
||||||
{"pagestyle", CO_PAGESTYLE }
|
{"pagestyle", CO_PAGESTYLE },
|
||||||
|
{"parskipfull", CO_PARSKIP_FULL },
|
||||||
|
{"parskiphalf", CO_PARSKIP_HALF }
|
||||||
};
|
};
|
||||||
|
|
||||||
lexrc.pushTable(classOptionsTags);
|
lexrc.pushTable(classOptionsTags);
|
||||||
@ -1073,6 +1077,14 @@ void TextClass::readClassOptions(Lexer & lexrc)
|
|||||||
lexrc.next();
|
lexrc.next();
|
||||||
opt_pagestyle_ = rtrim(lexrc.getString());
|
opt_pagestyle_ = rtrim(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
case CO_PARSKIP_FULL:
|
||||||
|
lexrc.next();
|
||||||
|
parskip_full_ = rtrim(lexrc.getString());
|
||||||
|
break;
|
||||||
|
case CO_PARSKIP_HALF:
|
||||||
|
lexrc.next();
|
||||||
|
parskip_half_ = rtrim(lexrc.getString());
|
||||||
|
break;
|
||||||
case CO_OTHER:
|
case CO_OTHER:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
if (options_.empty())
|
if (options_.empty())
|
||||||
|
@ -288,6 +288,10 @@ protected:
|
|||||||
std::string pagesize_format_;
|
std::string pagesize_format_;
|
||||||
///
|
///
|
||||||
std::string pagestyle_;
|
std::string pagestyle_;
|
||||||
|
/// Option for full parskip
|
||||||
|
std::string parskip_full_;
|
||||||
|
/// Option for half parskip
|
||||||
|
std::string parskip_half_;
|
||||||
///
|
///
|
||||||
std::string tablestyle_;
|
std::string tablestyle_;
|
||||||
///
|
///
|
||||||
@ -480,6 +484,10 @@ public:
|
|||||||
///
|
///
|
||||||
std::string const & pagesizeformat() const { return pagesize_format_; }
|
std::string const & pagesizeformat() const { return pagesize_format_; }
|
||||||
///
|
///
|
||||||
|
std::string const & fullparskip() const { return parskip_full_; }
|
||||||
|
///
|
||||||
|
std::string const & halfparskip() const { return parskip_half_; }
|
||||||
|
///
|
||||||
std::string const & pagestyle() const { return pagestyle_; }
|
std::string const & pagestyle() const { return pagestyle_; }
|
||||||
///
|
///
|
||||||
std::string const & tablestyle() const { return tablestyle_; }
|
std::string const & tablestyle() const { return tablestyle_; }
|
||||||
|
Loading…
Reference in New Issue
Block a user