From 77519a0331fff359fc01e88ee690c4a166dc2254 Mon Sep 17 00:00:00 2001 From: Charilaos Skiadas Date: Sat, 25 Aug 2007 13:40:32 +0000 Subject: [PATCH] Added support for the Beamer environments "overlayarea" and "overprint" in the form of environment triggers. Also added trigger support for the Beamer commands "onslide", "visible", "uncover" and "alert". See Support/latex.config for details. Also modified the "Insert item" command to have a default behavior for overlayarea and overprint environments. git-svn-id: http://svn.textmate.org/trunk/Bundles/Latex.tmbundle@8025 dfb7d73b-c2ec-0310-8fea-fb051d288c6d --- ...rt Item Based on Current Environment.plist | 2 +- Support/latex.config | 27 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Commands/Insert Item Based on Current Environment.plist b/Commands/Insert Item Based on Current Environment.plist index 715e9905..ef929e24 100644 --- a/Commands/Insert Item Based on Current Environment.plist +++ b/Commands/Insert Item Based on Current Environment.plist @@ -19,7 +19,7 @@ myStr << textArray[linesbefore].slice(0..columns-1) theArray = Array.new theRegexp = Regexp.new('(\\\begin\{|\\\end\{)(\w+[*]?)(\})') toInsertNoBeamer = { "itemize" => "\\item $1", "enumerate" => "\\item $1", "description" => "\\item[${1:label}] ${2:description}", "parts" => "\\part $1", "questions" => "\\question $1" } -toInsertBeamer = { "itemize" => "\\item<${1:+-}> $2", "enumerate" => "\\item<${1:+-}> $2", "description" => "\\item<+->[${1:label}] ${2:description}" } +toInsertBeamer = { "itemize" => "\\item<${1:+-}> $2", "enumerate" => "\\item<${1:+-}> $2", "description" => "\\item<+->[${1:label}] ${2:description}", "overprint" => "\\onslide<${1:+}>\n\t$2", "overlayarea" => "\\only<${1:+}> $2" } toInsert = /beamer/.match(ENV['TM_SCOPE'].to_s) ? toInsertBeamer : toInsertNoBeamer results = myStr.scan(theRegexp) if (results) diff --git a/Support/latex.config b/Support/latex.config index 0eac26f5..c2aa760b 100644 --- a/Support/latex.config +++ b/Support/latex.config @@ -52,8 +52,19 @@ un = "\\uncover<${1:+-}>{$2} "; uncover = "\\uncover<${1:+-}>{$2} "; o = "\\only<${1:+-}>{$2} "; + on = "\\only<${1:+-}>{$2} "; only = "\\only<${1:+-}>{$2} "; - + os = "\\onslide<${1:+-}>{$2} "; + ons = "\\onslide<${1:+-}>{$2} "; + onslide = "\\onslide<${1:+-}>{$2} "; + un = "\\uncover<${1:+-}>{$2} "; + uncover = "\\uncover<${1:+-}>{$2} "; + a = "\\alert<${1:+-}>{$2} "; + al = "\\alert<${1:+-}>{$2} "; + alert = "\\alert<${1:+-}>{$2} "; + v = "\\visible<${1:+-}>{$2} "; + vis = "\\visible<${1:+-}>{$2} "; + visible = "\\visible<${1:+-}>{$2} "; }; environments = { itemize = { @@ -167,20 +178,28 @@ $3 \\end{column}"; }; + overprint = { + triggers = (op, overprint ); + content = "\\onslide<${1:+}>\n\t$0"; + }; }; labeled_environments_beamer = { frame = { - triggers = ( fr, frame); + triggers = ( fr, frame ); content = "[${1:t}]\\frametitle{${2:title}}\n\t$0"; }; column = { - triggers = ( col, column); + triggers = ( col, column ); content = "{${1:0.${2:5}\\textwidth}}\n\t$0"; }; block = { - triggers = ( bl, block); + triggers = ( bl, block ); zero_line = "{$1}\n\t$0"; }; + overlayarea = { + triggers = ( oa, overlayarea ); + content = "{${1:areawidth}}{${2:areaheight}}\n\t\\only<${3:+}> $0"; + }; }; // Thanks to Piero D'Ancona for the symbols dictionary