From 0b183d0343504df0fbdb0b634e8b6f30adcc2602 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 20 Nov 2010 00:06:03 +0000 Subject: new latex package acroterm 0.1 (20nov10) git-svn-id: svn://tug.org/texlive/trunk@20498 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/acroterm/acroterm.sty | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/acroterm/acroterm.sty (limited to 'Master/texmf-dist/tex/latex/acroterm') diff --git a/Master/texmf-dist/tex/latex/acroterm/acroterm.sty b/Master/texmf-dist/tex/latex/acroterm/acroterm.sty new file mode 100644 index 00000000000..b0f258a2e89 --- /dev/null +++ b/Master/texmf-dist/tex/latex/acroterm/acroterm.sty @@ -0,0 +1,88 @@ +%% +%% This is file `acroterm.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% acroterm.dtx (with options: `package') +%% +%% The Acroterm package +%% +%% Copyright (C) 2010 by Jakob Voss +%% +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) +%% by Jakob Voss. +%% +%% This work consists of the file acroterm.dtx +%% and the derived files acroterm.sty, +%% acroterm.ins, and +%% acroterm.pdf. +%% +\ProvidesPackage{acroterm} + [2010/11/19 v0.1 Manage and index acronyms and terms] +\RequirePackage{splitidx}[2009/02/18 v1.1a] +\RequirePackage{xifthen} +\newcommand{\Acrostyle}[1]{#1} +\newcommand{\acrostyle}[1]{\textsc{\lowercase{#1}}} +\newcommand{\termstyle}[1]{#1} +\newcommand{\Termstyle}[1]{\textit{#1}} +\newcommand{\tacrostyle}[2]{\termstyle{#1} (\acrostyle{#2})} +\newcommand{\Tacrostyle}[2]{\Termstyle{#1} (\acrostyle{#2})} +\newcommand{\atermstyle}[2]{\acrostyle{#1} (\termstyle{#2})} +\newcommand{\Atermstyle}[2]{\acrostyle{#1} (\termstyle{#2})} +\newcommand{\acroindexstyle}[1]{#1\acroexpand[ --- ]{#1}} +\newcommand{\provideacronym}[2]{% TODO: detect redefinitions + \expandafter\providecommand\expandafter{% + \csname acronymlong#1\endcsname}{#2}% +} +\newcommand{\bfhref}[1]{\textbf{\hyperpage{#1}}} +\newcommand{\acro@define}[2]{% #1: long term, #2: acronym + \sindex[idx]{#1|see{\acrostyle{#2}}}% TODO: acronyms in general index? + \@ifundefined{acronymlong#2}{% + \provideacronym{#2}{#1}}{}% + \sindex[acronym]{#2@\acroindexstyle{#2}|bfhref}% +} + +\newcommand{\acroexpand}[2][]{% + \@ifundefined{acronymlong#2}{}{% + #1\csname acronymlong#2\endcsname}% +} +\newcommand{\term}[2][]{% + \ifthenelse{\isempty{#1}}% + {\sindex[idx]{#2}}{\sindex[idx]{#1}}% + \termstyle{#2}} +\newcommand\Term[2][]{% + \ifthenelse{\isempty{#1}}% + {\sindex[idx]{#2|bfhref}}% + {\sindex[idx]{#1|bfhref}}% + \Termstyle{#2}% +} +\newcommand{\acro}[1]{% + \acrostyle{#1}% + {\sindex[acronym]{#1@\acroindexstyle{#1}}}% +} +\newcommand{\Acro}[1]{% + \Acrostyle{#1}% + {\sindex[acronym]{#1@\acroindexstyle{#1}}}% +} +\newcommand{\tacro}[3][]{% + \ifthenelse{\isempty{#1}}% + {\acro@define{#2}{#3}}{\acro@define{#1}{#3}}% TODO: not define? + \tacrostyle{#2}{#3}} +\newcommand{\Tacro}[3][]{% + \ifthenelse{\isempty{#1}}% + {\acro@define{#2}{#3}}{\acro@define{#1}{#3}}% + \Tacrostyle{#2}{#3}} +\newcommand{\aterm}[2]{% + \acro@define{#2}{#1}% TODO: not define but only use? + \atermstyle{#1}{#2}} +\newcommand{\Aterm}[2]{% + \acro@define{#2}{#1}% + \Atermstyle{#1}{#2}} +\endinput +%% +%% End of file `acroterm.sty'. -- cgit v1.2.3