def convert_author_id(document):
" Add the author_id to the \\author definition and make sure 0 is not used"
i = 0
- j = 1\r
+ j = 1
while True:
i = find_token(document.header, "\\author", i)
if i == -1:
r = re.compile(r'(\\author) (\".*\")\s?(.*)$')
m = r.match(document.header[i])
if m != None:
- name = m.group(2)\r
- \r
- email = ''\r
- if m.lastindex == 3:\r
- email = m.group(3)\r
- document.header[i] = "\\author %i %s %s" % (j, name, email)\r
+ name = m.group(2)
+
+ email = ''
+ if m.lastindex == 3:
+ email = m.group(3)
+ document.header[i] = "\\author %i %s %s" % (j, name, email)
j = j + 1
- i = i + 1\r
- \r
- k = 0\r
- while True:\r
- k = find_token(document.body, "\\change_", k)\r
- if k == -1:\r
- break\r
-\r
- change = document.body[k].split(' ');\r
- if len(change) == 3:\r
- type = change[0]\r
- author_id = int(change[1])\r
- time = change[2]\r
- document.body[k] = "%s %i %s" % (type, author_id + 1, time)\r
- k = k + 1\r
+ i = i + 1
+
+ k = 0
+ while True:
+ k = find_token(document.body, "\\change_", k)
+ if k == -1:
+ break
+
+ change = document.body[k].split(' ');
+ if len(change) == 3:
+ type = change[0]
+ author_id = int(change[1])
+ time = change[2]
+ document.body[k] = "%s %i %s" % (type, author_id + 1, time)
+ k = k + 1
def revert_author_id(document):
" Remove the author_id from the \\author definition "
if m != None:
author_id = int(m.group(2))
idmap[author_id] = j
- name = m.group(3)\r
- \r
- email = ''\r
- if m.lastindex == 4:\r
- email = m.group(4)\r
+ name = m.group(3)
+
+ email = ''
+ if m.lastindex == 4:
+ email = m.group(4)
document.header[i] = "\\author %s %s" % (name, email)
i = i + 1
j = j + 1
k = find_token(document.body, "\\change_", k)
if k == -1:
break
-\r
- change = document.body[k].split(' ');\r
- if len(change) == 3:\r
- type = change[0]\r
- author_id = int(change[1])\r
- time = change[2]\r
+
+ change = document.body[k].split(' ');
+ if len(change) == 3:
+ type = change[0]
+ author_id = int(change[1])
+ time = change[2]
document.body[k] = "%s %i %s" % (type, idmap[author_id], time)
k = k + 1
+def revert_suppress_date(document):
+ " Revert suppressing of default document date to preamble code "
+ i = 0
+ while True:
+ i = find_token(document.header, "\\suppress_date", i)
+ if i == -1:
+ break
+ # remove the preamble line and write to the preamble
+ # when suppress_date was true
+ date = get_value(document.header, "\\suppress_date", i)
+ if date == "true":
+ add_to_preamble(document, ["% this command was inserted by lyx2lyx"])
+ add_to_preamble(document, ["\\date{}"])
+ del document.header[i]
+ i = i + 1
+
+
##
# Conversion hub
#
[366, []],
[367, []],
[368, []],
- [369, [convert_author_id]]
+ [369, [convert_author_id]],
+ [370, []],
]
-revert = [[368, [revert_author_id]],
+revert = [[369, [revert_suppress_date]],
+ [368, [revert_author_id]],
[367, [revert_hspace_glue_lengths]],
[366, [revert_percent_vspace_lengths, revert_percent_hspace_lengths]],
[365, [revert_percent_skip_lengths]],
-<ui version="4.0" >
+<ui version="4.0">
<class>LaTeXUi</class>
- <widget class="QWidget" name="LaTeXUi" >
- <property name="geometry" >
+ <widget class="QWidget" name="LaTeXUi">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>341</width>
- <height>301</height>
+ <height>319</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string/>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" colspan="3" >
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="3">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
<string>Document &class</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QComboBox" name="classCO" >
- <property name="maxVisibleItems" >
+ <item row="0" column="0">
+ <widget class="QComboBox" name="classCO">
+ <property name="maxVisibleItems">
<number>20</number>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QPushButton" name="layoutPB" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="layoutPB">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="toolTip" >
+ <property name="toolTip">
<string>Click to select a local document class definition file</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&Local Layout...</string>
</property>
</widget>
</layout>
</widget>
</item>
- <item row="1" column="0" colspan="3" >
- <widget class="QGroupBox" name="optionsGB" >
- <property name="title" >
+ <item row="1" column="0" colspan="3">
+ <widget class="QGroupBox" name="optionsGB">
+ <property name="title">
<string>Class options</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item rowspan="2" row="0" column="1" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <item row="0" column="1" rowspan="2">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="QLineEdit" name="defaultOptionsLE" >
- <property name="toolTip" >
+ <widget class="QLineEdit" name="defaultOptionsLE">
+ <property name="toolTip">
<string>The options that are predefined in the layout file. Click to the left to select/deselect.</string>
</property>
- <property name="readOnly" >
+ <property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="optionsLE" />
+ <widget class="QLineEdit" name="optionsLE"/>
</item>
</layout>
</item>
- <item row="0" column="0" >
- <widget class="QCheckBox" name="defaultOptionsCB" >
- <property name="toolTip" >
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="defaultOptionsCB">
+ <property name="toolTip">
<string>Enable to use the options that are predefined in the layout file</string>
</property>
- <property name="text" >
+ <property name="text">
<string>P&redefined:</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="optionsL" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="optionsL">
+ <property name="text">
<string>Cust&om:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>optionsLE</cstring>
</property>
</widget>
</layout>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="psdriverL" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="psdriverL">
+ <property name="text">
<string>&Graphics driver:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>psdriverCO</cstring>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="psdriverCO" >
- <property name="duplicatesEnabled" >
+ <item row="2" column="2">
+ <widget class="QComboBox" name="psdriverCO">
+ <property name="duplicatesEnabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="2" column="2" >
- <spacer>
- <property name="orientation" >
+ <item row="2" column="3">
+ <spacer name="horizontalSpacer_1">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>261</width>
<height>22</height>
</property>
</spacer>
</item>
- <item row="3" column="0" colspan="3" >
- <widget class="QGroupBox" name="childDocGB" >
- <property name="toolTip" >
+ <item row="3" column="0" colspan="4">
+ <widget class="QGroupBox" name="childDocGB">
+ <property name="toolTip">
<string>Select if the current document is included to a master file</string>
</property>
- <property name="statusTip" >
+ <property name="statusTip">
<string/>
</property>
- <property name="title" >
+ <property name="title">
<string>Select de&fault master document</string>
</property>
- <property name="checkable" >
+ <property name="checkable">
<bool>true</bool>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" >
- <widget class="QLabel" name="childDocLA" >
- <property name="text" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="childDocLA">
+ <property name="text">
<string>&Master:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>childDocLE</cstring>
</property>
</widget>
</item>
- <item row="0" column="2" >
- <widget class="QPushButton" name="childDocPB" >
- <property name="text" >
+ <item row="0" column="2">
+ <widget class="QPushButton" name="childDocPB">
+ <property name="text">
<string>&Browse...</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="childDocLE" >
- <property name="toolTip" >
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="childDocLE">
+ <property name="toolTip">
<string>Enter the name of the default master document</string>
</property>
</widget>
</layout>
</widget>
</item>
- <item row="4" column="0" >
- <spacer>
- <property name="orientation" >
+ <item row="4" column="0" colspan="4">
+ <widget class="QCheckBox" name="suppressDateCB">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Suppress default date on front page</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
<tabstop>psdriverCO</tabstop>
</tabstops>
<includes>
- <include location="local" >qt_i18n.h</include>
+ <include location="local">qt_i18n.h</include>
</includes>
<resources/>
<connections>
<receiver>defaultOptionsLE</receiver>
<slot>setEnabled(bool)</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>63</x>
<y>79</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>237</x>
<y>82</y>
</hint>