diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index dd32fac2cb..879f30551c 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 595 +\lyxformat 596 \begin_document \begin_header \save_transient_properties true @@ -46,6 +46,9 @@ % only uncomment this when you are using makindex %\let\OrgIndex\index %\renewcommand*{\index}[1]{\OrgIndex{#1}} +% Added by lyx2lyx +\setlength{\parskip}{\medskipamount} +\setlength{\parindent}{0pt} \end_preamble \options refpage,intoc,bibliography=totoc,index=totoc,BCOR7.5mm,captions=tableheading \use_default_options false @@ -137,8 +140,8 @@ logicalmkup \end_index \secnumdepth 3 \tocdepth 2 -\paragraph_separation skip -\defskip medskip +\paragraph_separation indent +\paragraph_indentation default \is_math_indent 0 \math_numbering_side default \quotes_style english @@ -12119,6 +12122,25 @@ DefSkip MedSkip \family default . +\change_inserted -712698321 1593360527 + +\end_layout + +\begin_layout Standard + +\change_inserted -712698321 1593360570 + +\family sans +Half line height +\family default + and +\family sans +Line height +\family default + equal to the height, or half the height, of a line in the current font + size including line spacing. +\change_unchanged + \end_layout \begin_layout Standard diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx index 98700b52cf..e95f71c15c 100644 --- a/lib/doc/de/UserGuide.lyx +++ b/lib/doc/de/UserGuide.lyx @@ -1,5 +1,5 @@ #LyX 2.4 created this file. For more info see https://www.lyx.org/ -\lyxformat 595 +\lyxformat 596 \begin_document \begin_header \save_transient_properties true @@ -53,6 +53,9 @@ % Trennausnahmen \hyphenation{Text-ei-gen-schaf-ten} +% Added by lyx2lyx +\setlength{\parskip}{\medskipamount} +\setlength{\parindent}{0pt} \end_preamble \options refpage,intoc,bibliography=totoc,index=totoc,BCOR7.5mm,captions=tableheading \use_default_options false @@ -142,8 +145,8 @@ logicalmkup \end_index \secnumdepth 3 \tocdepth 2 -\paragraph_separation skip -\defskip medskip +\paragraph_separation indent +\paragraph_indentation default \is_math_indent 0 \math_numbering_side default \quotes_style german @@ -12157,21 +12160,21 @@ Abstand \begin_layout Standard \family sans -SmallSkip +Klein \family default , \family sans -MedSkip +Mittel \family default und \family sans -BigSkip +Groß \family default - sind \SpecialChar LaTeX + entsprechen \SpecialChar LaTeX -Größen, die von der Schriftgröße des Dokuments abhängen. \family sans -DefSkip +Standard \family default ist der Abstand, der im Dialog \family sans @@ -12192,15 +12195,29 @@ Dokument ! Einstellungen für die Absatztrennung eingestellt ist. Wenn Sie Absätze per Einrückung voneinander trennen, ist \family sans -DefSkip +Standard \family default gleich \family sans -MedSkip +Mittel \family default . \end_layout +\begin_layout Standard + +\family sans +Halbe Zeilenhöhe +\family default + und +\family sans +Zeilenhöhe +\family default + entsprechen der Höhe (bzw. + der halben Höhe) einer Zeile in der gewählten Schriftgröße inklusive des + Zeilenabstands. +\end_layout + \begin_layout Standard Der \family sans diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 4e2533cafa..d4e8b0a7b5 100644 --- a/lib/lyx2lyx/lyx_2_4.py +++ b/lib/lyx2lyx/lyx_2_4.py @@ -3831,6 +3831,25 @@ def revert_parskip(document): document.header[j] = "\\paragraph_indentation default" +def revert_line_vspaces(document): + " Revert fulline and halfline vspaces to TeX " + insets = { + "fullline*" : "\\vspace*{\\baselineskip}", + "fullline" : "\\vspace{\\baselineskip}", + "halfline*" : "\\vspace*{0.5\\baselineskip}", + "halfline" : "\\vspace{0.5\\baselineskip}", + } + for inset in insets.keys(): + i = 0 + j = 0 + i = find_token(document.body, "\\begin_inset VSpace " + inset, i) + if i == -1: + continue + end = find_end_of_inset(document.body, i) + subst = put_cmd_in_ert(insets[inset]) + document.body[i : end + 1] = subst + + ## # Conversion hub # @@ -3891,7 +3910,7 @@ convert = [ [596, [convert_parskip]] ] -revert = [[595, [revert_parskip]], +revert = [[595, [revert_parskip,revert_line_vspaces]], [594, [revert_ams_spaces]], [593, [revert_counter_inset]], [592, [revert_counter_maintenance]], diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 2c28a85606..0a2cbda724 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -292,6 +292,8 @@ Menuset Item "SmallSkip|S" "inset-modify vspace smallskip" Item "MedSkip|M" "inset-modify vspace medskip" Item "BigSkip|B" "inset-modify vspace bigskip" + Item "Half line height|H" "inset-modify vspace halfline" + Item "Line height|L" "inset-modify vspace fullline" Item "VFill|F" "inset-modify vspace vfill" Item "Custom|C" "command-sequence inset-modify vspace custom; inset-settings" Separator diff --git a/src/frontends/qt/GuiVSpace.cpp b/src/frontends/qt/GuiVSpace.cpp index cbd0265dda..96fa016971 100644 --- a/src/frontends/qt/GuiVSpace.cpp +++ b/src/frontends/qt/GuiVSpace.cpp @@ -66,7 +66,7 @@ GuiVSpace::GuiVSpace(QWidget * parent) : InsetParamsWidget(parent) void GuiVSpace::enableCustom(int selection) { - bool const enable = selection == 5; + bool const enable = selection == 7; valueLE->setEnabled(enable); if (enable) valueLE->setFocus(); @@ -96,15 +96,17 @@ static void setWidgetsFromVSpace(VSpace const & space, case VSpace::BIGSKIP: item = 3; break; - case VSpace::VFILL: + case VSpace::HALFLINE: item = 4; break; - case VSpace::LENGTH: + case VSpace::FULLLINE: item = 5; break; - case VSpace::HALFLINE: - case VSpace::FULLLINE: - // not supported here yet + case VSpace::VFILL: + item = 6; + break; + case VSpace::LENGTH: + item = 7; break; } spacing->setCurrentIndex(item); @@ -131,12 +133,30 @@ static VSpace setVSpaceFromWidgets(int spacing, VSpace space; switch (spacing) { - case 0: space = VSpace(VSpace::DEFSKIP); break; - case 1: space = VSpace(VSpace::SMALLSKIP); break; - case 2: space = VSpace(VSpace::MEDSKIP); break; - case 3: space = VSpace(VSpace::BIGSKIP); break; - case 4: space = VSpace(VSpace::VFILL); break; - case 5: space = VSpace(GlueLength(widgetsToLength(value, unit))); break; + case 0: + space = VSpace(VSpace::DEFSKIP); + break; + case 1: + space = VSpace(VSpace::SMALLSKIP); + break; + case 2: + space = VSpace(VSpace::MEDSKIP); + break; + case 3: + space = VSpace(VSpace::BIGSKIP); + break; + case 4: + space = VSpace(VSpace::HALFLINE); + break; + case 5: + space = VSpace(VSpace::FULLLINE); + break; + case 6: + space = VSpace(VSpace::VFILL); + break; + case 7: + space = VSpace(GlueLength(widgetsToLength(value, unit))); + break; } space.setKeep(keep); @@ -148,7 +168,7 @@ docstring GuiVSpace::dialogToParams() const { // If a vspace choice is "Length" but there's no text in // the input field, do not insert a vspace at all. - if (spacingCO->currentIndex() == 5 && valueLE->text().isEmpty()) + if (spacingCO->currentIndex() == 7 && valueLE->text().isEmpty()) return docstring(); VSpace const params = setVSpaceFromWidgets(spacingCO->currentIndex(), @@ -175,7 +195,7 @@ bool GuiVSpace::checkWidgets(bool readonly) const spacingCO->setEnabled(false); unitCO->setEnabled(false); } else { - bool const enable = (spacingCO->currentIndex() == 5); + bool const enable = (spacingCO->currentIndex() == 7); valueLE->setEnabled(enable); valueL->setEnabled(enable); unitCO->setEnabled(enable); diff --git a/src/frontends/qt/ui/VSpaceUi.ui b/src/frontends/qt/ui/VSpaceUi.ui index 0e4a83dcd0..847c0dfbf8 100644 --- a/src/frontends/qt/ui/VSpaceUi.ui +++ b/src/frontends/qt/ui/VSpaceUi.ui @@ -1,3 +1,4 @@ + VSpaceUi @@ -5,8 +6,8 @@ 0 0 - 215 - 96 + 288 + 118 @@ -97,6 +98,16 @@ BigSkip + + + Half line height + + + + + Line height + + VFill diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 4053ddbfe9..fdcab6333f 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -5709,12 +5709,19 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } else if (unit == "\\bigskipamount") { unit = "bigskip"; known_vspace = true; + } else if (length == "\\baselineskip") { + unit = "fullline"; + known_vspace = true; } else if (unit == "\\fill") { unit = "vfill"; known_vspace = true; } } } + if (value == 0.5 && t.cs()[0] != 'h' && unit == "\\baselineskip") { + unit = "halfline"; + known_vspace = true; + } if (!known_hspace && !known_vspace) { switch (unitFromString(unit)) { case Length::SP: