aastex: update layout and example file

- also fix an issue in the generic lyx2lyx InsetArgument routines
This commit is contained in:
Uwe Stöhr 2012-11-26 03:39:40 +01:00
parent 7725e35439
commit 0c622a5c58
3 changed files with 438 additions and 399 deletions

View File

@ -32,6 +32,7 @@
# Version 1.3 5/7/04 - Updated for AASTeX 5.2
# Version 1.4 26/10/08 - new custom insets for \altaffilmark, \tablenotemark
# - new environments for \altaffiltext and \tablenotetext
# Version 1.5 26/11/12 - added mandatory argument for \altaffiltext
Format 41
@ -294,6 +295,11 @@ Style Altaffilation
Category FrontMatter
ParSkip 0.4
Align Block
Argument 1
Mandatory 1
LabelString "Number"
Tooltip "Consecutive number for the alternative affiliations"
EndArgument
LabelSep xx
LabelType Static
LabelString "Alternative affiliation:"

View File

@ -1193,7 +1193,13 @@ def revert_Argument_to_TeX_brace(document, line, n, nmax, environment):
def revert_IEEEtran(document):
" Reverts InsetArgument to old syntax "
'''
Reverts InsetArgument of
Page headings
Biography
Biography without photo
to TeX-code
'''
i = 0
j = 0
k = 0
@ -1246,7 +1252,8 @@ def convert_Argument_to_TeX_brace(document, line, n, nmax, environment):
lineArg = find_token(document.body, "\\begin_inset ERT", lineArg)
if environment == False and lineArg != -1:
bracePair = find_token(document.body, "}{", lineArg)
if bracePair == lineArg + 5: # assure that the "}{" is in this ERT
# assure that the "}{" is in this ERT (5 is or files saved with LyX 2.0, 4 for files exported by LyX 2.1)
if bracePair == lineArg + 5 or bracePair == lineArg + 4:
end = find_token(document.body, "\\end_inset", bracePair)
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"]
@ -1255,13 +1262,13 @@ def convert_Argument_to_TeX_brace(document, line, n, nmax, environment):
lineArg = lineArg + 1
if environment == True and lineArg != -1:
opening = find_token(document.body, "{", lineArg)
if opening == lineArg + 5: # assure that the "{" is in this ERT
if opening == lineArg + 5 or opening == lineArg + 4: # assure that the "{" is in this ERT
end = find_token(document.body, "\\end_inset", opening)
document.body[lineArg : end + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"]
n = n + 1
lineArg2 = find_token(document.body, "\\begin_inset ERT", lineArg)
closing = find_token(document.body, "}", lineArg2)
if closing == lineArg2 + 5: # assure that the "}" is in this ERT
if closing == lineArg2 + 5 or closing == lineArg2 + 4: # assure that the "}" is in this ERT
end2 = find_token(document.body, "\\end_inset", closing)
document.body[lineArg2 : end2 + 1] = ["\\end_layout", "", "\\end_inset"]
else:
@ -1305,6 +1312,32 @@ def convert_IEEEtran(document):
return
def revert_AASTeX(document):
" Reverts InsetArgument of Altaffilation to TeX-code "
i = 0
while True:
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)
i = i + 1
if i == -1:
return
def convert_AASTeX(document):
" Converts ERT of Altaffilation to InsetArgument "
i = 0
while True:
if i != -1:
i = find_token(document.body, "\\begin_layout Altaffilation", i)
if i != -1:
convert_Argument_to_TeX_brace(document, i, 1, 1, False)
i = i + 1
if i == -1:
return
##
# Conversion hub
#
@ -1344,11 +1377,11 @@ convert = [
[444, []],
[445, []],
[446, [convert_latexargs]],
[447, [convert_IEEEtran]]
[447, [convert_IEEEtran, convert_AASTeX]]
]
revert = [
[446, [revert_IEEEtran]],
[446, [revert_IEEEtran, revert_AASTeX]],
[445, [revert_latexargs]],
[444, [revert_uop]],
[443, [revert_biolinum]],

View File

@ -1,5 +1,5 @@
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 447
\begin_document
\begin_header
\textclass aastex
@ -17,13 +17,13 @@
\font_roman default
\font_sans default
\font_typewriter default
\font_math auto
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
@ -34,15 +34,21 @@
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 0
\use_esint 0
\use_mhchem 1
\use_mathdots 1
\cite_engine natbib_authoryear
\use_package amsmath 0
\use_package amssymb 0
\use_package esint 0
\use_package mathdots 1
\use_package mathtools 0
\use_package mhchem 1
\use_package undertilde 0
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plainnat
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\index Index
\shortcut idx
@ -132,13 +138,11 @@ status collapsed
\end_layout
\begin_layout Altaffilation
1
\begin_inset ERT
status collapsed
\begin_inset Argument 1
status open
\begin_layout Plain Layout
}{
1
\end_layout
\end_inset
@ -147,13 +151,11 @@ Visiting Astronomer, etc.
\end_layout
\begin_layout Altaffilation
2
\begin_inset ERT
status collapsed
\begin_inset Argument 1
status open
\begin_layout Plain Layout
}{
2
\end_layout
\end_inset
@ -162,13 +164,11 @@ Current Address, etc.
\end_layout
\begin_layout Altaffilation
3
\begin_inset ERT
status collapsed
\begin_inset Argument 1
status open
\begin_layout Plain Layout
}{
3
\end_layout
\end_inset