Skip to content

Commit

Permalink
Added support for the Beamer environments "overlayarea" and "overprin…
Browse files Browse the repository at this point in the history
…t" 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
  • Loading branch information
Charilaos Skiadas committed Aug 25, 2007
1 parent e199a87 commit 77519a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Commands/Insert Item Based on Current Environment.plist
Expand Up @@ -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)
Expand Down
27 changes: 23 additions & 4 deletions Support/latex.config
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 77519a0

Please sign in to comment.