#LyX 2.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 459
+\lyxformat 462
\begin_document
\begin_header
\textclass moderncv
\end_inset
+\end_layout
+
+\begin_layout PDF Page Mode
+UseOutlines
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+optional, controls how the PDF will be shown; use either 'UseNone' (only
+ the document), 'UseThumbs' (show thumbnails), 'UseOutlines' (show bookmarks)
+ or 'FullScreen' (open in fullscreen mode).
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout FirstName
\begin_layout Title
Curriculum Vitae
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+optional
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
status open
\begin_layout Plain Layout
-Teststreet 17
+Teststreet
+\begin_inset space ~
+\end_inset
+
+17
\end_layout
\end_inset
-03333 Nicecity -- Switzerland
-\begin_inset Note Note
-status collapsed
-
-\begin_layout Plain Layout
-\series bold
-Note:
-\series default
- Only when you use the
-\emph on
-classic
-\emph default
- theme, you can add a line break with:
-\begin_inset ERT
-status collapsed
+\begin_inset Argument 2
+status open
\begin_layout Plain Layout
+03333
+\begin_inset space ~
+\end_inset
-
-\backslash
-protect
-\backslash
-
-\backslash
-
+Nicecity
\end_layout
\end_inset
+Switzerland
+\begin_inset Note Note
+status collapsed
+\begin_layout Plain Layout
+the optional lines are only important for the styles
+\emph on
+classic
+\emph default
+ and
+\emph on
+oldstyle
\end_layout
\end_inset
\end_layout
\begin_layout Section
-Section with your own content
+Section with a column
\end_layout
-\begin_layout CloseSection
+\begin_layout Columns
+\begin_inset Flex Column
+status open
+
+\begin_layout Plain Layout
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+0.5
+\end_layout
+
+\end_inset
+
+
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
-This ends the section formatting.
+the optional width is a number in the range 0 - 1 and specifies the fraction
+ of the line length; if no width is given all available width is used for
+ the column
+\end_layout
+
+\end_inset
+
+
+\begin_inset Argument 2
+status open
+
+\begin_layout Plain Layout
+header 1
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Itemize
+Everything can be the content
+\end_layout
+
+\begin_layout Plain Layout
+\noindent
+\begin_inset Tabular
+<lyxtabular version="3" rows="1" columns="1">
+<features rotate="0" tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+even a table
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+
+\series bold
+Note:
+\series default
+ paragraph alignments are not allowed, so e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+centering the table is not possible
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Flex Column
+status open
+
+\begin_layout Plain Layout
+\begin_inset Argument 2
+status open
+
+\begin_layout Plain Layout
+header 2
+\end_layout
+
+\end_inset
+
+the second column
\end_layout
\end_inset
\end_layout
+\begin_layout Section
+Section with your own content
+\end_layout
+
\begin_layout Standard
Your content here, inside an unformatted environment.
- You can use here e.g.
- mathematics
+ You can use here e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+mathematics
\begin_inset Formula
\[
E=mc^{2}
\begin_layout EmptySection
\begin_inset Note Note
-status collapsed
+status open
\begin_layout Plain Layout
Creates a section without a section heading.
\end_inset
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+Keep entries with green labels empty!
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Item
Back to moderncv layout, without making a new section
\end_layout
-\begin_layout CloseSection
-
-\end_layout
-
\begin_layout Standard
You can use bibitems:
\end_layout
\end_inset
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+Keep entries with green labels empty!
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
\end_layout
\begin_layout MakeLetterClosing
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+Keep entries with green labels empty!
+\end_layout
+
+\end_inset
+
\end_layout
i = realparbeg + 1 + len(subst)
-def revert_Argument_to_TeX_brace(document, line, n, nmax, environment):
+def revert_Argument_to_TeX_brace(document, line, endline, n, nmax, environment, opt):
'''
Reverts an InsetArgument to TeX-code
usage:
- revert_Argument_to_TeX_brace(document, LineOfBeginLayout, StartArgument, EndArgument, isEnvironment)
- LineOfBeginLayout is the line of the \begin_layout statement
+ revert_Argument_to_TeX_brace(document, LineOfBegin, LineOfEnd, StartArgument, EndArgument, isEnvironment, isOpt)
+ LineOfBegin is the line of the \begin_layout or \begin_inset statement
+ LineOfEnd is the line of the \end_layout or \end_inset statement, if "0" is given, the end of the file is used instead
StartArgument is the number of the first argument that needs to be converted
EndArgument is the number of the last argument that needs to be converted or the last defined one
- isEnvironment must be true, if the layout id for a LaTeX environment
+ isEnvironment must be true, if the layout is for a LaTeX environment
+ isOpt must be true, if the argument is an optional one
'''
lineArg = 0
+ wasOpt = False
while lineArg != -1 and n < nmax + 1:
lineArg = find_token(document.body, "\\begin_inset Argument " + str(n), line)
+ if lineArg > endline and endline != 0:
+ return wasOpt
if lineArg != -1:
beginPlain = find_token(document.body, "\\begin_layout Plain Layout", lineArg)
# we have to assure that no other inset is in the Argument
k = beginInset + 1
l = endInset + 1
if environment == False:
- document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("}{")
- del(document.body[lineArg : beginPlain + 1])
+ if opt == False:
+ document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("}{")
+ del(document.body[lineArg : beginPlain + 1])
+ wasOpt = False
+ else:
+ document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("]")
+ document.body[lineArg : beginPlain + 1] = put_cmd_in_ert("[")
+ wasOpt = True
else:
document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("}")
document.body[lineArg : beginPlain + 1] = put_cmd_in_ert("{")
+ wasOpt = False
n = n + 1
+ return wasOpt
def convert_TeX_brace_to_Argument(document, line, n, nmax, inset, environment):
if i != -1:
i = find_token(document.body, "\\begin_layout Page headings", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 1, False, False)
i = i + 1
if i2 != -1:
i2 = find_token(document.body, "\\begin_inset Flex Paragraph Start", i2)
if i2 != -1:
- revert_Argument_to_TeX_brace(document, i2, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i2, 0, 1, 1, False, False)
i2 = i2 + 1
if j != -1:
j = find_token(document.body, "\\begin_layout Biography without photo", j)
if j != -1:
- revert_Argument_to_TeX_brace(document, j, 1, 1, True)
+ revert_Argument_to_TeX_brace(document, j, 0, 1, 1, True, False)
j = j + 1
if k != -1:
k = find_token(document.body, "\\begin_layout Biography", k)
continue
if k != -1:
# start with the second argument, therefore 2
- revert_Argument_to_TeX_brace(document, k, 2, 2, True)
+ revert_Argument_to_TeX_brace(document, k, 0, 2, 2, True, False)
k = k + 1
if i == -1 and i2 == -1 and j == -1 and k == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_layout Altaffilation", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 1, False, False)
i = i + 1
if i == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_layout Author affiliation", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 1, False, False)
i = i + 1
if i == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_layout MarkBoth", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 1, False, False)
i = i + 1
if i == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_layout Conference", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 1, False, False)
i = i + 1
if j != -1:
j = find_token(document.body, "\\begin_layout Author", j)
if j != -1:
- revert_Argument_to_TeX_brace(document, j, 1, 2, False)
+ revert_Argument_to_TeX_brace(document, j, 0, 1, 2, False, False)
j = j + 1
if i == -1 and j == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_inset Flex CRcat", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 3, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 1, 3, False, False)
i = i + 1
if i == -1:
return
if i != -1:
i = find_token(document.body, "\\begin_layout Item", i)
if i != -1:
- revert_Argument_to_TeX_brace(document, i, 2, 2, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 2, 2, False, False)
i = i + 1
if j != -1:
j = find_token(document.body, "\\begin_layout BulletedItem", j)
if j != -1:
- revert_Argument_to_TeX_brace(document, j, 2, 2, False)
+ revert_Argument_to_TeX_brace(document, j, 0, 2, 2, False, False)
j = j + 1
if k != -1:
k = find_token(document.body, "\\begin_layout Language", k)
if k != -1:
- revert_Argument_to_TeX_brace(document, k, 2, 6, False)
+ revert_Argument_to_TeX_brace(document, k, 0, 2, 6, False, False)
k = k + 1
if m != -1:
m = find_token(document.body, "\\begin_layout LastLanguage", m)
if m != -1:
- revert_Argument_to_TeX_brace(document, m, 2, 6, False)
+ revert_Argument_to_TeX_brace(document, m, 0, 2, 6, False, False)
m = m + 1
if i == -1 and j == -1 and k == -1 and m == -1:
return
def revert_ModernCV(document):
" Reverts InsetArguments of modernCV to TeX-code "
if document.textclass == "moderncv":
- i = 0
j = 0
k = 0
m = 0
o = 0
while True:
- if i != -1:
- i = find_token(document.body, "\\begin_layout DoubleItem", i)
- if i != -1:
- revert_Argument_to_TeX_brace(document, i, 1, 3, False)
- i = i + 1
if j != -1:
j = find_token(document.body, "\\begin_layout Entry", j)
if j != -1:
- revert_Argument_to_TeX_brace(document, j, 1, 5, False)
+ revert_Argument_to_TeX_brace(document, j, 0, 1, 5, False, False)
j = j + 1
if k != -1:
k = find_token(document.body, "\\begin_layout Item", k)
if k != -1:
- revert_Argument_to_TeX_brace(document, k, 1, 1, False)
+ revert_Argument_to_TeX_brace(document, k, 0, 1, 1, False, False)
k = k + 1
if m != -1:
m = find_token(document.body, "\\begin_layout ItemWithComment", m)
if m != -1:
- revert_Argument_to_TeX_brace(document, m, 1, 2, False)
+ revert_Argument_to_TeX_brace(document, m, 0, 1, 2, False, False)
document.body[m] = document.body[m].replace("\\begin_layout ItemWithComment", "\\begin_layout Language")
m = m + 1
if o != -1:
o = find_token(document.body, "\\begin_layout DoubleItem", o)
if o != -1:
- revert_Argument_to_TeX_brace(document, o, 1, 3, False)
+ revert_Argument_to_TeX_brace(document, o, 0, 1, 3, False, False)
document.body[o] = document.body[o].replace("\\begin_layout DoubleItem", "\\begin_layout Computer")
o = o + 1
- if i == -1 and j == -1 and k == -1 and m == -1 and o == -1:
+ if j == -1 and k == -1 and m == -1 and o == -1:
+ return
+
+
+def revert_ModernCV_2(document):
+ " Reverts the Flex:Column inset of modernCV to TeX-code "
+ if document.textclass == "moderncv":
+ flex = 0
+ flexEnd = -1
+ while True:
+ if flex != -1:
+ flex = find_token(document.body, "\\begin_inset Flex Column", flex)
+ if flex != -1:
+ flexEnd = find_end_of_inset(document.body, flex)
+ wasOpt = revert_Argument_to_TeX_brace(document, flex, flexEnd, 1, 1, False, True)
+ revert_Argument_to_TeX_brace(document, flex, 0, 2, 2, False, False)
+ flexEnd = find_end_of_inset(document.body, flex)
+ if wasOpt == True:
+ document.body[flex + 0 : flex + 4] = put_cmd_in_ert("\\cvcolumn")
+ else:
+ document.body[flex + 0 : flex + 4] = put_cmd_in_ert("\\cvcolumn{")
+ document.body[flexEnd + 4 : flexEnd + 7] = put_cmd_in_ert("}")
+ flex = flex + 1
+ if flex == -1:
+ return flexEnd
+
+
+def revert_ModernCV_3(document):
+ " Reverts the Column style of modernCV to TeX-code "
+ if document.textclass == "moderncv":
+ # revert the layouts
+ revert_ModernCV(document)
+ p = 0
+ # get the position of the end of the last column inset
+ LastFlexEnd = revert_ModernCV_2(document)
+ while True:
+ if p != -1:
+ p = find_token(document.body, "\\begin_layout Columns", p)
+ if p != -1:
+ pEnd = find_end_of_layout(document.body, p)
+ document.body[p] = document.body[p].replace("\\begin_layout Columns", "\\begin_layout Standard")
+ if LastFlexEnd != -1:
+ document.body[p + 1 : p + 1] = put_cmd_in_ert("\\begin{cvcolumns}")
+ document.body[LastFlexEnd + 24 : LastFlexEnd + 24] = put_cmd_in_ert("\\end{cvcolumns}")
+ p = p + 1
+ if p == -1:
return
i = find_token(document.body, "\\begin_layout Initial", i)
if i != -1:
# first arg (optional) and second arg (first mandatory) are supported in LyX 2.0.x
- revert_Argument_to_TeX_brace(document, i, 3, 3, False)
+ revert_Argument_to_TeX_brace(document, i, 0, 3, 3, False, False)
i = i + 1
if i == -1:
return
[449, [revert_garamondx, revert_garamondx_newtxmath]],
[448, [revert_itemargs]],
[447, [revert_literate]],
- [446, [revert_IEEEtran, revert_IEEEtran_2, revert_AASTeX, revert_AGUTeX, revert_IJMP, revert_SIGPLAN, revert_SIGGRAPH, revert_EuropeCV, revert_Initials, revert_ModernCV]],
+ [446, [revert_IEEEtran, revert_IEEEtran_2, revert_AASTeX, revert_AGUTeX, revert_IJMP, revert_SIGPLAN, revert_SIGGRAPH, revert_EuropeCV, revert_Initials, revert_ModernCV_3]],
[445, [revert_latexargs]],
[444, [revert_uop]],
[443, [revert_biolinum]],