diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 00:44:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 00:44:40 +0000 |
commit | b4fc5f639874db951177ec539299d20908adb654 (patch) | |
tree | 52f08823ca58fffe3db6a9b075635038c567626c /Master/texmf-dist/doc/latex/maybemath | |
parent | dec3d98ebe442d7ea93efbaa8dd2e2be8149a467 (diff) |
doc 4
git-svn-id: svn://tug.org/texlive/trunk@80 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/maybemath')
-rw-r--r-- | Master/texmf-dist/doc/latex/maybemath/README | 25 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/maybemath/maybemath.pdf | bin | 0 -> 69595 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/maybemath/maybemath.tex | 98 |
3 files changed, 123 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/maybemath/README b/Master/texmf-dist/doc/latex/maybemath/README new file mode 100644 index 00000000000..cd3cb9857c1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/maybemath/README @@ -0,0 +1,25 @@ +maybemath LaTeX style, by Andy Buckley <andy@insectnation.org> +-------------------------------------------------------------- + +maybemath provides LaTeX macros for making math bold or italic according to +context. + +The \maybebm and \maybeit macros can be used in math expressions to make +the arguments typeset as bold or italic respectively if the surrounding +context is appropriate. They are useful for writing user macros for use +in general contexts. + +\maybebm is especially appropriate when section titles contain math +expressions, since the title will appear bold but the header and table +of contents usually replicate the title in normal width. + +\maybeit performs a similar role to \mathrm{} but the math expression will +be italicised if the surrounding text is. \maybeitsubscript is provided to +shift subscripts to the left if the expression is italicised. + +Thanks to Viet-Trung Luu on comp.text.tex for providing the first steps +to solving this problem. + +This material is subject to the LaTeX Project Public License. +See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for +the details of that license.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/maybemath/maybemath.pdf b/Master/texmf-dist/doc/latex/maybemath/maybemath.pdf Binary files differnew file mode 100644 index 00000000000..992de0a3420 --- /dev/null +++ b/Master/texmf-dist/doc/latex/maybemath/maybemath.pdf diff --git a/Master/texmf-dist/doc/latex/maybemath/maybemath.tex b/Master/texmf-dist/doc/latex/maybemath/maybemath.tex new file mode 100644 index 00000000000..54e7852c33b --- /dev/null +++ b/Master/texmf-dist/doc/latex/maybemath/maybemath.tex @@ -0,0 +1,98 @@ +\documentclass[12pt]{article} +%\usepackage{setspace} +%\usepackage{booktabs} +\usepackage{maybemath, xspace} +\newcommand{\maybemath}{\texttt{maybemath}\xspace} + +\author{Andy Buckley, \texttt{andy@insectnation.org}} +\title{The \maybemath package for \LaTeX} + +\newcommand{\manifestsAs}{\ensuremath{\Rightarrow\quad}\xspace} +\newcommand{\texcommand}[1]{\texttt{\ensuremath{\backslash{}}{#1}}\xspace} +\newcommand{\texarg}[1]{\ensuremath{\!}\texttt{\{}\textit{#1}\texttt{\}}\xspace} +\newcommand{\maybebmName}{\texcommand{maybebm}} +\newcommand{\maybermName}{\texcommand{mayberm}} +\newcommand{\maybeitName}{\texcommand{maybeit}} +\newcommand{\maybeitrmName}{\texcommand{maybeitrm}} +\newcommand{\maybeitsubscriptName}{\texcommand{maybeitsubscript}} +\newcommand{\maybesfName}{\texcommand{maybesf}} +\newcommand{\maybebmsfName}{\texcommand{maybebmsf}} +\newcommand{\maybemathName}{\texcommand{maybemath}} + +\begin{document} +\maketitle + +The \maybemath package provides a set of commands for adjusting math-mode +typesetting to match the context of the surrounding paragraph. This includes +making the math-mode text bold, upright, forced italic or sans-serif according +to context, or any combination of these. It can be particularly useful when math +terms must appear in section headings, as this implies the same expression +appearing in several boldness contexts: the heading itself, the table of +contents and perhaps a page header or footer. Typically this has been resolved +manually by use of the optional second argument of the sectioning commands: +\maybemath provides a more seamless solution. + +This package was developed in order to implement the \texttt{hepparticles} +package, used for typesetting high-energy physics particle names. +% The commands are intended more for use in flexible macro definitions than +% for direct use in documents, hence the command names are quite verbose. + +The commands available are defined below. In general they may be nested and can +take arbitrarily large arguments within a single math expression. The term to +watch in the expressions below is the $x^3$: + +\section{Bold contexts} +\begin{itemize} +\item For context-sensitive boldness use \maybebmName\texarg{expr}:\\ + {\verb|\dots foo bar, $x^2 + \maybebm{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \maybebm{x^3} + \dotsb$}\\ + {\verb|\textbf{\dots foo bar, $x^2 + \maybebm{x^3} + \dotsb$}|}\\ \manifestsAs \textbf{\dots foo bar, $x^2 + \maybebm{x^3} + \dotsb$} +\end{itemize} + + +\section{Upright and italic contexts} +\begin{itemize} +\item For context-sensitive upright math typesetting use \maybermName\texarg{expr}:\\ + {\verb|\dots foo bar, $x^2 + \mayberm{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \mayberm{x^3} + \dotsb$}\\ + {\verb|\textit{\dots foo bar, $x^2 + \mayberm{x^3} + \dotsb$}|}\\ \manifestsAs \textit{\dots foo bar, $x^2 + \mayberm{x^3} + \dotsb$} + +\item Alternatively, to force \texcommand{mathit} in italic contexts use \maybeitName\texarg{expr}:\\ + {\verb|\dots foo bar, $x^2 + \maybeit{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \maybeit{x^3} + \dotsb$}\\ + {\verb|\textit{\dots foo bar, $x^2 + \maybeit{x^3} + \dotsb$}|}\\ \manifestsAs \textit{\dots foo bar, $x^2 + \maybeit{x^3} + \dotsb$} + +\item The functionality of both \maybermName and \maybeitName is combined for convenience in the command \maybeitrmName\texarg{expr}:\\ + {\verb|\dots foo bar, $x^2 + \maybeitrm{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \maybeitrm{x^3} + \dotsb$}\\ + {\verb|\textit{\dots foo bar, $x^2 + \maybeitrm{x^3} + \dotsb$}|}\\ \manifestsAs \textit{\dots foo bar, $x^2 + \maybeitrm{x^3} + \dotsb$} + +\item An extra command is available for adjusting the spacing of subscripts in italic contexts: they are shifted + to the left if wrapped with the command \maybeitsubscriptName\texarg{expr}:\\ + {\verb|\dots foo bar, $\mayberm{B_d^0} \to \|\\\verb|\mayberm{B_\maybeitsubscript{d}^0}$|}\\ \manifestsAs {\dots foo bar, $\mayberm{B_d^0} \to \mayberm{B_\maybeitsubscript{d}^0}$}\\ + {\verb|\textit{\dots foo bar, $\mayberm{B_d^0} \to \|\\\verb|\mayberm{B_\maybeitsubscript{d}^0}$}|}\\ \manifestsAs \textit{\dots foo bar, $\mayberm{B_d^0} \to \mayberm{B_\maybeitsubscript{d}^0}$}\\ + I'm not aware if there are particular uses for this outside the pickinesses of particle-name typesetting but it \emph{may} be useful! +\end{itemize} + + +\section{Sans-serif contexts} +\begin{itemize} +\item For context-sensitive sans-serif math typesetting use \maybesfName\texarg{expr}:\\ + {\verb|\dots foo bar, $x^2 + \maybesf{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \maybesf{x^3} + \dotsb$}\\ + {\verb|\textsf{\dots foo bar, $x^2 + \maybesf{x^3} + \dotsb$}|}\\ \manifestsAs \textsf{\dots foo bar, $x^2 + \maybesf{x^3} + \dotsb$}\\ + Note that there is no italic version of the sans-serif math font, so use of \maybesfName eliminates italic context handling. +\end{itemize} + + +\section{Combined contexts} +\begin{itemize} +\item For combined bold-and-sans-serif context handling, a \maybebmsfName\texarg{expr} command is provided:\\ + {\verb|\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$|}\\ \manifestsAs {\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}\\ + {\verb|\textbf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}|}\\ \manifestsAs \textbf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}\\ + {\verb|\textsf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}|}\\ \manifestsAs \textsf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}\\ + {\verb|\textbf{\textsf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}}|}\\ \manifestsAs \textbf{\textsf{\dots foo bar, $x^2 + \maybebmsf{x^3} + \dotsb$}}\\ + This is assumed to be the most commonly required combination of context-sensitive math typesetting: most other combinations can be achieved by nesting the primitive \maybemath commands. +\end{itemize} + +%Finally, a \maybemathName command is provided for typesetting the name of the package: +%{\verb|\maybemath|} \manifestsAs \maybemath.\\ + +\noindent Any feedback is appreciated! Email to \texttt{andy@insectnation.org}, please. + +\end{document}
\ No newline at end of file |