sigplanconf: complete revision of layout and templates/ACM-sigplan.lyx

- additionally some fixes for the generic insetArgument lyx2lyx routines
This commit is contained in:
Uwe Stöhr 2012-11-30 01:54:57 +01:00
parent 1500e44cba
commit 5c5e8817e3
3 changed files with 247 additions and 159 deletions

View File

@ -16,11 +16,11 @@
Format 41 Format 41
Columns 1 Columns 1
Sides 1 Sides 1
SecNumDepth 3 SecNumDepth 3
TocDepth 3 TocDepth 3
DefaultStyle Standard DefaultStyle Standard
ClassOptions ClassOptions
FontSize 9|10|11 FontSize 9|10|11
@ -55,46 +55,66 @@ Input stdstarsections.inc
# don't use the following styles # don't use the following styles
NoStyle Part NoStyle Part
NoCounter part NoCounter part
NoStyle Part* NoStyle Part*
NoStyle Chapter NoStyle Chapter
NoCounter chapter NoCounter chapter
NoStyle Chapter* NoStyle Chapter*
NoStyle Subparagraph NoStyle Subparagraph
NoCounter subparagraph NoCounter subparagraph
NoStyle Subparagraph* NoStyle Subparagraph*
Style Conference Style Conference
Margin Dynamic Margin Dynamic
LatexType Command LatexType Command
LatexName conferenceinfo LatexName conferenceinfo
Category FrontMatter Category FrontMatter
InTitle 1 InTitle 1
ParSkip 0.4 ParSkip 0.4
BottomSep 0.5 BottomSep 0.5
Align Left Align Left
LabelSep xx Argument 1
LabelType Static Mandatory 1
LabelString "Conference:" LabelString "Name"
Tooltip "Name of the conference"
EndArgument
LabelSep xx
LabelType Static
LabelString "Conference:"
LabelFont LabelFont
Color Green Color Green
Series Bold Series Bold
EndFont EndFont
End End
Style CopyrightYear Style CopyrightYear
CopyStyle Conference CopyStyle Conference
LatexName CopyrightYear ResetArgs 1
LabelString "Copyright year:" LatexName CopyrightYear
LabelString "Copyright year:"
End End
Style Copyrightdata Style Copyrightdata
CopyStyle Conference CopyStyle CopyrightYear
LatexName copyrightdata LatexName copyrightdata
LabelString "Copyright data:" LabelString "Copyright data:"
End
Style TitleBanner
CopyStyle CopyrightYear
LatexName titlebanner
LabelString "Title banner:"
End
Style PreprintFooter
CopyStyle CopyrightYear
LatexName preprintfooter
LabelString "Preprint footer:"
End End
@ -102,91 +122,99 @@ Input stdtitle.inc
Input stdstruct.inc Input stdstruct.inc
Style Title
CopyStyle Title
AlignPossible Block
End
Style Subtitle Style Subtitle
CopyStyle Title CopyStyle Title
LatexName subtitle LatexName subtitle
Font Font
Size Larger Size Larger
EndFont EndFont
End End
# overwrite the Author definition from stdtitle.inc # overwrite the Author definition from stdtitle.inc
Style Author Style Author
Margin Static Margin Static
LatexType Command LatexType Command
LatexName authorinfo LatexName authorinfo
Category FrontMatter Category FrontMatter
InTitle 1 InTitle 1
LabelSep xxx LabelSep xxx
ParSkip 0.4 ParSkip 0.4
TopSep 1.3 TopSep 1.3
BottomSep 0.7 BottomSep 0.7
ParSep 0.7 ParSep 0.7
Align Center Align Center
LabelType No_Label Argument 1
Mandatory 1
LabelString "Name"
Tooltip "Name of the author"
Font
Size Large
EndFont
EndArgument
Argument 2
Mandatory 1
LabelString "Affiliation"
Tooltip "Affiliation and/or address of the author"
EndArgument
LabelType No_Label
Font Font
Size Large Family Sans
Size Normal
EndFont EndFont
End End
Style Terms Style Terms
CopyStyle Conference CopyStyle CopyrightYear
LatexName terms LatexName terms
InTitle 0 InTitle 0
LabelString "Terms:" LabelString "Terms:"
End End
Style Keywords Style Keywords
CopyStyle Terms CopyStyle CopyrightYear
LatexName keywords LatexName keywords
LabelString "Keywords:" LabelString "Keywords:"
End End
Style Abstract Style Abstract
Margin Static Margin Static
LatexType Environment LatexType Environment
LatexName abstract LatexName abstract
Category FrontMatter Category FrontMatter
NextNoIndent 1 NextNoIndent 1
LeftMargin MMM LeftMargin MMM
RightMargin MMM RightMargin MMM
ParIndent MM ParIndent MM
ItemSep 0 ItemSep 0
TopSep 0.7 TopSep 0.7
BottomSep 0.7 BottomSep 0.7
ParSep 0 ParSep 0
Align Block Align Block
AlignPossible Block AlignPossible Block
LabelType Centered_Top_Environment LabelType Centered_Top_Environment
LabelString "Abstract" LabelString "Abstract"
LabelBottomSep 0.5 LabelBottomSep 0.5
Font Font
Size Small Size Small
EndFont EndFont
LabelFont LabelFont
Series Bold Series Bold
Size Large Size Large
EndFont EndFont
End End
Style Acknowledgments Style Acknowledgments
CopyStyle Abstract CopyStyle Abstract
LatexName acks LatexType Command
Category BackMatter LatexName acks
InTitle 0 Category BackMatter
LabelBottomsep 0 LabelBottomsep 0
LabelType Top_Environment LabelType Top_Environment
LabelString "Acknowledgments" LabelString "Acknowledgments"
End End

