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

View File

@ -1193,7 +1193,13 @@ def revert_Argument_to_TeX_brace(document, line, n, nmax, environment):
def revert_IEEEtran(document): def revert_IEEEtran(document):
" Reverts InsetArgument to old syntax " '''
Reverts InsetArgument of
Page headings
Biography
Biography without photo
to TeX-code
'''
i = 0 i = 0
j = 0 j = 0
k = 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) lineArg = find_token(document.body, "\\begin_inset ERT", lineArg)
if environment == False and lineArg != -1: if environment == False and lineArg != -1:
bracePair = find_token(document.body, "}{", lineArg) 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) 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"] 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 lineArg = lineArg + 1
if environment == True and lineArg != -1: if environment == True and lineArg != -1:
opening = find_token(document.body, "{", lineArg) 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) end = find_token(document.body, "\\end_inset", opening)
document.body[lineArg : end + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"] document.body[lineArg : end + 1] = ["\\begin_inset Argument " + str(n), "status open", "", "\\begin_layout Plain Layout"]
n = n + 1 n = n + 1
lineArg2 = find_token(document.body, "\\begin_inset ERT", lineArg) lineArg2 = find_token(document.body, "\\begin_inset ERT", lineArg)
closing = find_token(document.body, "}", lineArg2) 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) end2 = find_token(document.body, "\\end_inset", closing)
document.body[lineArg2 : end2 + 1] = ["\\end_layout", "", "\\end_inset"] document.body[lineArg2 : end2 + 1] = ["\\end_layout", "", "\\end_inset"]
else: else:
@ -1305,6 +1312,32 @@ def convert_IEEEtran(document):
return 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 # Conversion hub
# #
@ -1344,11 +1377,11 @@ convert = [
[444, []], [444, []],
[445, []], [445, []],
[446, [convert_latexargs]], [446, [convert_latexargs]],
[447, [convert_IEEEtran]] [447, [convert_IEEEtran, convert_AASTeX]]
] ]
revert = [ revert = [
[446, [revert_IEEEtran]], [446, [revert_IEEEtran, revert_AASTeX]],
[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 447
\begin_document \begin_document
\begin_header \begin_header
\textclass aastex \textclass aastex
@ -17,13 +17,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
@ -34,15 +34,21 @@
\use_hyperref false \use_hyperref false
\papersize default \papersize default
\use_geometry false \use_geometry false
\use_amsmath 0 \use_package amsmath 0
\use_esint 0 \use_package amssymb 0
\use_mhchem 1 \use_package esint 0
\use_mathdots 1 \use_package mathdots 1
\cite_engine natbib_authoryear \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_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
@ -132,13 +138,11 @@ status collapsed
\end_layout \end_layout
\begin_layout Altaffilation \begin_layout Altaffilation
1 \begin_inset Argument 1
\begin_inset ERT status open
status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
1
}{
\end_layout \end_layout
\end_inset \end_inset
@ -147,13 +151,11 @@ Visiting Astronomer, etc.
\end_layout \end_layout
\begin_layout Altaffilation \begin_layout Altaffilation
2 \begin_inset Argument 1
\begin_inset ERT status open
status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
2
}{
\end_layout \end_layout
\end_inset \end_inset
@ -162,13 +164,11 @@ Current Address, etc.
\end_layout \end_layout
\begin_layout Altaffilation \begin_layout Altaffilation
3 \begin_inset Argument 1
\begin_inset ERT status open
status collapsed
\begin_layout Plain Layout \begin_layout Plain Layout
3
}{
\end_layout \end_layout
\end_inset \end_inset