lyx_mirror/autotests/mathmacros/testcases_environments.lyx

1329 lines
17 KiB
Plaintext
Raw Permalink Normal View History

#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 572
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass amsart
\use_default_options false
\begin_modules
theorems-ams
eqs-within-sections
figs-within-sections
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding auto
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\branch Branch1
\selected 1
\filename_suffix 0
\color #fa8a00
\end_branch
\branch Branch2
\selected 0
\filename_suffix 0
\color #00fabc
\end_branch
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tablestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Macro Scopes
\end_layout
\begin_layout Section
Simple
\end_layout
\begin_layout Standard
\begin_inset Formula
\[
\backslash foo\mbox{ should be }\backslash foo
\]
\end_inset
\end_layout
\begin_layout Standard
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\newcommand{\foo}{A}
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Formula
\[
\foo\mbox{ should be }A
\]
\end_inset
\end_layout
\begin_layout Section
Redefinition
\end_layout
\begin_layout Standard
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{B}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula
\[
B\mbox{ should be }B
\]
\end_inset
\end_layout
\begin_layout Section
In Paragraph Redefinition
\end_layout
\begin_layout Standard
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{C}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }C$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{D}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }D$
\end_inset
\end_layout
\begin_layout Section
Environment
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
\begin_inset Formula $\foo\mbox{ should be }D$
\end_inset
\end_layout
\begin_layout Section
Environment local Definitions
\end_layout
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{E}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }E$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{F}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }F$
\end_inset
\end_layout
\end_inset
\begin_inset Formula $\foo\mbox{ should be }D$
\end_inset
.
\end_layout
\begin_layout Section
Definitions in Paragraph Style Environments
\end_layout
\begin_layout Abstract
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{G}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }G$
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }G$
\end_inset
.
\end_layout
\begin_layout Itemize
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{H}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }H$
\end_inset
\end_layout
\begin_layout Itemize
\begin_inset Formula $H\mbox{ should be }H$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{H2}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }H2$
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }H2$
\end_inset
\end_layout
\begin_layout Section
Theorem and Proofs
\end_layout
\begin_layout Theorem
\begin_inset Formula $1=0$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{I}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }I$
\end_inset
\end_layout
\begin_layout Proof
Because
\begin_inset Formula $2=1$
\end_inset
.
\begin_inset Formula $\foo\mbox{ should be }I$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{J}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }J$
\end_inset
.
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{K}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }K$
\end_inset
\end_layout
\begin_layout Proof
Blub
\begin_inset Formula $\foo\mbox{ should be }K$
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }K$
\end_inset
.
\end_layout
\begin_layout Section
Tables
\end_layout
\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="2">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $\foo\mbox{ should be }K$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
bla
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{L}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $L\mbox{ should be }L$
\end_inset
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
\begin_layout Section
Depth and nested Paragraphs
\end_layout
\begin_layout Definition
Let
\begin_inset Formula $x$
\end_inset
be
\begin_inset Formula $1$
\end_inset
.
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{M}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }M$
\end_inset
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }M$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{N}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }N$
\end_inset
\end_layout
\end_deeper
\begin_layout Definition
And furthermore let
\begin_inset Formula $y$
\end_inset
be
\begin_inset Formula $2$
\end_inset
.
\begin_inset Formula $\foo\mbox{ should be }N$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{O}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }O$
\end_inset
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
Let
\begin_inset Formula $z$
\end_inset
be
\begin_inset Formula $3$
\end_inset
.
\begin_inset Formula $\foo\mbox{ should be }O$
\end_inset
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{P}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }P$
\end_inset
\end_layout
\end_deeper
\begin_layout Definition
Still definition:
\begin_inset Formula $\foo\mbox{ should be }P$
\end_inset
.
\end_layout
\begin_layout Standard
And outside the definition:
\begin_inset Formula $\foo\mbox{ should be }P$
\end_inset
.
\end_layout
\begin_layout Section
Branch
\end_layout
\begin_layout Standard
\begin_inset Branch Branch1
inverted 0
status open
\begin_layout Standard
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{Q}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }Q$
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }Q\mbox{ if Branch1 is selected}$
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Branch Branch2
inverted 0
status open
\begin_layout Standard
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{R}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }R$
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Formula $\foo\mbox{ should be }Q\mbox{ if Branch2 is deselected}$
\end_inset
\end_layout
\begin_layout Section
Macros in non-environment blocks
\end_layout
\begin_layout Standard
\series bold
Some bold font block:
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{R}
\end_inset
\family default
\series bold
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }R$
\end_inset
\end_layout
\begin_layout Standard
Now normal again:
\begin_inset Formula $\foo\mbox{ should be }R$
\end_inset
\end_layout
\begin_layout Standard
\series bold
Some bold font block where the macro itself is not bold:
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{S}
\end_inset
\family default
\series bold
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }S$
\end_inset
\end_layout
\begin_layout Standard
Now normal again:
\begin_inset Formula $\foo\mbox{ should be }S$
\end_inset
\end_layout
\begin_layout Standard
Some
\series bold
bold font block not starting at the paragraph start:
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{T}
\end_inset
\family default
\series bold
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }T$
\end_inset
Some tail text.
\end_layout
\begin_layout Standard
Some
\series bold
bold font block not starting at the paragraph start:
\begin_inset Formula $\foo\mbox{ should be }T$
\end_inset
.
Some tail text.
\end_layout
\begin_layout Standard
Some
\series bold
bold font block with an
\begin_inset Note Comment
status open
\begin_layout Plain Layout
\series bold
note
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{U}
\end_inset
\family default
\series bold
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
inset
\end_layout
\end_inset
in between.
\end_layout
\begin_layout Standard
Some
\series bold
bold font block with an
\begin_inset Note Comment
status open
\begin_layout Plain Layout
note inset
\end_layout
\end_inset
in between.
\end_layout
\begin_layout Section
InsetTexts
\end_layout
\begin_layout Standard
Float:
\begin_inset Float figure
placement document
alignment document
wide false
sideways false
status open
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{V}
\end_inset
\begin_inset Formula $\foo\mbox{ should be }V$
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset Formula $\foo\mbox{ should be }V$
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset Formula $\foo\mbox{ should be }V$
\end_inset
\end_layout
\begin_layout Standard
\SpecialChar LyX
-Note:
\begin_inset Note Note
status open
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{X}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }X$
\end_inset
\end_layout
\end_inset
\begin_inset Formula $\foo\mbox{ should be }V$
\end_inset
\end_layout
\begin_layout Standard
Comment:
\begin_inset Note Comment
status open
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{Y}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }Y$
\end_inset
\end_layout
\end_inset
\begin_inset Formula $\foo\mbox{ should be }Y$
\end_inset
\end_layout
\begin_layout Standard
Greyed out:
\begin_inset Note Greyedout
status open
\begin_layout Plain Layout
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
\color none
\begin_inset FormulaMacro
\renewcommand{\foo}{Z}
\end_inset
\family default
\series default
\shape default
\size default
\emph default
\bar default
\noun default
\color inherit
\begin_inset Formula $\foo\mbox{ should be }Z$
\end_inset
\end_layout
\end_inset
\begin_inset Formula $\foo\mbox{ should be }Z$
\end_inset
\end_layout
\end_body
\end_document