summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/amsrefs/textcmds.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-10-27 18:02:18 +0000
committerKarl Berry <karl@freefriends.org>2007-10-27 18:02:18 +0000
commit505de24edcee818a831aeed0f94137cd0537e36d (patch)
tree01dcd81d839bf8e6e7f3ae4b29b0e0baa0b82273 /Master/texmf-dist/tex/latex/amsrefs/textcmds.sty
parent4c1269d4c5953786fff1af6ed5c07fc595e91fa3 (diff)
amsrefs update from latex-tds (26oct07)
git-svn-id: svn://tug.org/texlive/trunk@5285 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/amsrefs/textcmds.sty')
-rw-r--r--Master/texmf-dist/tex/latex/amsrefs/textcmds.sty130
1 files changed, 130 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/amsrefs/textcmds.sty b/Master/texmf-dist/tex/latex/amsrefs/textcmds.sty
new file mode 100644
index 00000000000..28214f4c7e7
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/amsrefs/textcmds.sty
@@ -0,0 +1,130 @@
+%%
+%% This is file `textcmds.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% textcmds.dtx (with options: `pkg')
+%%
+%%% ====================================================================
+%%% @LaTeX-doc-source-file{
+%%% filename = "textcmds.dtx",
+%%% version = "1.06",
+%%% date = "2007/10/19",
+%%% time = "14:12:53 EDT",
+%%% author = "Michael J Downes",
+%%% address = "American Mathematical Society,
+%%% Publications Technical Group,
+%%% PO Box 6248,
+%%% Providence, RI 02940,
+%%% USA",
+%%% email = "tech-support@ams.org",
+%%% URL = "http://www.ams.org/",
+%%% abstract = "Short forms for textemdash and the other LaTeX
+%%% commands that correspond to ligatures of
+%%% convenience.",
+%%% copyright = "Copyright 2001 American Mathematical Society.",
+%%% license = "Unlimited copying and redistribution of this file
+%%% are permitted as long as this file is not
+%%% modified. Modifications, and distribution of
+%%% modified versions, are permitted, but only if
+%%% the resulting file is renamed.",
+%%% checksum = "63388 295 1197 10750",
+%%% docstring = "The checksum field, produced by Robert Solovay's
+%%% checksum utility, gives CRC-16 checksum, lines,
+%%% words, and characters.",
+%%% }
+%%% ====================================================================
+\ProvidesPackage{textcmds}[2007/10/19 v1.06]
+\providecommand{\mdash}{\textemdash\penalty\exhyphenpenalty}
+\providecommand{\ndash}{\textendash\penalty\exhyphenpenalty}
+\newcommand{\qd}{\textquestiondown}
+\newcommand{\xd}{\textexclamdown}
+\newcommand{\ldq}{\textquotedblleft}
+\newcommand{\rdq}{\textquotedblright}
+\newcommand{\lsq}{\textquoteleft}
+\newcommand{\rsq}{\textquoteright}
+\newcommand{\bul}{\textbullet}%
+\newcommand{\vsp}{\textvisiblespace}%
+\newcommand{\pdc}{\textperiodcentered}%
+\newcommand{\vrt}{\textbar}%
+\newcommand{\cir}{\textasciicircum}%
+\newcommand{\til}{\textasciitilde}%
+\newcommand{\bsl}{\textbackslash}%
+\newcommand{\cwm}{\textcompwordmark}%
+\providecommand{\qq}[1]{\ldq#1\/\rdq}
+\providecommand{\q}[1]{\lq#1\/\rq}
+\newcommand{\supsize}{%
+ \expandafter\ifx\csname S@\f@size\endcsname\relax
+ \calculate@math@sizes
+ \fi
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\selectfont
+}
+\DeclareRobustCommand{\tsup}[1]{%
+ \leavevmode\raise.9ex\hbox{\supsize #1}%
+}
+\DeclareRobustCommand{\tsub}[1]{%
+ \leavevmode\lower.6ex\hbox{\supsize #1}%
+}
+\DeclareTextSymbolDefault{\textprimechar}{OMS}
+\DeclareTextSymbol{\textprimechar}{OMS}{48}
+\DeclareRobustCommand{\tprime}{\tsup{\textprimechar}}
+\@ifundefined{textlangle}{%
+ \DeclareTextSymbolDefault{\textlangle}{OMS}
+ \DeclareTextSymbolDefault{\textrangle}{OMS}
+}{}
+\DeclareTextSymbol{\textlangle}{OMS}{"68}
+\DeclareTextSymbol{\textrangle}{OMS}{"69}
+\DeclareRobustCommand{\lara}[1]{\textlangle#1\/\textrangle}
+\csname endinput\endcsname
+<*emacs>
+(defvar latex-ndash-command "\\ndash"
+ "*String to insert for an n-dash in LaTeX mode.")
+
+(defvar latex-mdash-command "\\mdash"
+ "*String to insert for an m-dash in LaTeX mode.")
+
+(defvar latex-quote-command "\\qq"
+ "*String to insert for quotes in LaTeX mode.")
+
+(defun latex-maybe-start-quotes (arg)
+ "Insert the beginning of a \\qq{...} structure if the preceding char is
+a left quote."
+ (interactive "*p")
+ (if (= (preceding-char) ?\`)
+ (progn
+ (delete-backward-char 1)
+ (insert-and-inherit (concat latex-quote-command "\{")))
+ (self-insert-command arg)))
+
+(defun latex-maybe-end-quotes (arg)
+ "Insert the end of a \\qq{...} structure if appropriate."
+ (interactive "*p")
+ (if (= (preceding-char) ?\')
+ (progn
+ (delete-backward-char 1)
+ (insert-and-inherit "\}"))
+ (self-insert-command arg)))
+
+(defun latex-maybe-dash (arg)
+ "Convert two or three hyphens to \\mdash or \\ndash."
+ (interactive "*p")
+ (cond
+ ((re-search-backward
+ (concat (regexp-quote latex-ndash-command) " *\\=") nil t)
+ (replace-match (concat (regexp-quote latex-mdash-command) " ")))
+ ((= (preceding-char) ?-)
+ (delete-backward-char 1)
+ (insert-and-inherit (concat latex-ndash-command " ")))
+ (t (self-insert-command arg))))
+
+(add-hook 'TeX-mode-hook
+ '(lambda
+ (define-key LaTeX-mode-map "\`" 'latex-maybe-start-quotes)
+ (define-key LaTeX-mode-map "\'" 'latex-maybe-end-quotes)
+ (define-key LaTeX-mode-map "-" 'latex-maybe-dash)))
+</emacs>
+\endinput
+%%
+%% End of file `textcmds.sty'.