View File

@ -1181,13 +1181,21 @@ def revert_Argument_to_TeX_brace(document, line, n, nmax, environment):
lineArg = find_token(document.body, "\\begin_inset Argument " + str(n), line) lineArg = find_token(document.body, "\\begin_inset Argument " + str(n), line)
if lineArg != -1: if lineArg != -1:
beginPlain = find_token(document.body, "\\begin_layout Plain Layout", lineArg) beginPlain = find_token(document.body, "\\begin_layout Plain Layout", lineArg)
endLayout = find_token(document.body, "\\end_layout", beginPlain) # we have to assure that no other inset is in the Argument
endInset = find_token(document.body, "\\end_inset", endLayout) beginInset = find_token(document.body, "\\begin_inset", beginPlain)
endInset = find_token(document.body, "\\end_inset", beginPlain)
k = beginPlain + 1
l = k
while beginInset < endInset and beginInset != -1:
beginInset = find_token(document.body, "\\begin_inset", k)
endInset = find_token(document.body, "\\end_inset", l)
k = beginInset + 1
l = endInset + 1
if environment == False: if environment == False:
document.body[endLayout : endInset + 1] = put_cmd_in_ert("}{") document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("}{")
del(document.body[lineArg : beginPlain + 1]) del(document.body[lineArg : beginPlain + 1])
else: else:
document.body[endLayout : endInset + 1] = put_cmd_in_ert("}") document.body[endInset - 2 : endInset + 1] = put_cmd_in_ert("}")
document.body[lineArg : beginPlain + 1] = put_cmd_in_ert("{") document.body[lineArg : beginPlain + 1] = put_cmd_in_ert("{")
n = n + 1 n = n + 1
@ -1257,8 +1265,12 @@ def convert_Argument_to_TeX_brace(document, line, n, nmax, environment):
if bracePair == lineArg + 5 or bracePair == lineArg + 4: if bracePair == lineArg + 5 or bracePair == lineArg + 4:
end = find_token(document.body, "\\end_inset", bracePair) end = find_token(document.body, "\\end_inset", bracePair)
document.body[lineArg : end + 1] = ["\\end_layout", "", "\\end_inset"] document.body[lineArg : end + 1] = ["\\end_layout", "", "\\end_inset"]
document.body[line + 1 : line + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"] if n == 1:
document.body[line + 1 : line + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"]
else:
document.body[endn + 1 : endn + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"]
n = n + 1 n = n + 1
endn = end
else: else:
lineArg = lineArg + 1 lineArg = lineArg + 1
if environment == True and lineArg != -1: if environment == True and lineArg != -1:
@ -1397,6 +1409,47 @@ def convert_IJMP(document):
if i == -1: if i == -1:
return return
def revert_SIGPLAN(document):
" Reverts InsetArgument of MarkBoth to TeX-code "
if document.textclass == "sigplanconf":
i = 0
j = 0
while True:
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)
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)
j = j + 1
if i == -1 and j == -1:
return
def convert_SIGPLAN(document):
" Converts ERT of MarkBoth to InsetArgument "
if document.textclass == "sigplanconf":
i = 0
j = 0
while True:
if i != -1:
i = find_token(document.body, "\\begin_layout Conference", i)
if i != -1:
convert_Argument_to_TeX_brace(document, i, 1, 1, False)
i = i + 1
if j != -1:
j = find_token(document.body, "\\begin_layout Author", j)
if j != -1:
convert_Argument_to_TeX_brace(document, j, 1, 2, False)
j = j + 1
if i == -1 and j == -1:
return
def revert_literate(document): def revert_literate(document):
" Revert Literate document to old format " " Revert Literate document to old format "
if del_token(document.header, "noweb", 0): if del_token(document.header, "noweb", 0):
@ -1409,6 +1462,7 @@ def revert_literate(document):
document.body[i] = "\\begin_layout Scrap" document.body[i] = "\\begin_layout Scrap"
i = i + 1 i = i + 1
def convert_literate(document): def convert_literate(document):
" Convert Literate document to new format" " Convert Literate document to new format"
i = find_token(document.header, "\\textclass", 0) i = find_token(document.header, "\\textclass", 0)
@ -1429,6 +1483,7 @@ def convert_literate(document):
document.body[i] = "\\begin_layout Chunk" document.body[i] = "\\begin_layout Chunk"
i = i + 1 i = i + 1
def revert_itemargs(document): def revert_itemargs(document):
" Reverts \\item arguments to TeX-code " " Reverts \\item arguments to TeX-code "
while True: while True:
@ -1446,6 +1501,7 @@ def revert_itemargs(document):
document.body[lastlay + 1:lastlay + 1] = subst document.body[lastlay + 1:lastlay + 1] = subst
i = i + 1 i = i + 1
## ##
# Conversion hub # Conversion hub
# #
@ -1485,7 +1541,7 @@ convert = [
[444, []], [444, []],
[445, []], [445, []],
[446, [convert_latexargs]], [446, [convert_latexargs]],
[447, [convert_IEEEtran, convert_AASTeX, convert_AGUTeX, convert_IJMP]], [447, [convert_IEEEtran, convert_AASTeX, convert_AGUTeX, convert_IJMP, convert_SIGPLAN]],
[448, [convert_literate]], [448, [convert_literate]],
[449, []] [449, []]
] ]
@ -1493,7 +1549,7 @@ convert = [
revert = [ revert = [
[448, [revert_itemargs]], [448, [revert_itemargs]],
[447, [revert_literate]], [447, [revert_literate]],
[446, [revert_IEEEtran, revert_AASTeX, revert_AGUTeX, revert_IJMP]], [446, [revert_IEEEtran, revert_AASTeX, revert_AGUTeX, revert_IJMP, revert_SIGPLAN]],
[445, [revert_latexargs]], [445, [revert_latexargs]],
[444, [revert_uop]], [444, [revert_uop]],
[443, [revert_biolinum]], [443, [revert_biolinum]],

View File

@ -1,5 +1,5 @@
#LyX 2.0 created this file. For more info see http://www.lyx.org/ #LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 413 \lyxformat 449
\begin_document \begin_document
\begin_header \begin_header
\textclass sigplanconf \textclass sigplanconf
@ -13,13 +13,13 @@
\font_roman default \font_roman default
\font_sans default \font_sans default
\font_typewriter default \font_typewriter default
\font_math auto
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts false
\font_sc false \font_sc false
\font_osf false \font_osf false
\font_sf_scale 100 \font_sf_scale 100
\font_tt_scale 100 \font_tt_scale 100
\graphics default \graphics default
\default_output_format default \default_output_format default
\output_sync 0 \output_sync 0
@ -31,15 +31,21 @@
\use_hyperref false \use_hyperref false
\papersize default \papersize default
\use_geometry false \use_geometry false
\use_amsmath 1 \use_package amsmath 1
\use_esint 0 \use_package amssymb 1
\use_mhchem 1 \use_package esint 0
\use_mathdots 1 \use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package undertilde 0
\cite_engine basic \cite_engine basic
\cite_engine_type numerical
\biblio_style plain
\use_bibtopic false \use_bibtopic false
\use_indices false \use_indices false
\paperorientation portrait \paperorientation portrait
\suppress_date false \suppress_date false
\justification true
\use_refstyle 0 \use_refstyle 0
\index Index \index Index
\shortcut idx \shortcut idx
@ -62,7 +68,7 @@
\begin_body \begin_body
\begin_layout Title \begin_layout Standard
\begin_inset Note Note \begin_inset Note Note
status open status open
@ -90,40 +96,16 @@ http://wiki.lyx.org/Examples/AcmSigplan
\end_layout \end_layout
\begin_layout Conference \begin_layout Conference
PLDI 05 \begin_inset Argument 1
\begin_inset ERT status open
status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
PLDI 05
}{
\end_layout \end_layout
\end_inset \end_inset
June 12--15, 2005, Chicago, Illinois, USA. June 12--15, 2005, Chicago, Illinois, USA.
\begin_inset Note Note
status open
\begin_layout Plain Layout
The Conference expects 2 infos that are separated by
\begin_inset Quotes eld
\end_inset
\series bold
}{
\series default
\begin_inset Quotes erd
\end_inset
in TeX code.
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout CopyrightYear \begin_layout CopyrightYear
@ -134,6 +116,34 @@ The Conference expects 2 infos that are separated by
1-59593-057-4/05/0004 1-59593-057-4/05/0004
\end_layout \end_layout
\begin_layout TitleBanner
Banner above paper title
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
is ignored unless document class option 'preprint' is used
\end_layout
\end_inset
\end_layout
\begin_layout PreprintFooter
Short description of paper
\begin_inset Note Note
status collapsed
\begin_layout Plain Layout
is ignored unless document class option 'preprint' is used
\end_layout
\end_inset
\end_layout
\begin_layout Title \begin_layout Title
Example ACM Paper Example ACM Paper
\begin_inset Foot \begin_inset Foot
@ -150,9 +160,23 @@ This work was supported by ...
\begin_layout Subtitle \begin_layout Subtitle
Subtitle Subtitle
\begin_inset Note Note
status open
\begin_layout Plain Layout
optional
\end_layout
\end_inset
\end_layout \end_layout
\begin_layout Author \begin_layout Author
\begin_inset Argument 1
status open
\begin_layout Plain Layout
Suzi Smith Suzi Smith
\begin_inset ERT \begin_inset ERT
status collapsed status collapsed
@ -168,23 +192,16 @@ and
Paul C. Paul C.
Anagnostopoulos Anagnostopoulos
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}{
\end_layout \end_layout
\end_inset \end_inset
Princeton University
\begin_inset ERT \begin_inset Argument 2
status collapsed status open
\begin_layout Plain Layout \begin_layout Plain Layout
Princeton University
}{
\end_layout \end_layout
\end_inset \end_inset
@ -199,19 +216,6 @@ status open
\begin_layout Plain Layout \begin_layout Plain Layout
At least one autor is required. At least one autor is required.
The Author field expects 3 infos that are separated by
\begin_inset Quotes eld
\end_inset
\series bold
}{
\series default
\begin_inset Quotes erd
\end_inset
in TeX code.
\end_layout \end_layout
\end_inset \end_inset
@ -220,17 +224,20 @@ At least one autor is required.
\end_layout \end_layout
\begin_layout Author \begin_layout Author
Fred Flymuffin \begin_inset Argument 1
\begin_inset ERT status open
status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
Fred Flymuffin
}{
\end_layout \end_layout
\end_inset \end_inset
\begin_inset Argument 2
status collapsed
\begin_layout Plain Layout
Washington University in St. Washington University in St.
Louis Louis
\begin_inset Newline newline \begin_inset Newline newline
@ -246,12 +253,6 @@ Department of Electrical and Computer Engineering
St. St.
Louis, XX 60616, USA Louis, XX 60616, USA
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
}{
\end_layout \end_layout
\end_inset \end_inset
@ -287,6 +288,9 @@ ed into hardware]
\end_inset \end_inset
\end_layout
\begin_layout Standard
\begin_inset Note Note \begin_inset Note Note
status open status open
@ -350,7 +354,7 @@ Bla, bla
\end_layout \end_layout
\begin_layout Acknowledgments \begin_layout Acknowledgments
We would like to thank ... Acknowledgments, if needed.
\end_layout \end_layout
\begin_layout Section \begin_layout Section