]> git.lyx.org Git - lyx.git/commitdiff
Add buffer param to opt-out fragile content movement
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 10 Jan 2020 09:21:09 +0000 (10:21 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 10 Jan 2020 09:21:09 +0000 (10:21 +0100)
Fixes #11714

File format change

12 files changed:
development/FORMAT
lib/doc/UserGuide.lyx
lib/doc/de/UserGuide.lyx
lib/lyx2lyx/lyx_2_4.py
src/BufferParams.cpp
src/BufferParams.h
src/frontends/qt/GuiDocument.cpp
src/frontends/qt/GuiDocument.h
src/frontends/qt/ui/OutputUi.ui
src/insets/InsetCaption.cpp
src/output_latex.cpp
src/version.h

index 4b782d54069881062a0446b2c4cc4e4b73e6de9e..00c5cfbd2d91a3cb44aba33cb38109880ba57f1b 100644 (file)
@@ -7,6 +7,10 @@ changes happened in particular if possible. A good example would be
 
 -----------------------
 
+2020-01-10 Jürgen Spitzmüller <spitz@lyx.org>
+       * Format incremented to 591: Add buffer param \postpone_fragile_content
+         (option to disable the mobement of labels and stuff of moving arguments).
+
 2019-12-24 Jürgen Spitzmüller <spitz@lyx.org>
        * Format incremented to 590: Add native changebar solution via buffer param
           \change_bars.
index 6f821643d0b253cce79596394a6f2d9393888b9c..a514d0c21ce161cfb276948e3c9350b0e9424aab 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 590
+\lyxformat 591
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -150,6 +150,7 @@ logicalmkup
 \tracking_changes true
 \output_changes false
 \change_bars false
+\postpone_fragile_content false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
@@ -47725,25 +47726,105 @@ reference "sec:File-Formats"
 \end_layout
 
 \begin_layout Description
+
+\change_inserted -712698321 1578647276
+Allow
+\begin_inset space ~
+\end_inset
+
+running
+\begin_inset space ~
+\end_inset
+
+external
+\begin_inset space ~
+\end_inset
+
+programs If this is switched on, \SpecialChar LaTeX
+ is run with the 
+\family typewriter
+-shell-escape
+\family default
+ option which is needed with some packages.
+ Note that this comes with security risks, so please use this only when
+ really necessary and if you know what you are doing.
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1578647006
+LaTeX
+\begin_inset space ~
+\end_inset
+
+Output
+\begin_inset space ~
+\end_inset
+
+Options offers settings for the 
+\family sans
+LaTeX
+\family default
+ export.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+
+\family sans
 Synchronize
+\change_inserted -712698321 1578646679
+\change_deleted -712698321 1578646679
+
 \begin_inset space ~
 \end_inset
 
+
+\change_unchanged
 with
+\change_deleted -712698321 1578646686
+
 \begin_inset space ~
 \end_inset
 
-Output settings for the menu 
+
+\change_inserted -712698321 1578646686
+\change_unchanged
+Output
+\family default
+\change_inserted -712698321 1578646719
+enables 
+\change_deleted -712698321 1578646729
+settings for the menu 
 \family sans
 Navigate\SpecialChar menuseparator
+
+\change_unchanged
 Forward
 \begin_inset space ~
 \end_inset
 
 search
+\change_inserted -712698321 1578646752
+
 \family default
+ and allows to customize the macro used in this process
+\change_deleted -712698321 1578646757
 .
- For a detailed description see section 
+
+\change_unchanged
+\change_inserted -712698321 1578646759
+(
+\change_deleted -712698321 1578646759
+F
+\change_inserted -712698321 1578646759
+f
+\change_unchanged
+or a detailed description see section 
 \emph on
 Reverse DVI/PDF search
 \emph default
@@ -47755,9 +47836,55 @@ Additional
 
 Features
 \emph default
- manual.
+ manual
+\change_inserted -712698321 1578646762
+)
+\change_unchanged
+.
+\change_inserted -712698321 1578647009
+
 \end_layout
 
+\begin_layout Itemize
+
+\change_inserted -712698321 1578647929
+
+\family sans
+Put fragile content out of moving arguments
+\family default
+ determines whether so-called 
+\begin_inset Quotes els
+\end_inset
+
+fragile
+\begin_inset Quotes ers
+\end_inset
+
+ \SpecialChar LaTeX
+ constructs (such as labels or index entries) are placed outside of so-called
+\begin_inset Quotes els
+\end_inset
+
+moving arguments
+\begin_inset Quotes ers
+\end_inset
+
+ in \SpecialChar LaTeX
+ (such as sections or captions), even if the corresponding insets are
+ placed in such context in \SpecialChar LyX
+.
+ This setting is on by default, since it prevents nasty \SpecialChar LaTeX
+ errors.
+ If you rely on labels or index entries being kept inside the problematic
+ macros, you can uncheck this.
+ If you don't know what we are talking about here, worry not: just leave
+ it checked.
+\change_unchanged
+
+\end_layout
+
+\end_deeper
 \begin_layout Description
 XHTML
 \begin_inset space ~
index e34f4f1dc551487361b8522f269b269798a0d979..960dba37e770083659bce3d4cd2a9b3b89a99bbe 100644 (file)
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 590
+\lyxformat 591
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -155,6 +155,7 @@ logicalmkup
 \tracking_changes false
 \output_changes false
 \change_bars false
+\postpone_fragile_content false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict false
@@ -45050,6 +45051,106 @@ reference "sec:Dateiformate"
 .
 \end_layout
 
+\begin_layout Description
+Erlaube
+\begin_inset space ~
+\end_inset
+
+den
+\begin_inset space ~
+\end_inset
+
+Aufruf
+\begin_inset space ~
+\end_inset
+
+externer
+\begin_inset space ~
+\end_inset
+
+Programme Wenn dies aktiviert ist, wird \SpecialChar LaTeX
+ mit der Option 
+\family typewriter
+-shell-escape
+\family default
+ ausgeführt.
+ Dies ist zur Nutzung mancher Pakete nötig.
+ Beachten Sie, dass dies Sicherheitsrisiken birgt! Aktivieren Sie dies also
+ nur wenn unbedingt nötig und Sie absolut sicher sind, was Sie tun.
+\end_layout
+
+\begin_layout Description
+LaTeX-Ausgabe-Optionen bietet Einstellmöglichkeiten für den 
+\family sans
+LaTeX
+\family default
+-Export.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+
+\family sans
+Mit der Ausgabe synchronisieren
+\family default
+ aktiviert die 
+\family sans
+Vorwärtssuche
+\family default
+ und ermöglicht die Anpassung der dabei verwendeten Makros.
+ Siehe Abschnitt 
+\emph on
+DVI/PDF Rückwärtssuche
+\emph default
+ der 
+\emph on
+Handbuchergänzungen
+\emph default
+ für eine detaillierte Beschreibung.
+\end_layout
+
+\begin_layout Itemize
+
+\family sans
+Zerbrechlichen Inhalt aus beweglichen Argumenten verschieben
+\family default
+ bestimmt, ob so genannte 
+\begin_inset Quotes gls
+\end_inset
+
+zerbrechliche
+\begin_inset Quotes grs
+\end_inset
+
+ \SpecialChar LaTeX
+-Konstrukte (z.
+\begin_inset space \thinspace{}
+\end_inset
+
+B.
+ Marken oder Stichworteinträge) in der \SpecialChar LaTeX
+-Ausgabe außerhalb von so genannten
+\begin_inset Quotes gls
+\end_inset
+
+beweglichen Argumenten
+\begin_inset Quotes grs
+\end_inset
+
+ (wie Legenden oder Überschriften) gesetzt werden, auch wenn die entsprechenden
+ Einfügungen in \SpecialChar LyX
+ in dieses Umfeld platziert werden.
+ Diese Einstellung ist per Voreinstellung aktiviert, da sie unangenehme
+ \SpecialChar LaTeX
+-Fehler verhindert.
+ Falls Sie darauf angewiesen sind, dass Marken oder Stichworteinträge innerhalb
+ der problematischen Umgebungen verbleiben, können Sie dies deaktivieren.
+ Falls Sie keine Ahnung haben, wovon wir hier überhaupt reden, kein Problem:
+ Lassen Sie es einfach aktiviert.
+\end_layout
+
+\end_deeper
 \begin_layout Description
 Mit
 \begin_inset space ~
index 5d59e340627d328edc05d188ce537e1b8865a707..daae36bf0605f0773e1ae0a0e8fc34622e4b9b75 100644 (file)
@@ -3668,6 +3668,28 @@ def revert_changebars(document):
     del document.header[i]
 
 
+def convert_postpone_fragile(document):
+    " Adds false \\postpone_fragile_content buffer param "
+
+    i = find_token(document.header, "\\output_changes", 0)
+    if i == -1:
+        document.warning("Malformed LyX document! Missing \\output_changes header.")
+        return
+    # Set this to false for old documents (see #2154)
+    document.header.insert(i, "\\postpone_fragile_content false")
+
+
+def revert_postpone_fragile(document):
+    " Remove \\postpone_fragile_content buffer param "
+
+    i = find_token(document.header, "\\postpone_fragile_content", 0)
+    if i == -1:
+        document.warning("Malformed LyX document! Missing \\postpone_fragile_content.")
+        return
+
+    del document.header[i]
+
+
 ##
 # Conversion hub
 #
@@ -3719,10 +3741,12 @@ convert = [
            [587, [convert_pagesizenames]],
            [588, []],
            [589, [convert_totalheight]],
-           [590, [convert_changebars]]
+           [590, [convert_changebars]],
+           [591, [convert_postpone_fragile]]
           ]
 
-revert =  [[589, [revert_changebars]],
+revert =  [[590, [revert_postpone_fragile]],
+           [589, [revert_changebars]],
            [588, [revert_totalheight]],
            [587, [revert_memoir_endnotes,revert_enotez,revert_theendnotes]],
            [586, [revert_pagesizenames]],
index 399faa393344a97d0c7039c6a2222885b5f654d8..b1cedda6fa5b29682e64946ab7b52f7b35e0ce5c 100644 (file)
@@ -411,6 +411,7 @@ BufferParams::BufferParams()
        track_changes = false;
        output_changes = false;
        change_bars = false;
+       postpone_fragile_content = true;
        use_default_options = true;
        maintain_unincluded_children = false;
        secnumdepth = 3;
@@ -954,6 +955,8 @@ string BufferParams::readToken(Lexer & lex, string const & token,
                lex >> output_changes;
        } else if (token == "\\change_bars") {
                lex >> change_bars;
+       } else if (token == "\\postpone_fragile_content") {
+               lex >> postpone_fragile_content;
        } else if (token == "\\branch") {
                lex.eatLine();
                docstring branch = lex.getDocString();
@@ -1475,6 +1478,8 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
           << (save_transient_properties ? convert<string>(change_bars) : "false")
           << '\n';
 
+       os << "\\postpone_fragile_content " << convert<string>(postpone_fragile_content) << '\n';
+
        os << "\\html_math_output " << html_math_output << '\n'
           << "\\html_css_as_file " << html_css_as_file << '\n'
           << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
index 5b5a16f67fcfbbbc774cd0e6707b17114719ebec..c66dd6185a3c38c60eb104ce79bcad2e346bbb6c 100644 (file)
@@ -437,6 +437,8 @@ public:
        bool change_bars;
        ///
        bool compressed;
+       ///
+       bool postpone_fragile_content;
 
        /// the author list for the document
        AuthorList & authors();
index f9f3e356dd5ad8f1eaab64320c7b4a08955ce0f2..d08a648375b615c86bb9b3e1357194fe546b13d1 100644 (file)
@@ -913,8 +913,8 @@ GuiDocument::GuiDocument(GuiView & lv)
 
        connect(outputModule->shellescapeCB, SIGNAL(stateChanged(int)),
                this, SLOT(shellescapeChanged()));
-       connect(outputModule->outputsyncCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+       connect(outputModule->outputsyncCB, SIGNAL(toggled(bool)),
+               this, SLOT(setOutputSync(bool)));
        connect(outputModule->synccustomCB, SIGNAL(editTextChanged(QString)),
                this, SLOT(change_adaptor()));
        outputModule->synccustomCB->addItem("");
@@ -926,7 +926,9 @@ GuiDocument::GuiDocument(GuiView & lv)
                outputModule->synccustomCB));
 
        connect(outputModule->saveTransientPropertiesCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(change_adaptor()));
+       connect(outputModule->postponeFragileCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
 
        // language & quote
@@ -3682,6 +3684,8 @@ void GuiDocument::applyView()
 
        bp_.save_transient_properties =
                outputModule->saveTransientPropertiesCB->isChecked();
+       bp_.postpone_fragile_content =
+               outputModule->postponeFragileCB->isChecked();
 
        // fonts
        bp_.fonts_roman[nontexfonts] =
@@ -4313,6 +4317,8 @@ void GuiDocument::paramsToDialog()
        outputModule->shellescapeCB->setChecked(bp_.shell_escape);
        outputModule->outputsyncCB->setChecked(bp_.output_sync);
        outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
+       outputModule->synccustomCB->setEnabled(bp_.output_sync);
+       outputModule->synccustomLA->setEnabled(bp_.output_sync);
 
        outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
        outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
@@ -4321,6 +4327,8 @@ void GuiDocument::paramsToDialog()
 
        outputModule->saveTransientPropertiesCB
                ->setChecked(bp_.save_transient_properties);
+       outputModule->postponeFragileCB
+               ->setChecked(bp_.postpone_fragile_content);
 
        // paper
        bool const extern_geometry =
@@ -5154,6 +5162,13 @@ void GuiDocument::outputChangesToggled(bool on)
        change_adaptor();
 }
 
+void GuiDocument::setOutputSync(bool on)
+{
+       outputModule->synccustomCB->setEnabled(on);
+       outputModule->synccustomLA->setEnabled(on);
+       change_adaptor();
+}
+
 
 
 Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); }
index 2d0f7eaa73638f8b3bce36050c3fab5a9df35364..3e9aa7ce5dff1c3b16077bfbb40ab8c8b3ddfb63 100644 (file)
@@ -165,6 +165,7 @@ private Q_SLOTS:
        void resetModuleFilter();
        void linenoToggled(bool);
        void outputChangesToggled(bool);
+       void setOutputSync(bool);
 private:
        /// validate listings parameters and return an error message, if any
        QString validateListingsParameters();
index 0691697239421d3331736151f92c22132db3dfde..b828e2304a13c9d7f61ecac3bf13c675ecedba9b 100644 (file)
@@ -6,14 +6,14 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>388</width>
-    <height>413</height>
+    <width>510</width>
+    <height>504</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
+  <layout class="QGridLayout" name="gridLayout_2">
    <item row="0" column="0">
     <widget class="QGroupBox" name="outputFormatGB">
      <property name="title">
@@ -22,7 +22,7 @@
      <property name="flat">
       <bool>true</bool>
      </property>
-     <layout class="QGridLayout">
+     <layout class="QGridLayout" name="gridlayout8">
       <property name="leftMargin">
        <number>9</number>
       </property>
           </property>
          </widget>
         </item>
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
        </layout>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="5" column="0">
-    <widget class="QGroupBox" name="savingGB">
-     <property name="title">
-      <string>LyX Format</string>
-     </property>
-     <property name="flat">
-      <bool>true</bool>
-     </property>
-     <property name="checkable">
-      <bool>false</bool>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <widget class="QCheckBox" name="saveTransientPropertiesCB">
-        <property name="toolTip">
-         <string>Save all parameters in the LyX file, including ones that are frequently switched or that are specific to the user (such as the output of the tracked changes, or the document directory path). Disabling this option plays nicer in collaborative settings and with version control systems.</string>
-        </property>
-        <property name="text">
-         <string>Save &amp;transient properties</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="1" column="0">
     <widget class="QCheckBox" name="shellescapeCB">
      <property name="toolTip">
      </property>
     </widget>
    </item>
-   <item row="2" column="0">
-    <widget class="QGroupBox" name="outputsyncCB">
-     <property name="toolTip">
-      <string>Enable forward/reverse search between editor and output (e.g., SyncTeX)</string>
-     </property>
-     <property name="title">
-      <string>S&amp;ynchronize with output</string>
-     </property>
-     <property name="flat">
-      <bool>true</bool>
-     </property>
-     <property name="checkable">
-      <bool>true</bool>
-     </property>
-     <property name="checked">
-      <bool>false</bool>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout_2">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>C&amp;ustom macro:</string>
-          </property>
-          <property name="buddy">
-           <cstring>synccustomCB</cstring>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QComboBox" name="synccustomCB">
-          <property name="toolTip">
-           <string>Custom LaTeX preamble macro</string>
-          </property>
-          <property name="editable">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item row="3" column="0">
     <widget class="QGroupBox" name="xhtmlGB">
      <property name="title">
       <bool>true</bool>
      </property>
      <layout class="QGridLayout" name="outGridLayout">
-      <item row="0" column="0">
-       <widget class="QCheckBox" name="strictCB">
-        <property name="toolTip">
-         <string>Whether to comply strictly with XHTML 1.1.</string>
-        </property>
-        <property name="text">
-         <string>&amp;Strict XHTML 1.1</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="mathoutLA">
-        <property name="font">
-         <font>
-          <weight>50</weight>
-          <bold>false</bold>
-         </font>
-        </property>
-        <property name="text">
-         <string>&amp;Math output:</string>
-        </property>
-        <property name="buddy">
-         <cstring>mathoutCB</cstring>
-        </property>
-       </widget>
-      </item>
       <item row="1" column="1">
        <widget class="QComboBox" name="mathoutCB">
         <property name="font">
         </item>
        </widget>
       </item>
+      <item row="0" column="1">
+       <widget class="QCheckBox" name="cssCB">
+        <property name="text">
+         <string>Write CSS to file</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="mathoutLA">
+        <property name="font">
+         <font>
+          <weight>50</weight>
+          <bold>false</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>&amp;Math output:</string>
+        </property>
+        <property name="buddy">
+         <cstring>mathoutCB</cstring>
+        </property>
+       </widget>
+      </item>
       <item row="2" column="0">
        <widget class="QLabel" name="mathimgLA">
         <property name="font">
         </property>
        </widget>
       </item>
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="strictCB">
+        <property name="toolTip">
+         <string>Whether to comply strictly with XHTML 1.1.</string>
+        </property>
+        <property name="text">
+         <string>&amp;Strict XHTML 1.1</string>
+        </property>
+       </widget>
+      </item>
       <item row="2" column="1">
        <widget class="QDoubleSpinBox" name="mathimgSB">
         <property name="font">
         </property>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QCheckBox" name="cssCB">
+      <item row="1" column="2">
+       <spacer name="horizontalSpacer_3">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QGroupBox" name="savingGB">
+     <property name="title">
+      <string>LyX Format</string>
+     </property>
+     <property name="flat">
+      <bool>true</bool>
+     </property>
+     <property name="checkable">
+      <bool>false</bool>
+     </property>
+     <layout class="QGridLayout" name="gridLayout7">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="saveTransientPropertiesCB">
+        <property name="toolTip">
+         <string>Save all parameters in the LyX file, including ones that are frequently switched or that are specific to the user (such as the output of the tracked changes, or the document directory path). Disabling this option plays nicer in collaborative settings and with version control systems.</string>
+        </property>
         <property name="text">
-         <string>Write CSS to file</string>
+         <string>Save &amp;transient properties</string>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </item>
-   <item row="6" column="0">
+   <item row="5" column="0">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
     </spacer>
    </item>
+   <item row="2" column="0">
+    <widget class="QGroupBox" name="latexOutputGB">
+     <property name="title">
+      <string>LaTeX Output Options</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QCheckBox" name="outputsyncCB">
+          <property name="toolTip">
+           <string>Enable forward/reverse search between editor and output (e.g., SyncTeX)</string>
+          </property>
+          <property name="text">
+           <string>S&amp;ynchronize with output</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_4">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeType">
+           <enum>QSizePolicy::Fixed</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>20</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout">
+          <item>
+           <widget class="QLabel" name="synccustomLA">
+            <property name="text">
+             <string>C&amp;ustom macro:</string>
+            </property>
+            <property name="buddy">
+             <cstring>synccustomCB</cstring>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QComboBox" name="synccustomCB">
+            <property name="toolTip">
+             <string>Custom LaTeX preamble macro</string>
+            </property>
+            <property name="editable">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0">
+       <widget class="QCheckBox" name="postponeFragileCB">
+        <property name="toolTip">
+         <string>If this is checked, fragile items such as labels and index entries are moved out of moving arguments such as sections and captions. This prevents LaTeX errors that can happen in such cases. It is recommended to keep this on.</string>
+        </property>
+        <property name="text">
+         <string>Put fra&amp;gile content out of moving arguments</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
   </layout>
  </widget>
  <includes>
index fcd03343065a95fb8ae7865137b88776f10a5415..919ecd8f6dd35280db374672bdb9a8aa90deb88c 100644 (file)
@@ -260,7 +260,7 @@ void InsetCaption::latex(otexstream & os,
        OutputParams runparams = runparams_in;
        // Some fragile commands (labels, index entries)
        // are output after the caption (#2154)
-       runparams.postpone_fragile_stuff = true;
+       runparams.postpone_fragile_stuff = buffer().masterParams().postpone_fragile_content;
        InsetText::latex(os, runparams);
        if (!runparams.post_macro.empty()) {
                // Output the stored fragile commands (labels, indices etc.)
index 4befb3cb6d09b4ef4c79ff72507e6d1cad88b7ca..8a6ed8f4e5230501c7b5a3a0e1f99ea75f27c6bc 100644 (file)
@@ -818,7 +818,8 @@ void TeXOnePar(Buffer const & buf,
                        // Due to the moving argument, some fragile
                        // commands (labels, index entries)
                        // are output after this command (#2154)
-                       runparams.postpone_fragile_stuff = true;
+                       runparams.postpone_fragile_stuff =
+                               bparams.postpone_fragile_content;
                if (intitle_command)
                        os << '{';
 
@@ -932,7 +933,8 @@ void TeXOnePar(Buffer const & buf,
                        // Due to the moving argument, some fragile
                        // commands (labels, index entries)
                        // are output after this command (#2154)
-                       runparams.postpone_fragile_stuff = true;
+                       runparams.postpone_fragile_stuff =
+                               bparams.postpone_fragile_content;
                os << '{';
        }
 
@@ -1149,7 +1151,8 @@ void TeXOnePar(Buffer const & buf,
                        // Due to the moving argument, some fragile
                        // commands (labels, index entries)
                        // are output after this command (#2154)
-                       runparams.postpone_fragile_stuff = true;
+                       runparams.postpone_fragile_stuff =
+                               bparams.postpone_fragile_content;
        }
 
        Font const outerfont = text.outerFont(pit);
index ee529fc31348bac74d730f87ecd99ead30be68e1..8d5c2129d52afea36832e69acfe23088f5313701 100644 (file)
@@ -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 590 // spitz: changebars
-#define LYX_FORMAT_TEX2LYX 590
+#define LYX_FORMAT_LYX 591 // spitz: postpone_fragile_content
+#define LYX_FORMAT_TEX2LYX 591
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER