diff options
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/asmeconf/README.md | 58 | ||||
-rw-r--r-- | macros/latex/contrib/asmeconf/asmeconf-sample.bib | 194 | ||||
-rw-r--r-- | macros/latex/contrib/asmeconf/asmeconf-template.pdf | bin | 548197 -> 588137 bytes | |||
-rw-r--r-- | macros/latex/contrib/asmeconf/asmeconf-template.tex | 71 | ||||
-rw-r--r-- | macros/latex/contrib/asmeconf/asmeconf.cls | 63 | ||||
-rw-r--r-- | macros/latex/contrib/rmathbr/README | 4 | ||||
-rw-r--r-- | macros/latex/contrib/rmathbr/rmathbr.dtx | 1542 | ||||
-rw-r--r-- | macros/latex/contrib/rmathbr/rmathbr.ins | 8 | ||||
-rw-r--r-- | macros/latex/contrib/rmathbr/rmathbr.pdf | bin | 244898 -> 285921 bytes |
9 files changed, 1260 insertions, 680 deletions
diff --git a/macros/latex/contrib/asmeconf/README.md b/macros/latex/contrib/asmeconf/README.md index 9b612624c5..af7db56372 100644 --- a/macros/latex/contrib/asmeconf/README.md +++ b/macros/latex/contrib/asmeconf/README.md @@ -1,54 +1,32 @@ #asmeconf: A template for ASME conference papers# - Version 1.20 dated 2020/11/08. + Version 1.21 dated 2020/12/10. ####Overview#### This class provides a template to format ASME Conference papers according to - the requirements on ASME's web pages (as posted in early 2020). + the requirements on ASME's web pages (as posted in 2020). [www.asme.org/publications-submissions/proceedings/formatting-the-paper](https://www.asme.org/publications-submissions/proceedings/formatting-the-paper) - This work is not a publication of ASME itself. + The asmeconf class provides access to many features not available in older LaTeX templates for ASME papers. It is designed to approach the following aims: - Files in this distribution are: +- match ASME's font current specifications and layout - README.md -- this file - asmeconf.cls -- the class file - asmeconf.bst -- bibtex style for ASME conference format - asmeconf-template.tex -- a latex template/example for this class - asmeconf-template.pdf -- documentation/sample paper - asmeconf-sample.bib -- a sample bibliography file - * - sample-figure-1.pdf, - sample-figure-2a.pdf, - sample-figure-2b.pdf -- figures for the example - * - author-grid-style.pdf -- example of title page with "authorgrid" option - - The .tex and .cls files are commented and should be self-explanatory. - - - - - This template was designed to approach the following aims: - -- match ASME's font current specifications and layout, including the most recent author layout - -- match ASME's current citation formats +- match ASME's current reference formats, and add support for DOI and URL fields -- support hyperref package (hyperlinks to figures, tables, references, web) +- support hyperlinks to figures, tables, equations, references, and external URLs - support pdf bookmarks and metadata +- set author names and addresses in either the traditional grid or the more recent inline style + - enable various math and text features with newtxmath and newtxtext packages - support bold face, sans serif math in section headings - support footnotes in section headings -- provide automatic layout of author and addresses in one of two styles - - provide line numbers for editing and review - support balancing of columns on last page @@ -57,7 +35,25 @@ - support copyright footer for federal employees and contractors + The .tex and .cls files are commented and should be self-explanatory. + The files in this distribution are: + + README.md -- this file + asmeconf.cls -- the class file + asmeconf.bst -- bibtex style for ASME conference format + asmeconf-template.tex -- a latex template/example for this class + asmeconf-template.pdf -- documentation/sample paper + asmeconf-sample.bib -- a sample bibliography file + * + sample-figure-1.pdf, + sample-figure-2a.pdf, + sample-figure-2b.pdf -- figures for the example + * + author-grid-style.pdf -- example of title page with "authorgrid" option + + This work is not a publication of ASME itself. + ####Author#### John H. Lienhard V @@ -73,6 +69,8 @@ ####Change log#### + v1.21 (2020/12/10): Edit documentation; update some usage of xparse under the hood; confirm compliance with substitutefont package. + v1.20 (2020/11/08): Add options to change copyright notice for federal employees and contractors; rename option "oldauthors" as "authorgrid"; other minor edits. Thanks to Bret Van Poppel for suggesting the federal copyright. v1.19 (2020/08/12): Add support for PDF/A archival standards (1b, 2b, 2u, 3b, 3u), as the newtx fonts have recently gained complete unicode maps; set pdf to load with single-page display rather than 2-page spread; add example of grid-style author block. diff --git a/macros/latex/contrib/asmeconf/asmeconf-sample.bib b/macros/latex/contrib/asmeconf/asmeconf-sample.bib index d7af55a758..7fa393f413 100644 --- a/macros/latex/contrib/asmeconf/asmeconf-sample.bib +++ b/macros/latex/contrib/asmeconf/asmeconf-sample.bib @@ -1,5 +1,8 @@ -%% Revised 7 November 2020 -%% John H. Lienhard, MIT +%% Sample bibliography file for asmeconf.bst and asmeconf.cls +%% +%% Revised 10 December 2020 +%% Copyright John H. Lienhard, MIT +%% Offered under the MIT license: https://ctan.org/license/mit @article{ning2002, author = {Xiang Ning and Mary Rose Lovell}, @@ -11,8 +14,9 @@ pages = {2000--2008}, doi = {10.1115/1.4042912}, } -%% article supports these fields: author, year, title, journal, volume, number, pages OR eid (and numpages), -%% doi, url, eprint with archive, note. +%% article supports these fields: author, year, title, journal, volume, number, pages OR eid (and numpages), +%% doi, url, eprint with archive, note. +%% %% There's no need to give the URL if it is simply the DOI, since the DOI itself will be hyperlinked. %% url = {https://doi.org/10.1115/1.4042912}. ASME requests that a URL point to the abstract. @@ -23,8 +27,8 @@ author = {Tom A. Gibson and Matthew A. Tucker}, address = {New York}, } -%% book supports these fields: author OR editor, year, title, edition, series, volume OR number -%% publisher, address, doi, url, eprint with archive, note. +%% book supports these fields: author OR editor, year, title, edition, series, volume OR number +%% publisher, address, doi, url, eprint with archive, note. @INCOLLECTION{stevens1999, author = {Thomas T. Stevens}, @@ -36,9 +40,10 @@ pages = {22--36}, } %% incollection supports these fields: author, year, title, booktitle, edition, editor, series, -%% volume OR number, publisher, address, type, -%% chapter, pages, doi, note, eprint with archive, url, urldate. -%% type = { } changes default "Chap." to something else. +%% volume OR number, publisher, address, type, chapter, +%% pages, doi, note, eprint with archive, url, urldate. +%% +%% type = { }, changes default "Chap." to something else. @inproceedings{wions2005, author = {Thomas Wions and Christopher D. Mills}, @@ -55,8 +60,9 @@ %% inproceedings supports these fields: author, year, title, booktitle, edition, editor, volume, %% organization OR publisher, address, venue, eventdate, %% [paper] number, pages, doi, note, eprint with archive, url, urldate. +%% %% Note that venue and eventdate are specific to the asmeconf.bst style. -%% There's really no need to give the URL if it is simply the DOI because the DOI itself will be hyperlinked. +%% There's actually no need to give the URL if it is simply the DOI because the DOI itself will be hyperlinked. %% ASME requests that the URL point to the abstract. @phdthesis{smith2002, @@ -68,9 +74,11 @@ doi = {10.1115/1.4042912}, url = {https://doi.org/10.1115/1.4042912}, } -% type = {Sc{D} {T}hesis}, could be added to change the type of thesis. See two examples below. -% There's no need to give the URL if it is simply the DOI; the DOI itself will be hyperlinked. -% eprint with archive is also supported. +%% phdthesis supports these fields: author, title, school, address, year, type, note. +%% doi, eprint with archive, url, urldate, urltype +%% +%% type = {Sc{D} {T}hesis}, could be added to change the type of thesis. +%% There's really no need to give the URL if it is simply the DOI; the DOI itself will be hyperlinked. %% ASME requests that the URL point to the abstract. @mastersthesis{smith1998, @@ -80,9 +88,11 @@ address = {Rochester, NY}, year = {1998}, } -%% mastersthesis supports these fields: author, year, title, type, school, address, note. -%% These fields are also supported, but don't use them all: doi, eprint with archive, url, urldate, urltype -%% type={} can optionally be used to change the type of thesis. Default is "Master's thesis" +%% mastersthesis supports these fields: author, title, school, address, year, type, note, +%% doi, eprint with archive, url, urldate, urltype +%% +%% type={} can optionally be used to change the type of thesis, as in next example. Default is "Master's thesis". +%% ASME requests that the URL point to the abstract. @mastersthesis{smith1996, author = {Robert Smith}, @@ -106,10 +116,11 @@ } %% techreport supports the fields: author, title, number, institution, address, year, doi, url, %% eprint with archive, note. -% if type = is omitted, it will default to "Tech. Rep." See the example below for changing this. +%% +%% if type = is omitted, it will default to "Tech. Rep." See the example below for changing this. @techreport{reynolds58, - author = {W. C. Reynolds and W. M. Kays and S. J. Kline}, + author = {William C. Reynolds and William M. Kays and Stephen J. Kline}, title = {Heat Transfer in the Incompressible Turbulent Boundary Layer. {I}--{C}onstant Wall Temperature}, type = {Memorandum}, institution = {NASA}, @@ -136,7 +147,7 @@ note = {Published by the Advisory Group for Aerospace Research and Development of {NATO}}, } %% If you need to change "Chap." to something else, use for example: type = {{C}hapter}, -%% It's uncommon to have the "series" field as above. +%% It's very uncommon to have the "series" field as above. @article{Lienhard2019b, author = {Lienhard, V, John H.}, @@ -152,6 +163,57 @@ %% May include numpages = {} to get "eid (numpages pages)" %% Note use of jht macro for title title (produces "ASME J. Heat Transfer"). All ASME journals have macros. +@online{milde, + author = {G\"{u}nter Milde}, + title = {{\texttt{substitutefont}}---Easy font substitution, Version 0.1.4}, + organization = {Comprehensive \TeX\ Archive Network}, + year = {2013}, + url = {https://www.ctan.org/pkg/substitutefont}, + urldate = {December 9, 2020}, +} +%% online supports these fields: author OR editor, year, title, organization, address, +%% note, url OR eprint with archive, urldate, urltype +%% You can change "Accessed" with "urltype", e.g., urltype = {retrieved}, + +@book{fourier1822, + author = {Jean Baptiste Joseph Fourier}, + year = {1822}, + title = {Th\'{e}orie Analytique de la Chaleur}, + publisher = {Firmin Didot, P\`{e}re et Fils}, + address = {Paris}, + url = {https://books.google.com/books?id=1TUVAAAAQAAJ}, +} +%% English translation is here: +%% url = {https://archive.org/details/analyticaltheory00fourrich}, + +@BOOK{johnson1980, + editor = {Howard Johnson}, + title = {Title of Edited Book}, + publisher = {John Wiley and Sons, Inc.}, + address = {New York, NY}, + year = {1980}, +} +%% edited book + +@proceedings{proceedings, + title = {The Title of the Proceedings}, + year = 2015, + editor = {Al Yankovich and Howard Stern}, + volume = {15}, + organization = {Organization}, + venue = {Boston, MA}, + eventdate = {April 27--28}, + url = {http://web.mit.edu}, + note = {Optional note}, +} +%% proceedings supports these fields: author OR editor, year, title, edition, editor, +%% series, volume OR number, organization, publisher, +%% address [of organization or publisher], venue, eventdate, +%% doi, url, eprint with archive. +%% +%% The organization will appear as author/editor if those fields are both empty. +%% In most instances, the publisher is the organization so only one of these two fields should be used + @misc{govindan2017, author = {Prakash Narayan Govindan and Steven Lam and Maximus G. {St. John}}, title = {Systems Including a Condensing Apparatus Such As a Bubble Column Condenser}, @@ -159,6 +221,7 @@ year = {2017}, url = {https://patents.google.com/patent/US9700811B2}, } +%% US Patent @misc{Fong2015, title = {Analytical Methods for Squaring the Disc}, @@ -168,8 +231,7 @@ eprint = {1509.06344}, archive = arxiv, } -% eprint + arxiv produces the same result as: url = {https://arxiv.org/abs/1509.06344v3}, - +%% eprint + arxiv produces the same result as: url = {https://arxiv.org/abs/1509.06344v3}, @manual{GSL, title = {{GNU} Scientific Library Release 2.4}, @@ -187,47 +249,9 @@ year = 2017, url = {https://www.gnu.org/software/gsl/}, } -%% manual supports these fields: author, year, title, edition, organization, address, doi, eprint with archive, urldate, url, note. - - -@online{mpl, - title = {mpl colormaps}, - author = {St{\'e}fan {van der Walt} and Nathaniel Smith}, - organization = {GitHub}, - address = {San Francisco, CA}, - year = 2015, - url = {http://bids.github.io/colormap/}, - urldate = {August 26, 2018}, -} -%% online supports these fields: author OR editor, year, title, organization, address, -%% note, url OR eprint with archive, urldate, urltype -%% You can change "Accessed" with "urltype", e.g., urltype = {retrieved}, - -@BOOK{johnson1980, - editor = {Howard Johnson}, - title = {Title of Edited Book}, - publisher = {John Wiley and Sons, Inc.}, - address = {New York, NY}, - year = {1980}, -} +%% manual supports these fields: author, year, title, edition, organization, address, +%% doi, eprint with archive, urldate, url, note. -@proceedings{proceedings, - title = {The Title of the Proceedings}, - year = 2015, - editor = {Al Yankovich and Howard Stern}, - volume = {15}, - organization = {Organization}, - venue = {Boston, MA}, - eventdate = {April 27--28}, - url = {http://web.mit.edu}, - note = {Optional note}, -} -%% proceedings supports these fields: author OR editor, year, title, edition, editor, -%% series, volume OR number, organization, publisher, -%% address [of organization or publisher], venue, eventdate, -%% doi, url, eprint with archive. -%% The organization will appear as author/editor if those fields are empty. -%% In most instances, the publisher is the organization so only one should be given @online{amsmath, author = {{American Mathematical Society} and {LATEX3 Project}}, @@ -291,18 +315,15 @@ url = {https://www.ctan.org/pkg/rotating}, urldate = {October 2, 2019}, } - -@BOOK{book, - author = {James Tiberius Kirk}, - year = {2288}, - title = {Decline and Fall of the Romulan Empire}, - edition = {7}, - series = {Humankind's Greatest Writings}, - volume = {23}, - url = {http://web.mit.edu}, - publisher = {Vulcan Free Press}, - address = {T'Paal}, - note = {to appear}, + +@online{mpl, + title = {mpl colormaps}, + author = {St{\'e}fan {van der Walt} and Nathaniel Smith}, + organization = {GitHub}, + address = {San Francisco, CA}, + year = 2015, + url = {http://bids.github.io/colormap/}, + urldate = {August 26, 2018}, } @inbook{inbook, @@ -318,14 +339,23 @@ address = {Boston}, note = {{``The Locust Years''}}, } -%% inbook supports these fields: author OR editor, year, title, edition, version, series, volume OR number, doi, url, eprint with archive, publisher, address, note. type={} field changes "Chap." to something else. +%% inbook supports these fields: author OR editor, year, title, edition, version, series, +%% volume OR number, doi, url, eprint with archive, publisher, +%% address, note. +%% +%% type={} field changes "Chap." to something else. -@book{fourier1822, - author = {Jean Baptiste Joseph Fourier}, - year = {1822}, - title = {Th\'{e}orie Analytique de la Chaleur}, - publisher = {Firmin Didot, P\`{e}re et Fils}, - address = {Paris}, - url = {https://archive.org/details/analyticaltheory00fourrich}, + +@BOOK{book, + author = {James Tiberius Kirk}, + year = {2288}, + title = {Decline and Fall of the Romulan Empire}, + edition = {7}, + series = {Humankind's Greatest Writings}, + volume = {23}, + url = {http://web.mit.edu}, + publisher = {Vulcan Free Press}, + address = {T'Paal}, + note = {to appear}, } - + diff --git a/macros/latex/contrib/asmeconf/asmeconf-template.pdf b/macros/latex/contrib/asmeconf/asmeconf-template.pdf Binary files differindex 07ffba0dae..3e1a594226 100644 --- a/macros/latex/contrib/asmeconf/asmeconf-template.pdf +++ b/macros/latex/contrib/asmeconf/asmeconf-template.pdf diff --git a/macros/latex/contrib/asmeconf/asmeconf-template.tex b/macros/latex/contrib/asmeconf/asmeconf-template.tex index 81615a54aa..f9860ccbc8 100644 --- a/macros/latex/contrib/asmeconf/asmeconf-template.tex +++ b/macros/latex/contrib/asmeconf/asmeconf-template.tex @@ -3,11 +3,11 @@ %% This file is asmeconf-template.tex, a template to format ASME Conference papers according to %% the requirements on ASME's conference web pages. %% -%% This file is version 1.20 dated 2020/11/08 +%% This file is version 1.21 dated 2020/12/10 %% %% As of version 1.11, this template follows ASME's newer conference guidelines first posted July 2019. %% The new guidelines have changed the requested author block formatting to be inline. -%% (This template continues to support the old grid format as a package option.) +%% (This template continues to support the traditional grid format as a package option.) %% Nomenclature now follows the abstract. Abstract is in italics. %% %% Author: John H. Lienhard V @@ -71,20 +71,7 @@ %% %% Copyright (c) 2020 John Lienhard %% -%% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -%% associated documentation files (the "Software"), to deal in the Software without restriction, -%% including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -%% and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -%% subject to the following conditions: -%% -%% The above copyright notice and this permission notice shall be included in all copies or -%% substantial portions of the Software. -%% -%% The software is provided "as is", without warranty of any kind, express or implied, including but -%% not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. -%% In no event shall the authors or copyright holders be liable for any claim, damages or other liability, -%% whether in an action of contract, tort or otherwise, arising from, out of or in connection with the -%% software or the use or other dealings in the software. +%% Offered under the MIT license: https://ctan.org/license/mit %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -163,7 +150,7 @@ %% %% Abstract should be no more than 200 words \begin{abstract} -This paper is an example of and a template for typesetting ASME Conference Papers in {\upshape\LaTeX} using the {\upshape\texttt{asmeconf}} class. This class follows ASME guidelines for margins, fonts, headings, captions, and reference formats as of early 2020. The class is intended to be used with the {\upshape\texttt{asmeconf.bst} \hologo{BibTeX}} style, which is part of this distribution. The class is compatible with the {\upshape\texttt{hyperref}} package, so that pdfs will contain internal and external hyperlinks, pdf bookmarks, and metadata. Links may be colored, for online use, or black, for publication. Section headers may contain mathematics, references, citations, and footnotes. The class enables inline author names, following ASME's current style, but is backward compatible to the traditional block style. The class includes many options, e.g., for math fonts. The class calls a number of packages, all of which are in {\upshape\TeX\ Live} and on CTAN. The class is compatible with {\upshape\hologo{pdfLaTeX}} or {\upshape\hologo{LuaLaTeX}}. +This paper is an example of and a template for typesetting ASME Conference Papers in {\upshape\LaTeX} using the {\upshape\texttt{asmeconf}} class. This class follows ASME guidelines for margins, fonts, headings, captions, and reference formats as of 2020. The class is intended to be used with the {\upshape\texttt{asmeconf.bst} \hologo{BibTeX}} style, which is part of this distribution. The class incorporates the {\upshape\texttt{hyperref}} package, so that pdfs will contain hyperlinks, bookmarks, and metadata, and references can include the DOI and URL fields. Links may be colored, for online use, or black, for publication. The class enables inline author names, following ASME's current style, but can also produce the traditional grid style. Options include line numbering, final column balancing, various math options, government copyright, and archivability (PDF/A). In addition, section headers may contain mathematics, references, citations, and footnotes. The class is compatible with {\upshape\hologo{pdfLaTeX}} or {\upshape\hologo{LuaLaTeX}}. \end{abstract} %%%%%%%%% NOMENCLATURE (OPTIONAL) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -196,19 +183,19 @@ This paper is an example of and a template for typesetting ASME Conference Paper %%%%%%%%% BODY OF PAPER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Introduction} -The \texttt{asmeconf} class file will typeset papers with margins, fonts, headings, captions, and reference formats that follow those specified for conference papers of the American Society of Mechanical Engineers (ASME). Internal and external hyperlinks will be set automatically, and the pdf file will contain bookmarks and metadata. This class is not a publication of ASME. +The \texttt{asmeconf} class typesets papers with margins, fonts, headings, captions, and reference formats that follow the specifications for conference papers of the American Society of Mechanical Engineers (ASME). In contrast to older ASME \LaTeX\ templates, \texttt{asmeconf} will set internal and external hyperlinks, and the pdf file will contain bookmarks and metadata. Many other useful features have been incorporated. This class is not a publication of ASME, but the author has published in ASME conferences since 1983. -The \texttt{.tex} file may be written using standard \LaTeX\ commands, although some specific initial commands are needed to format the blocks containing the author[s], title, and abstract. This class loads a number of other packages, all of which are contained in up-to-date versions of \href{https://www.tug.org/texlive/}{\TeX\ Live}, \href{http://www.tug.org/mactex/}{Mac\TeX}, and similar distributions. If you find you are missing one of these packages, you may obtain it at no cost from CTAN (\href{http://ctan.org}{ctan.org}). +The \texttt{.tex} file may be written using standard \LaTeX\ commands, although some specific initial commands are needed to format the blocks containing the author[s], title, and abstract. This class loads a number of other packages, all of which are contained in up-to-date versions of \href{https://www.tug.org/texlive/}{\TeX\ Live}, \href{http://www.tug.org/mactex/}{Mac\TeX}, and similar platforms. If you find that you are missing one of these packages, you may obtain it at no cost from CTAN (\href{http://ctan.org}{ctan.org}). \subsection{Essential Initial Commands} To begin, fill in the fields to be completed at top of the \texttt{asmeconf-template.tex} file. These fields include the headers for your conference and your paper number. Specified metadata will be placed into the pdf file itself. The title should be placed into \verb|\title{..}|. -Put author names into the \verb|\SetAuthors{name, name,...}| command in the desired order; follow the syntax illustrated \texttt{asmeconf-template.tex} file. Put each distinct address sequentially into a separate \verb|\SetAffiliation{n}{address}|, where $n = 1,2,\ldots$ Tag each author with the right affiliation by putting \verb|\affil{n}| after that author's name inside the \verb|\SetAuthors{..| command. +Put author names into the \verb|\SetAuthors{name, name,...}| command in the desired order; follow the syntax illustrated \texttt{asmeconf-template.tex} file. Put each distinct address sequentially into a separate \verb|\SetAffiliation{n}{address}|, where $n = 1,2,\ldots$ Tag each author with an affiliation by putting \verb|\affil{n}| after that author's name inside the \verb|\SetAuthors{..| command. -Author addresses are to be kept short. List the author institution, and the City, State (US authors), City, Province, Canada (Canadian authors), or City, Country (for other international authors). +Keep author addresses short. List the author institution, and the City, State (US authors), City, Province, Canada (Canadian authors), or City, Country (other international authors). -One author (or more) may be designated as the corresponding author by placing \verb|\CorrespondingAuthor{email}| after \verb|\affil{#}|. Two or more authors may be joint first authors by putting \verb|\JointFirstAuthor| after \verb|\affil{#}|. +One author (or more) may be designated as the corresponding author by placing \verb|\CorrespondingAuthor{email}| after \verb|\affil{n}|. Two or more authors may be joint first authors by putting \verb|\JointFirstAuthor| after \verb|\affil{n}|. After setting up the headers, authors, and title, issue the \verb|\maketitle| command. @@ -350,7 +337,8 @@ Landscape figures and tables may be produced at full-page size by putting \verb| \section{Reference Formatting with \NoCaseChange{\texttt{asmeconf.bst}}\footnote{If you have text in a section heading or caption that you do not want to be capitalized, such as an SI unit, enclose it in a \texttt{\textbackslash NoCaseChange} command.}}\label{sec:references} -The {\upshape\texttt{asmeconf.bst}} \hologo{BibTeX} style follows the reference styles shown on ASME's conference web site in early 2020. Examples for these and many other cases are given in the \texttt{asmeconf-sample.bib} file, which is part of this distribution. Citations and references are managed by the standard \texttt{natbib} package. Nevertheless, a few comments are necessary. +The {\upshape\texttt{asmeconf.bst}} \hologo{BibTeX} style follows the reference styles shown on ASME's conference web site in 2020.\footnote{\texttt{asmeconf.bst} is intended as a replacement for the old \texttt{asmems4.bst}, which does not follow ASME's current reference formats or support DOI and URL.} +Examples for these and many other cases are given in the \texttt{asmeconf-sample.bib} file, which is part of this distribution. Citations and references are managed by the standard \texttt{natbib} package. Nevertheless, a few comments are necessary. %% sub-subsections should *not* be numbered @@ -358,13 +346,13 @@ The {\upshape\texttt{asmeconf.bst}} \hologo{BibTeX} style follows the reference Elementary support for \texttt{eprint} numbers is also included, generating a url at the end of the citation. The \texttt{archive} type may be specified using the macros \texttt{arxiv, googlebooks, hdl, jstore, oclc}, or \texttt{pubmed} (e.g., \texttt{archive=hdl}, \textit{without} braces). Both \texttt{eprint} and \texttt{archive} fields \textit{must} be given. Other root urls may be invoked using \verb|archive = {http://another.url.org/}|. -\subsubsection*{Online Sources} A bibliography field \verb|@online{..| is included for citation of online sources, such as web pages. A \texttt{url} or \texttt{eprint} with \texttt{archive} must be included. See the examples of use in the \texttt{asmeconf-sample.bib} file. +\subsubsection*{Online Sources} A bibliography entry \verb|@online{..| is included for citation of online sources, such as web pages. A \texttt{url} or \texttt{eprint} with \texttt{archive} must be included. See the examples of use in the \texttt{asmeconf-sample.bib} file. \subsubsection*{Date Accessed} The \verb|urldate={..}| field may be used to provide the date on which a given url was accessed. By default, the text printed will be \texttt{Accessed `date',}. The word ``Accessed'' may be changed using the \verb|urltype={..}| field. \subsubsection*{Conference Location and Date} For the entry types \verb|@inproceeedings{..| and \verb|@proceeedings{..|, you may include \verb|venue={..}| and \verb|eventdate={..}| to specify the city and the date of a conference. -\subsubsection*{Capitalization of Titles} ASME's bibliography style requires that document titles be in title case. The first letters of principal words are capitalized. Do this when writing the \texttt{.bib} file. +\subsubsection*{Capitalization of Titles} ASME's bibliography style requires that document titles be in title case. The first letters of principal words are capitalized. Do this in the \texttt{.bib} file. @@ -455,25 +443,25 @@ This package will attempt to give equal height to the two columns on the last pa The \texttt{lineno} package is not compatible with the \texttt{flushend} package that makes final short columns the same height. Balancing is automatically disabled when this option is called. +\subsection{Grid-Style Author Block} The option \texttt{[authorgrid]} invokes ASME's grid-style arrangement of author names. The authors and affiliations must be entered differently in this case. See Appendix \ref{appendix:b} for usage. + \subsection{Changing the Copyright Footer} The option \texttt{[nofoot]} will omit the ASME copyright from the page footer. The option \texttt{[govt]} will produce a copyright notice for authors who are employees of the U.\ S.\ Government. The option \texttt{[contractor]} will produce a copyright notice for authors who are employed by a U.\ S.\ Government contractor. The footers are generated with the \texttt{fancyhdr} package~\cite{oostrum}, so you can change them in any way you like using the commands of that package. Only the default arrangement of footers matches ASME's style, however. -\subsection{Superiors Font} The \texttt{newtxtext} package includes a superiors font (both numbers and letters) for use in footnote markers and superscripts. To enable this font, use the option \texttt{[nodefaultsups]}. +\subsection{Archivability:~PDF/A} Compliance with PDF/A standards can be enabled using the option \texttt{[pdf-a]} +when running with \hologo{pdfLaTeX}. The default setting is for PDF/A-3u with sRGB OutputIntent (\texttt{sRGB.icc}). +If levels 1b, 2b, 2u, or 3b are preferred, use the options \texttt{[pdfapart=1 or 2 or 3]} and +\texttt{[pdfaconformance=b or u]}. Note that accessible conformance~(\texttt{a}) is not currently possible with \LaTeX. -\subsection{Grid-Style Author Block} The option \texttt{[authorgrid]} invokes ASME's grid-style arrangement of author names. The authors and affiliations must be entered differently in this case. See Appendix \ref{appendix:b} for usage. +\subsection{Superiors Font} The \texttt{newtxtext} package includes a superiors font (both numbers and letters) for use in footnote markers and superscripts. To enable this font, use the option \texttt{[nodefaultsups]}. \subsection{Hyphenation of Typewriter Font} The option \texttt{[hyphenate]} will allow hyphenation of the typewriter font. -Hyphenation is normally suppressed for typewriter mode because this font is often used for code. +Hyphenation is normally suppressed for typewriter mode because this font is often used for computer code. \subsection{Support for Other Languages} The package can be adapted to incorporate (or entirely use) languages other than English. See Appendix \ref{appendix:c} for details. -\subsection{Archivability:~PDF/A} Compliance with PDF/A standards can be enabled using the option \texttt{[pdf-a]} -when running with \hologo{pdfLaTeX}. The default setting is for PDF/A-3u with sRGB OutputIntent (\texttt{sRGB.icc}). -If levels 1b, 2b, 2u, or 3b are preferred, use the options \texttt{[pdfapart=1 or 2 or 3]} and -\texttt{[pdfaconformance=b or u]}. Note that accessible conformance~(\texttt{a}) is not currently possible with \LaTeX. - %%%%% Conclusions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -511,7 +499,7 @@ Place any acknowledgments here. \section[The Vector Product A\times B]{The vector product $\vec{A}\times\vec{B}$}\label{appendix:a} This brief illustration of an appendix shows the numbering of the appendix and equations. Equations are numbered -consecutively, following those in the paper. +consecutively, following those in the paper. Consider $\rho \neq \textrm{fn}(p)$: \begin{align} \frac{d\Gamma}{dt} &{}= \frac{d}{dt} \int_{\mathcal{C}} \mathbf{u} \cdot d\mathbf{r}\\ &{}= \int_{\mathcal{C}} \frac{D\mathbf{u}}{Dt} \cdot d\mathbf{r} + \underbrace{\int_{\mathcal{C}} \mathbf{u}\cdot d\biggl( \frac{d\mathbf{r}}{dt}\Biggr)}_{=\, 0} \\[-2pt] @@ -519,7 +507,6 @@ consecutively, following those in the paper. &{}= \iint_{\mathcal{S}} \nabla p \times \nabla \left( \frac{1}{\rho}\right) \cdot d\mathbf{A} \end{align} - \section{Option to Use an Author Grid}\label{appendix:b} ASME's most recent templates place author names inline, with affiliations for all authors in rows below. @@ -551,11 +538,11 @@ subsequent row. \section{Language Support}\label{appendix:c} ASME publishes in English, but the \texttt{babel} package is loaded for -users who may wish to include other languages. Options are supported to load a primary language, \texttt{lang=}, -as well as a secondary and tertiary language, \texttt{lang-second} and \texttt{lang-third}. +users who may wish to include other languages. Class options allow loading a primary language, \texttt{lang=}, +as well as secondary and tertiary languages, \texttt{lang-second} and \texttt{lang-third}. The primary language must be specified explicitly if a secondary language is loaded. -If no language option is given, the package defaults to English. An example of use is -shown in \selectlanguage{french}\appendixname\ \ref{app:fourier}.\selectlanguage{english} +If no language option is given, the package defaults to English. An example of including a passage in French is +shown in \selectlanguage{french}{\appendixname\ \ref{app:fourier}.\selectlanguage{english} The standard caption and section names will follow \texttt{babel}'s dictionary for primary languages other than English. Users may additionally change ``Keywords'', ``Nomenclature'', ``Corresponding author'', and ``Joint first authors'' by renewing the commands \verb|\keywordname|, \verb|\nomname|, \verb|\CAwords|, and \verb|\JAwords|. Changes to the page footer were described earlier. The pdf bookmark for ``Appendices'' may be changed by renewing \verb|\appendicesname|. @@ -564,7 +551,7 @@ Font encoding is set to T1 with utf-8 input supported: \typeout{If you have trouble with the next line, your file may not be saved in utf-8 format. You can delete that line to resolve the issue.} àáâäæãåā èéęëêēė îïíīįì ôöòóœøōõ ûüùúū çćč ł ñń ßśš ÿ žźż. -No effort has been made to support customization of language-specific fonts, although this is possible by modifying the class file (examples are given in the \texttt{newtx} documentation). The bibliography style, \texttt{asmeconf.bst}, is designed in English and aimed at \hologo{BibTeX}. Multilingual bibliographies can be supported using \texttt{BibLaTeX}. +The \texttt{substitutefont} package \cite{milde} may be loaded in the preamble to enable the selection of language-specific fonts. Examples for Greek and Cyrillic are included in that package's documentation. The bibliography style, \texttt{asmeconf.bst}, is designed in English and aimed at \hologo{BibTeX}. Multilingual bibliographies can be supported using \texttt{BibLaTeX}. \selectlanguage{french} \section{Discours Préliminaire de Fourier}\label{app:fourier} @@ -575,6 +562,10 @@ La chale ur pénètre, comme la gravité, toutes les substances de l'univers, se \selectlanguage{english} +\textsc{Translation:} \textit{Primary causes are unknown to us; but are subject to simple and constant laws, which may be discovered by observation, the study of them being the object of natural philosophy}. + +\textit{Heat, like gravity, penetrates every substance of the universe, its rays occupy all parts of space. The object of our work is to set forth the mathematical laws which this element obeys. The theory of heat will hereafter form one of the most important branches of general physics}. + \end{document} diff --git a/macros/latex/contrib/asmeconf/asmeconf.cls b/macros/latex/contrib/asmeconf/asmeconf.cls index 2f1932a0d8..987fa06e91 100644 --- a/macros/latex/contrib/asmeconf/asmeconf.cls +++ b/macros/latex/contrib/asmeconf/asmeconf.cls @@ -5,9 +5,9 @@ %% %% Please note that ASME's journals follow specifications different from ASME conference papers. %% -%% This file is version 1.20 dated 2020/11/08. - \def\versionno{1.20} - \def\versiondate{2020/11/08\space} +%% This file's version and date: + \def\versionno{1.21} + \def\versiondate{2020/12/10\space} %% %% Author: John H. Lienhard V %% Department of Mechanical Engineering @@ -29,7 +29,7 @@ %% CTAN (https://ctan.org/). %% %% The Times/Helvetica style fonts are from Michael Sharpe's excellent newtxtext and newtxmath packages; -%% version 1.5 or higher of newtxmath is recommended. +%% version 1.60 or higher of newtxmath is recommended. %% %% This class is not designed for unicode-math or fontspec, given that the ASME conference style is %% specific with respect to the font selections. @@ -122,7 +122,7 @@ %%% for mathalfa, we may now pass options in this format: mathalfa=cal=euler, mathalfa=frak=boondox \define@key{asmeconf}{mathalfa}{% - \PassOptionsToPackage{#1}{mathalfa}% + \PassOptionsToPackage{#1}{mathalfa}% } %%% set key [nodefaultsups] to obtain newtx superiors font for footnotes. @@ -544,14 +544,14 @@ \providecommand{\@keywords}{\relax} -\DeclareDocumentCommand{\keywords}{m}{% +\NewDocumentCommand{\keywords}{m}{% \IfNoValueTF{#1}{% \relax}{% \long\def\@keywords{\par\smallskip\noindent{\bfseries\sffamily \keywordname:} #1}% } } -\DeclareDocumentEnvironment{abstract}{}{% +\DeclareDocumentEnvironment{abstract}{}{% Overwrites existing abstract environment \section*{\abstractname}\itshape% } {\upshape\@keywords%\medskip% @@ -568,7 +568,7 @@ %% If second argument of \entry is omitted, will produce an italicized heading (e.g. "Greek letters") %% -\DeclareDocumentCommand{\entry}{m g}{% +\NewDocumentCommand{\entry}{m g}{% \IfNoValueTF{#2}{% \itemsep3\p@ plus 1\p@ minus 1\p@% \goodbreak\item[\itshape#1\hfill]\setlength\itemsep\savitemsep\@itempenalty=1000%\nopagebreak% \smallskip @@ -578,7 +578,7 @@ }% } -\DeclareDocumentEnvironment{nomenclature}{O{2em} O{\nomname}}{% +\NewDocumentEnvironment{nomenclature}{O{2em} O{\nomname}}{% \setlength\columnsep{2em} \setlength{\nomenwidth}{#1} \section*{#2} @@ -610,10 +610,11 @@ \providecommand\@ConfCity{\hbox{ }} \newcommand{\HeaderConfName}{% -\parbox{\linewidth}{\raggedleft\bfseries\sffamily% -\@ConfName\par% -\MakeTextUppercase{\@ConfAcronym}\par -\@ConfDate\@ConfCity% + \parbox{\linewidth}{% + \raggedleft\bfseries\sffamily% + \@ConfName\par% + \MakeTextUppercase{\@ConfAcronym}\par + \@ConfDate\@ConfCity% }% } @@ -621,9 +622,9 @@ \providecommand\@PaperNo{\protect\phantom{NO.}} \newcommand{\paperno}{% -\vspace*{2\baselineskip} -\parbox{\linewidth}{\raggedleft\bfseries\sffamily\LARGE% -\MakeTextUppercase{\@PaperNo}% + \vspace*{2\baselineskip} + \parbox{\linewidth}{\raggedleft\bfseries\sffamily\LARGE% + \MakeTextUppercase{\@PaperNo}% }% } @@ -651,7 +652,7 @@ %%%% option to retain original grid layout of authors \ifthenelse{\boolean{Oldauthors}}{% -%%%%%%%%%%%%%%%%%%%% Old author layout %%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%% Gridded author layout %%%%%%%%%%%%%%%%%%%%%%%%% \NewCoffin{\authorblock} @@ -670,7 +671,7 @@ \newlength{\coffinsep} %% horizontal space between coffins \setlength{\coffinsep}{0.03\textwidth} -\DeclareDocumentCommand\SetAuthorBlock{m m}{% +\NewDocumentCommand\SetAuthorBlock{m m}{% \addtocounter{authorno}{1}% \SetVerticalCoffin{\authorblock}{0.3\textwidth}{% \centering\sffamily% @@ -713,7 +714,7 @@ \fi } -\DeclareDocumentCommand{\ConstructAuthorBlock}{}{% +\NewDocumentCommand{\ConstructAuthorBlock}{}{% \ifnum\value{authorno}>3 \JoinCoffins\firstrowauthorblock[hc,b]\secondrowauthorblock[hc,t](0pt, -1.5\baselineskip) \fi @@ -727,7 +728,7 @@ \newif\ifCA\CAfalse % allow for NO email address to be given by omitting second argument -\DeclareDocumentCommand{\CorrespondingAuthor}{m g}{% +\NewDocumentCommand{\CorrespondingAuthor}{m g}{% \global\CAtrue% \IfNoValueTF{#2}{% \gdef\@CAsep{\relax}% @@ -743,7 +744,7 @@ %% Flag for joint first authors (two or more) \newif\ifJA\JAfalse -\DeclareDocumentCommand{\JointFirstAuthor}{}{% +\NewDocumentCommand{\JointFirstAuthor}{}{% \global\JAtrue% \renewcommand*{\thefootnote}{\fnsymbol{footnote}}% \ignorespaces\footnotemark[2]% @@ -752,7 +753,7 @@ %%% otherwise use new compact layout of authors }{% i.e., this begins "else" -%%%%%%%%%%%%%%%%%%%%%% New author layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%% New author layout (inline) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NewCoffin{\AuthorBlock} \NewCoffin{\AffiliationBlock} @@ -760,7 +761,7 @@ %% NB: \parbox width to \textwidth (full page) not \linewidth (single column) \SetHorizontalCoffin\AffiliationsBlock{} -\DeclareDocumentCommand{\SetAuthors}{m}{% +\NewDocumentCommand{\SetAuthors}{m}{% \SetHorizontalCoffin\AuthorBlock{% \parbox{\textwidth}{\centering\sffamily\bfseries\ignorespaces#1\ignorespaces}% } @@ -769,7 +770,7 @@ \def\@makefnmark{\hbox{\@textsuperscript{\sffamily\@thefnmark}}}% -\DeclareDocumentCommand{\SetAffiliation}{m m}{% +\NewDocumentCommand{\SetAffiliation}{m m}{% \SetVerticalCoffin\AffiliationBlock{\textwidth}{% \centering\sffamily\footnotemark[#1]#2\ignorespaces% } @@ -784,7 +785,7 @@ \newif\ifCA\CAfalse % allow for NO email address to be given by omitting the argument (g argument is deprecated, seems to have trouble with \IfNoValueTF) %% corrected spacing error 24 Jan 2020 -\DeclareDocumentCommand{\CorrespondingAuthor}{g}{% +\NewDocumentCommand{\CorrespondingAuthor}{g}{% \ignorespaces$\bm{^\ast}$% \global\CAtrue% % \IfNoValueTF{#1}{% @@ -800,13 +801,13 @@ %%% Flag for joint first authors (two or more) \newif\ifJA\JAfalse -\DeclareDocumentCommand{\JointFirstAuthor}{}{% +\NewDocumentCommand{\JointFirstAuthor}{}{% \global\JAtrue% $\bm{^\dagger}$% } %%% Affiliation mark -\DeclareDocumentCommand{\affil}{m}{% +\NewDocumentCommand{\affil}{m}{% {\bfseries\footnotemark[#1]}% } @@ -848,7 +849,7 @@ %%% -\DeclareDocumentCommand{\SetAuthorBlock}{}{% +\NewDocumentCommand{\SetAuthorBlock}{}{% \let\savethefootnote\thefootnote \JoinCoffins\AuthorBlock[hc,b]\AffiliationsBlock[hc,t](0pt,-\baselineskip) \centerline{\TypesetCoffin\AuthorBlock} @@ -867,7 +868,7 @@ %%%% Make the title and author section -\DeclareDocumentCommand{\MakeTitlePage}{}{% +\NewDocumentCommand{\MakeTitlePage}{}{% \twocolumn[ \begin{@twocolumnfalse} \HeaderConfName @@ -901,10 +902,10 @@ \RenewDocumentCommand{\thanks}{m}{\relax} %% disabling this standard command, as it is inconsistent with the format %% Produces an unmarked footnote about the version date, to replace "date" -%% This is for editing and should note be used in the final draft +%% This is for editing and should not be used in the final draft \NewDocumentCommand{\versionfootnote}{m}{\begin{NoHyper}\gdef\@thefnmark{}\@footnotetext{#1}\end{NoHyper}} -\RenewDocumentCommand{\date}{m}{\versionfootnote} %% in case someone wants to use \date this way. +\RenewDocumentCommand{\date}{m}{\versionfootnote} %% in case someone wants to use \date this way. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/contrib/rmathbr/README b/macros/latex/contrib/rmathbr/README index de0780e02a..b170df848f 100644 --- a/macros/latex/contrib/rmathbr/README +++ b/macros/latex/contrib/rmathbr/README @@ -1,10 +1,10 @@ -rmathbr 1.0.3 +rmathbr 1.1 ============= Repeating of math operator at the broken line and the new line in inline equations (common in Cyrillic mathematical typography) -Copyright (C) 2008-2016 by Denis Ryabov <dryabov@yandex.ru> +Copyright (C) 2008-2020 by Denis Ryabov <dryabov@yandex.ru> This work may be distributed and/or modified under the diff --git a/macros/latex/contrib/rmathbr/rmathbr.dtx b/macros/latex/contrib/rmathbr/rmathbr.dtx index 6bdcc488cf..12420347e6 100644 --- a/macros/latex/contrib/rmathbr/rmathbr.dtx +++ b/macros/latex/contrib/rmathbr/rmathbr.dtx @@ -2,7 +2,7 @@ % !Mode:: "TeX:DTX:UK" % !DTXversion:: "2.5a" % -% Copyright (C) 2008-2016 by Denis Ryabov <dryabov@yandex.ru> +% Copyright (C) 2008-2020 by Denis Ryabov <dryabov@yandex.ru> % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -28,7 +28,8 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{rmathbr} %<*package> - [2016/04/10 1.0.3 Repeating of math operator at the broken line and the new line in inline equations] + [2020/12/11 1.1 Repeating of math operator at the broken line and the new + line in inline equations] %</package> % %<*driver> @@ -38,12 +39,15 @@ pdfstartview=FitH, pdfpagelayout=OneColumn, pdfauthor={Denis Ryabov}, - pdftitle={rmathbr : Repeating of math operator at the broken line and the new line in inline equations}]{hyperref} + pdftitle={rmathbr : Repeating of math operator at the broken line and + the new line in inline equations}]{hyperref} \usepackage{enumitem} \usepackage{multicol} +\usepackage{array,longtable} \usepackage{rmathbr} \setlist{nosep} \pagestyle{headings} +\frenchspacing \sloppy \clubpenalty=10000 \widowpenalty=10000 @@ -54,7 +58,7 @@ %</driver> % \fi % -% \CheckSum{3299} +% \CheckSum{3823} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -87,13 +91,13 @@ % % Repeating of math operator at the broken line and the new line in inline % equations is used in Cyrillic mathematical typography (Russian for example), -% but unfortunately \LaTeX{} doesn't provide such an option. There was an attempt +% but unfortunately, \LaTeX{} doesn't provide such an option. There was an attempt % to do it many years ago [see M.I.~Grinchuk ``TeX and Russian Traditions of % Typesetting'', TUGboat 17(4) (1996) 385], but there was no ready to use package. % -% This package extends ideas described in ``TeX and Russian Traditions of -% Typesetting'' and supports most of \LaTeX{} mathematical packages (some known -% issues are listed in ``Known issues'' section below). +% This package extends ideas described in the ``TeX and Russian Traditions of +% Typesetting'' and supports most of \LaTeX's mathematical packages (some known +% issues are listed in the ``Known issues'' section below). % % % \section{Usage} @@ -107,27 +111,74 @@ % $t_1t_2\cos\theta=\vec t_1\cdot\vec t_2$, $x=12\cdott 3\cdott 10^3$. % \end{multicols} % -% It's recommended to load \textsf{rmathbr} after other packages, because of \textsf{rmathbr} has -% special support of many math-related packages: amsfonts, amssymb, amstex, -% boisik, euler, eulervm, fourier, icomma, latexsym, lucbmath, lucidabr, lucmin, -% lucmtime, luctime, mathbbol, mdwmath, program, sbbm, stmaryrd, wasysym. +% It's recommended to load \textsf{rmathbr} after other packages because +% \textsf{rmathbr} has special support of many math-related packages: +% \textsf{amsfonts}, \textsf{amssymb}, \textsf{amstex}, \textsf{bm}, +% \textsf{boisik}, \textsf{euler}, \textsf{eulervm}, \textsf{fourier}, +% \textsf{icomma}, \textsf{latexsym}, \textsf{lucbmath}, \textsf{lucidabr}, +% \textsf{lucmin}, \textsf{lucmtime}, \textsf{luctime}, \textsf{mathbbol}, +% \textsf{mathtools}, \textsf{mdwmath}, \textsf{program}, \textsf{sbbm}, +% \textsf{stmaryrd}, \textsf{wasysym}, \textsf{xy}. % % Please, submit any found bugs to \url{https://github.com/dryabov/rmathbr/issues}. % % \section{Options} % -% The \textsf{rmathbr} package supports following options: -% \begin{itemize} -% \item \verb|mathactivechars| (default): assign mathactive (12) category to -% \verb|^| and \verb|_| characters. -% \item \verb|activechars|: assign active (13) category to \verb|^| and -% \verb|_| characters. -% \item \verb|noactivechars|: assign default categories to \verb|^| and -% \verb|_| characters (7 and 8, correspondingly). -% \end{itemize} +% Some aspects of the \textsf{rmathbr} can be altered using package options. +% In most cases, it should be sufficient to load the package without extra +% options, but sometimes it may be necessary to change default options for +% compatibility with other packages. +% +% The ``key=value'' scheme is used with the following possible options (default +% value is printed in italics): +% +% \begin{longtable}{>{\texttt}l>{\raggedright}p{2.5cm}p{6.5cm}} +% |script| & noactive\par\textit{mathactive}\par active & +% This option declares what way \textsf{rmathbr} will affect |_| and |^| +% commands (sub- and superscripts). In the ``noactive'' mode, they have +% default \TeX{} behavior, but it may be necessary to manually wrap some +% indices into curly brackets, e.g. |A^{\star}| instead of just +% a |A^\star|. In the ``mathactive'' mode, both |_| and |^| become +% commands in math mode that process arguments properly, and extra +% wrapping is unnecessary. And in the ``active'' mode these commands can +% be used for scripts even in the text mode (e.g. |H_2O|). \\ +% |run| & atload\par atbegindocument\par\textit{auto} & +% This option declares when to affect math commands for hyphenation, +% directly at package loading time, or later at the |\begin{document}|. +% The latter is necessary to deal with packages that declare math symbols +% at the |\begin{document}|. The ``auto'' value allows to switch to the +% ``atbegindocument'' mode automatically (currently, if +% \textsf{unicode-math} or \textsf{mathtools} packages are loaded). \\ +% |cdottimes| & true\par\textit{false} & +% Re-declare \verb|\cdot| command as \verb|\cdott| (see \verb|\cdott| +% description below) to hyphenate it using the \verb|\times| character. +% By default, it is disabled because \verb|\cdot| is also used for scalar +% products (e.g. $\vec a\cdot\vec b$), and in this case, it is wrong to +% replace it with \verb|\times| on break, because \verb|\times| is usually +% used for cross products. \\ +% |brokencolon| & true\par\textit{false} & +% According to Russian typography traditions, math expression shouldn't be +% broken on the division character (|:|). But if you like to allow it, +% just set this option to true. \\ +% |brokenminus| & \textit{true}\par false & +% Usually, it's allowed to break math expression on the ``minus'' +% character, but it's possible to disable it. \\ +% |brokenbin| & true\par\textit{false} & +% This option disables breaks on binary operations (keeping relations +% only). See also |\BrokenBinOff| and |\BrokenBinOn| macros. \\ +% \end{longtable}% +% +% Internally, |scripts=mathactive| assigns the mathactive (12) category to +% \verb|^| and \verb|_| characters, |scripts=active| assigns the active (13) +% category, and |scripts=noactive| keeps default categories to \verb|^| and +% \verb|_| characters (7 and 8, correspondingly). +% +% For backward compatibility, \textsf{rmathbr} supports +% the |noactivechars| option as an alias for |scripts=noactive|, +% the |mathactivechars| option as an alias for |scripts=mathactive|, and +% the |activechars| option as an alias for |scripts=active|. These options are +% deprecated, and it's recommended to switch to the corresponding |script| option. % -% In some cases it might be necessary to change default option for compatibility -% with other packages. % % % \section{Macros} @@ -135,54 +186,89 @@ % \DescribeMacro{\*} % % Macro \verb|\*| is used to mark multiplication point that is invisible and -% changed to $\times$ at break only. E.g. \verb|(a+b)\*(a-b)|. +% changed to $\times$ at the break only. E.g. \verb|(a+b)\*(a-b)|. % % \DescribeMacro{\cdott} % -% This command displays \verb|\cdot| ($\cdot$) that is changed to -% \verb|\times| ($\times$) at break. +% This command displays \verb|\cdot| ($\cdot$) that is changed to \verb|\times| +% ($\times$) at the break. % % \DescribeMacro{\nobr} % % This command is used to prevent break expression on the following math % operator. E.g. \verb|a\nobr-b|. % -% \DescribeMacro{\SetBreakableBin} -% -% Declares breakable binary operator, e.g. \verb|\SetBreakableBin{\MyPlus}|. -% % \DescribeMacro{\SetBreakableRel} % % Declares breakable relation operator, e.g. \verb|\SetBreakableRel{\MyEqual}|. % +% \DescribeMacro{\SetBreakableBin} +% +% Declares breakable binary operator, e.g. \verb|\SetBreakableBin{\MyPlus}|. +% % \DescribeMacro{\SetBreakableInner} % % Declares breakable ``inner'' expression, e.g. \verb|\SetBreakableInner{\ldots}|. % % \DescribeMacro{\SetOpenBracket} % -% Declares opening bracket (\textsf{rmathbr} disables break directly after brackets), -% e.g. \verb|\SetOpenBracket{\MyOpenBracket}|. +% Declares opening bracket (\textsf{rmathbr} disables break directly after +% brackets), e.g. \verb|\SetOpenBracket{\MyOpenBracket}|. % % \DescribeMacro{\SetMathOperator} % -% Declares math operator (\textsf{rmathbr} disables break directly after operators), -% e.g. \verb|\SetMathOperator{\MySum}|. +% Declares math operator (\textsf{rmathbr} disables break directly after +% operators), e.g. \verb|\SetMathOperator{\MySum}|. % % \DescribeMacro{\SetPunctuation} % -% Declares punctuation command (\textsf{rmathbr} disables break directly after punctuation), +% Declares punctuation command (\textsf{rmathbr} disables break directly after +% punctuation to prevent break and duplication in the case like \verb|$1,-1$|), % e.g. \verb|\SetPunctuation{\MyColon}|. % +% \DescribeMacro{\UnsetBrokenCmd} +% +% Restores original command, e.g. to avoid potential issues or conflicts with +% other packages. Usage example: \verb|\UnsetBrokenCmd{\cdot}| to disable break on +% \verb|\cdot|. Note that in the case of |run=atbegindocument| (or |auto|) this +% command should be used after \verb|\begin{document}|. +% +% \DescribeMacro{\BrokenBinOff} +% +% Disables break on binary operations, see also |brokenbin=false| option. +% +% \DescribeMacro{\BrokenBinOn} +% +% Enables break on binary operations. +% +% % % \section{Known issues} % \begin{itemize} -% \item 'xy' package: should be loaded after 'rmathbr' to work properly -% \item 'breqn' package: cannot work together with 'rmathbr' +% \item \textsf{breqn} package: cannot work together with \textsf{rmathbr} (as +% \textsf{breqn} redefines all the math in \TeX) % \end{itemize} % % \section{Changelog} % +% \subsection*{1.1 (11-December-2020)} +% \begin{itemize} +% \item add support of XeTeX/LuaTeX and \textsf{unicode-math} package +% \item add new key-value options (|script|, |run|, |cdottimes|, |brokenminus|, +% |brokencolon|, |brokenbin|) +% \item add new commands (\verb|\UnsetBrokenCmd|, \verb|\BrokenBinOff| and +% \verb|\BrokenBinOn|) +% \item add support of \textsf{mathtools} package +% \item add a patch for \textsf{bm} package +% \item add a patch for \textsf{xy} package +% \item remove dependence on \textsf{mathstyle} package +% \item fix math class for \verb|=|, \verb|<|, \verb|>| (\verb|\mathrel| instead +% of \verb|\mathbin|) +% \item fix math class for \verb|:| (\verb|\mathbin| instead of \verb|\mathrel|) +% \item fix processing of colon-related commands (e.g. \verb|\coloneq| from +% \textsf{mathtools}, etc.) +% \item performance optimizations +% \end{itemize} % \subsection*{1.0.3 (10-April-2016)} % \begin{itemize} % \item fix issue with sub-/superscripts in \verb|\Biggl|, \verb|\biggl|, @@ -211,31 +297,38 @@ % \subsection*{0.98 (31-January-2010)} % \begin{itemize} % \item fix hyphenation on~\verb|:=| -% \item correct work with 'icomma' package and option 'icomma' of 'eulervm' package -% \item correct work with 'program' package -% \item symbols have been added from boisik, euler, fourier, lucbmath, lucidabr, -% lucmin, lucmtime, luctime, mathbbol, mdwmath, sbbm, stmaryrd and wasysym packages. -% \item remove shrinking of space in math (breaked url package) -% \item don't hyphenate after punctuation ('\verb|,|', '\verb|;|', '\verb|\colon|' etc.) +% \item correct work with \textsf{icomma} package and +% option \verb|[icomma]| of \textsf{eulervm} package +% \item correct work with \textsf{program} package +% \item symbols have been added from \textsf{boisik}, \textsf{euler}, +% \textsf{fourier}, \textsf{lucbmath}, \textsf{lucidabr}, \textsf{lucmin}, +% \textsf{lucmtime}, \textsf{luctime}, \textsf{mathbbol}, +% \textsf{mdwmath}, \textsf{sbbm}, \textsf{stmaryrd}, and \textsf{wasysym} +% packages. +% \item remove shrinking of space in math (breaked \textsf{url} package) +% \item don't hyphenate after punctuation (``\verb|,|'', ``\verb|;|'', +% ``\verb|\colon|'' etc.) % \item create broken commands as robust ones % \item some fixes of redeclaring of AMS commands -% \item commented hyphenation on \verb|\ldots| and \verb|\cdots|, as \TeX doesn't break here +% \item commented hyphenation on \verb|\ldots| and \verb|\cdots|, as \TeX{} +% doesn't break here % \end{itemize} % \subsection*{0.97 (08-October-2009)} % \begin{itemize} -% \item fix problem with operators like '\verb|+^\leq|' +% \item fix problem with operators like ``\verb|+^\leq|'' % \end{itemize} % \subsection*{0.96 (29-September-2009)} % \begin{itemize} -% \item fix problem with '\verb|-|' in AMS's \verb|\DeclareMathOperator| +% \item fix problem with ``\verb|-|'' in AMS's \verb|\DeclareMathOperator| % \item fix problem with \verb|\ldots| in text mode % \end{itemize} % \subsection*{0.95 (28-September-2009)} % \begin{itemize} % \item fix problem with sub/sup-scripts after relations % \item fix hyphenation on \verb|\ldots| -% \item AMS/Lucida left brackets (\verb|\lvert|, \verb|\lVert|, \verb|\ulcorner|, \verb|\llcorner|) support -% \item mathbbol.sty left bracket (\verb|\Lbrack|) support +% \item AMS/Lucida left brackets (\verb|\lvert|, \verb|\lVert|, +% \verb|\ulcorner|, \verb|\llcorner|) support +% \item \textsf{mathbbol} left bracket (\verb|\Lbrack|) support % \item huge code refactoring % \end{itemize} % \subsection*{0.91 (21-September-2009)} @@ -256,25 +349,45 @@ %<*package> % \fi % +% % \subsection*{Initialization} % +% Load required packages. % \begin{macrocode} \RequirePackage{ifetex} -\RequirePackage{mathstyle} +\RequirePackage{ifluatex} +\RequirePackage{xkeyval} % \end{macrocode} +% \begin{macro}{\rmathbr@kv} % \begin{macrocode} -\@ifpackageloaded{breqn}% -{ - \PackageError{rmathbr}{'rmathbr' package cannot be used together with 'breqn' package!}{}% -}{} +\edef\rmathbr@kv{\@currname.\@currext} % \end{macrocode} +% \end{macro} +% \begin{macro}{\xDeclareBoolOptionX} +% The macro to declare boolean option. +% \begin{macrocode} +\def\xDeclareBoolOptionX#1#2{% + \define@boolkey{\rmathbr@kv}[rmathbr@kv@]{#1}[true]{#2}% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\xDeclareChoiceOptionX} +% The macro to declare multi-choice option. % \begin{macrocode} -\@ifpackageloaded{xy}% -{ - \PackageError{rmathbr}{'rmathbr' package should be loaded before 'xy' package!}{}% +\def\xDeclareChoiceOptionX#1[#2]#3[#4]#5{% + \define@choicekey{\rmathbr@kv}{#1}[#2]{#3}[#4]{#5}% +} +% \end{macrocode} +% \end{macro} +% +% Warn about known issues. +% \begin{macrocode} +\@ifpackageloaded{breqn}{% + \PackageError{rmathbr}{'rmathbr' package cannot be used together with 'breqn' package!}{}% }{} % \end{macrocode} % +% % \subsection*{Interface} % % \begin{macro}{\nobr} @@ -284,499 +397,645 @@ % \end{macrocode} % \end{macro} % -% -% \begin{macro}{\SetBreakableBin} -% Makes breakable binary operation. -% \begin{macrocode} -\def\SetBreakableBin#1{\rmathbr@setbreakable{#1}{\brokenbin}} -% \end{macrocode} -% \end{macro} -% -% % \begin{macro}{\SetBreakableRel} % Makes breakable relation sign. % \begin{macrocode} \def\SetBreakableRel#1{\rmathbr@setbreakable{#1}{\brokenrel}} % \end{macrocode} % \end{macro} -% -% +% \begin{macro}{\SetBreakableBin} +% Makes breakable binary operation. +% \begin{macrocode} +\def\SetBreakableBin#1{\rmathbr@setbreakable{#1}{\brokenbin}} +% \end{macrocode} +% \end{macro} % \begin{macro}{\SetBreakableInner} % Makes breakable inner (like \verb|\ldots|). % \begin{macrocode} \def\SetBreakableInner#1{\rmathbr@setbreakable{#1}{\brokeninner}} % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\SetOpenBracket} % Disables breaks after open bracket. % \begin{macrocode} \def\SetOpenBracket#1{\rmathbr@nobrafter{#1}} % \end{macrocode} % \end{macro} -% -% +% \begin{macro}{\SetPunctuation} +% Disables breaks after punctuation sign. +% \begin{macrocode} +\def\SetPunctuation#1{\rmathbr@nobrafter{#1}} +% \end{macrocode} +% \end{macro} % \begin{macro}{\SetMathOperator} % Disables breaks after math operator. % \begin{macrocode} \def\SetMathOperator#1{\rmathbr@setbreakable{#1}{\rmathbr@mathop}} % \end{macrocode} % \end{macro} -% -% -% \begin{macro}{\SetPunctuation} -% Disables breaks after punctuation sign. +% \begin{macro}{\UnsetBrokenCmd} +% Restores original command. % \begin{macrocode} -\def\SetPunctuation#1{\rmathbr@nobrafter{#1}} +\def\UnsetBrokenCmd#1{\rmathbr@unsetbroken{#1}} % \end{macrocode} % \end{macro} -% -% \noindent Makes argument as breakable binary operation. +% \begin{macro}{\BrokenBinOff} +% Disables break on binary operations. % \begin{macrocode} -\DeclareRobustCommand{\brokenbin}[1]{\rmathbr@brokenbin{#1}} +\def\BrokenBinOff{\rmathbr@brokenbinoff} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\BrokenBinOn} +% Enables break on binary operations. +% \begin{macrocode} +\def\BrokenBinOn{\rmathbr@brokenbinon} % \end{macrocode} +% \end{macro} +% \begin{macro}{\brokenrel} % Makes argument as breakable relation sign. % \begin{macrocode} \DeclareRobustCommand{\brokenrel}[1]{\rmathbr@brokenrel{#1}} % \end{macrocode} +% \end{macro} +% \begin{macro}{\brokenbin} +% Makes argument as breakable binary operation. +% \begin{macrocode} +\DeclareRobustCommand{\brokenbin}[1]{\rmathbr@brokenbin{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\brokeninner} % Makes argument as breakable inner. % \begin{macrocode} \DeclareRobustCommand{\brokeninner}[1]{\rmathbr@brokeninner{#1}} % \end{macrocode} +% \end{macro} +% +% +% \subsection*{Options} +% +% Start to process options. +% +% First of all, warn about deprecated options: +% \begin{macrocode} +\xDeclareBoolOptionX{noactivechars}{ + \ifrmathbr@kv@noactivechars + \PackageWarning{rmathbr}{^^J Option 'noactivechars' is deprecated.^^J + Use 'scripts=noactive' instead.^^J} + \ExecuteOptionsX{scripts=noactive} + \fi +} +% \end{macrocode} +% \begin{macrocode} +\xDeclareBoolOptionX{mathactivechars}{ + \ifrmathbr@kv@mathactivechars + \PackageWarning{rmathbr}{^^J Option 'mathactivechars' is deprecated.^^J + Use 'scripts=mathactive' instead.^^J} + \ExecuteOptionsX{scripts=mathactive} + \fi +} +% \end{macrocode} +% \begin{macrocode} +\xDeclareBoolOptionX{activechars}{ + \ifrmathbr@kv@activechars + \PackageWarning{rmathbr}{^^J Option 'activechars' is deprecated.^^J + Use 'scripts=active' instead.^^J} + \ExecuteOptionsX{scripts=active} + \fi +} +% \end{macrocode} +% +% Process |script| option: +% \begin{macrocode} +\let\rmathbr@scriptsmode=\@ne +% \end{macrocode} +% \begin{macrocode} +\xDeclareChoiceOptionX{scripts}[\val\nr]{noactive,mathactive,active}[mathactive]{ + \ifcase\nr\relax + \let\rmathbr@scriptsmode=\z@ + \or + \let\rmathbr@scriptsmode=\@ne + \or + \let\rmathbr@scriptsmode=\tw@ + \fi +} +% \end{macrocode} +% +% Set when to patch math commands, at the package loading or at the +% \verb|\begin{document}| (i.e.\ after other packages are loaded and set its +% macros): +% \begin{macrocode} +\newif\ifrmathbr@patch@begindocument +% \end{macrocode} +% Note that by default 'atload' is used unless 'unicode-math' or 'mathtools' are +% loaded. +% \begin{macrocode} +\xDeclareChoiceOptionX{run}[\val\nr]{atload,atbegindocument,auto}[auto]{ + \ifcase\nr\relax + \rmathbr@patch@begindocumentfalse + \or + \rmathbr@patch@begindocumenttrue + \or + \@ifpackageloaded{unicode-math}{\rmathbr@patch@begindocumenttrue}{} + \@ifpackageloaded{mathtools}{\rmathbr@patch@begindocumenttrue}{} + \fi +} +% \end{macrocode} +% +% The option to make \verb|\cdot| works like \verb|\cdott|: +% \begin{macrocode} +\xDeclareBoolOptionX{cdottimes}{} +% \end{macrocode} +% +% Other options (see documentation): +% \begin{macrocode} +\xDeclareBoolOptionX{brokenminus}{} +% \end{macrocode} +% \begin{macrocode} +\xDeclareBoolOptionX{brokencolon}{} +% \end{macrocode} +% \begin{macrocode} +\xDeclareBoolOptionX{brokenbin}{% + \ifrmathbr@kv@brokenbin + \else + \AtBeginDocument{\BrokenBinOff} + \fi +} +% \end{macrocode} +% +% Default values: +% \begin{macrocode} +\ExecuteOptionsX{scripts=mathactive} +\ExecuteOptionsX{run=auto} +\ExecuteOptionsX{cdottimes=false} +\ExecuteOptionsX{brokenminus=true} +\ExecuteOptionsX{brokencolon=false} +\ExecuteOptionsX{brokenbin=true} +% \end{macrocode} +% +% Execute options: +% \begin{macrocode} +\ProcessOptionsX +% \end{macrocode} +% % % \subsection*{Implementation} % -% Save default penalty to \verb|\exhyphenpenalty| (as \verb|\exhyphenpenalty| will be actual penalty for math breaks). +% Switch to scripts mode % \begin{macrocode} -\exhyphenpenalty=\relpenalty +\ifcase\rmathbr@scriptsmode + % nop +\or + \AtBeginDocument{\catcode`\^=12\mathcode`\^=32768\catcode`\_=12\mathcode`\_=32768} +\or + \AtBeginDocument{\catcode`\^\active\catcode`\_\active} +\fi % \end{macrocode} +% +% Store original penalty values (via mathchardef trick). +% \begin{macrocode} +\mathchardef\rmathbr@orig@relpenalty=\relpenalty +\mathchardef\rmathbr@orig@binoppenalty=\binoppenalty +% \end{macrocode} +% +% Independent hyphen penalties are supported by LuaTeX only. That's why we save +% default penalty to \verb|\exhyphenpenalty| (as \verb|\exhyphenpenalty| will +% be actual penalty for math breaks in \TeX{} and XeTeX). +% \begin{macrocode} +\ifluatex\else + \exhyphenpenalty=\relpenalty +\fi +% \end{macrocode} +% % Disable default breaks. % \begin{macrocode} \relpenalty=13131 \binoppenalty=14141 % \end{macrocode} -% First symbol in equation is nonbreakable. +% \begin{macro}{\everymath} +% First symbol/command in equation is nonbreakable. % \begin{macrocode} \expandafter\everymath\expandafter{\the\everymath\nobr } % \end{macrocode} -% Setup sub- and superscripts. +% \end{macro} +% Save some characters definitions. +% \begin{macro}{\rmathbr@superscript@std} % \begin{macrocode} -\ifnum\catcode`\^=12% - \begingroup% - \catcode`\^\active - \global\let\rmathbr@superscript@text=^% - \endgroup% -\else% - \let\rmathbr@superscript@text=^% -\fi -\ifnum\catcode`\_=12% - \begingroup% - \catcode`\_\active - \global\let\rmathbr@subscript@text=_% - \endgroup% -\else% - \let\rmathbr@subscript@text=_% -\fi +\begingroup\catcode`\^=7 \global\let\rmathbr@superscript@std=^\endgroup +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@superscript@other} +% \begin{macrocode} +\begingroup\catcode`\^=12\global\let\rmathbr@superscript@other=^\endgroup % \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@subscript@std} +% \begin{macrocode} +\begingroup\catcode`\_=8 \global\let\rmathbr@subscript@std=_\endgroup +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@subscript@other} +% \begin{macrocode} +\begingroup\catcode`\_=12\global\let\rmathbr@subscript@other=_\endgroup +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@prime} +% \begin{macrocode} +\begingroup\catcode`\'=12\global\let\rmathbr@prime='\endgroup +% \end{macrocode} +% \end{macro} % % \begin{macro}{\rmathbr@superscript} % \begin{macrocode} -\def\rmathbr@superscript#1{\rmathbr@superscript@text{{#1}}} +\def\rmathbr@superscript#1{\rmathbr@superscript@std{{#1}}} % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@subscript} % \begin{macrocode} -\def\rmathbr@subscript#1{\rmathbr@subscript@text{{#1}}} +\def\rmathbr@subscript#1{\rmathbr@subscript@std{{#1}}} % \end{macrocode} % \end{macro} % +% Setup sub- and superscripts. % \begin{macrocode} \begingroup \catcode`\^\active\gdef^{\rmathbr@superscript} \catcode`\_\active\gdef_{\rmathbr@subscript} \endgroup % \end{macrocode} -% Save existing commands. +% % \begin{macrocode} -\begingroup\catcode`\_=13\catcode`\^=13\lowercase{\endgroup -\AtBeginDocument% -{% - \ifnum\catcode`\^=13 - \let\rmathbr@superscript@text@active=^ - \DeclareRobustCommand{\rmathbrsuperscript}[1]{\rmathbr@superscript@text@active{{#1}}} - \else - \DeclareRobustCommand{\rmathbrsuperscript}[1]{\rmathbr@superscript@text{{#1}}} - \fi - \def^{\rmathbrsuperscript} - \def\rmathbr@superscript@macro{\rmathbrsuperscript} - \ifnum\catcode`\_=13 - \let\rmathbr@subscript@text@active=_ - \DeclareRobustCommand{\rmathbrsubscript}[1]{\rmathbr@subscript@text@active{{#1}}} - \else - \DeclareRobustCommand{\rmathbrsubscript}[1]{\rmathbr@subscript@text{{#1}}} - \fi - \def_{\rmathbrsubscript} - \def\rmathbr@subscript@macro{\rmathbrsubscript} -}} +\newif\ifrmathbr@activemathchar % \end{macrocode} -% Process options. +% Check for XeTeX/LuaTeX % \begin{macrocode} -\DeclareOption{mathactivechars}% -{ - \catcode`\^=12\catcode`\_=12 -} -\DeclareOption{activechars}% -{ - \catcode`\^\active\catcode`\_\active -} -\DeclareOption{noactivechars}% -{ - \catcode`\^=7\catcode`\_=8 -} -\ExecuteOptions{mathactivechars}% -\ProcessOptions +\ifx\Umathcode\@undefined % \end{macrocode} -% Basic math. +% Standard TeX +% \begin{macro}{\rmathbr@checkmathchar} % \begin{macrocode} -\begingroup - \catcode`\=\active - \ifnum\mathcode`\=<32768 - \xdef={\noexpand\brokenbin{\mathchar\number\mathcode`\=}} - \else - \gdef={\brokenbin{\mathchar12349}} - \fi -\endgroup -\begingroup - \catcode`\+\active - \ifnum\mathcode`\+<32768 - \xdef+{\noexpand\brokenbin{\mathchar\number\mathcode`\+}} - \else - \gdef+{\brokenbin{\mathchar8235}} - \fi -\endgroup -\begingroup - \catcode`\-\active - \ifnum\mathcode`\-<32768 - \xdef-{\noexpand\brokenbin{\mathchar\number\mathcode`\-}} - \else - \gdef-{\brokenbin{\mathchar8704}} - \fi -\endgroup -\begingroup - \catcode`\*\active - \ifnum\mathcode`\*<32768 - \xdef*{\noexpand\brokenbin{\mathchar\number\mathcode`\*}} - \else - \gdef*{\brokenbin{\mathchar8707}} - \fi -\endgroup -\begingroup - \ifnum\mathcode`\<<32768 - \catcode`\<\active - \xdef<{\noexpand\brokenbin{\mathchar\number\mathcode`\<}} - \else - \catcode`\<\active - \gdef<{\brokenbin{\mathchar12604}} - \fi -\endgroup -\begingroup - \catcode`\>\active - \ifnum\mathcode`\><32768 - \xdef>{\noexpand\brokenbin{\mathchar\number\mathcode`\>}} - \else - \gdef>{\brokenbin{\mathchar12606}} - \fi -\endgroup -\begingroup - \catcode`\(\active - \xdef({\mathopen\delimiter\number\delcode`\(\noexpand\nobr } -\endgroup -\begingroup - \catcode`\[\active %\] - \xdef[{\mathopen\delimiter\number\delcode`\[\noexpand\nobr } -\endgroup -\AtBeginDocument% -{ - \mathcode`\==32768% "8000 - \mathcode`\<=32768 - \mathcode`\>=32768 - \mathcode`\+=32768 - \mathcode`\-=32768 - \mathcode`\*=32768 - \mathcode`\_=32768 - \mathcode`\^=32768 - \mathcode`\(=32768 - \mathcode`\[=32768 %\] - \mathcode`\:=32768 - \mathcode`\,=32768 - \mathcode`\;=32768 - \let\rmathbr@orig@resetMathstrut=\resetMathstrut@ - \begingroup - \gdef\resetMathstrut@ - { - \mathcode`\(=16424% "4028 - \rmathbr@orig@resetMathstrut - \mathcode`\(=32768% "8000 - } - \gdef\newmcodes@ - { - \mathcode`\'=39 - \mathcode`\*=42 - \mathcode`\.=24890% "613A - \mathcode`\-=45 - \mathcode`\/=47 - \mathcode`\:=24634% "603A - \relax - } - \endgroup% -} -\begingroup - \catcode`\:\active \gdef:{\futurelet\rmathbr@let@token\rmathbr@colontest} -\endgroup + \def\rmathbr@checkmathchar#1{% + \ifnum\mathcode#1<32768\relax% + \rmathbr@activemathcharfalse% + \else% + \rmathbr@activemathchartrue% + \fi} % \end{macrocode} -% -% \begin{macro}{\rmathbr@colontest} -% Check for \verb|:=|. +% \end{macro} +% \begin{macro}{\rmathbr@mathchar} % \begin{macrocode} -\def\rmathbr@colontest% -{ - \ifx=\rmathbr@let@token - \expandafter\rmathbr@letsign - \else - \expandafter\rmathbr@colon - \fi -}% -\ifnum\mathcode`\:<32768 - \edef\rmathbr@letsign#1{\noexpand\brokenrel{\mathchar\number\mathcode`\:\mathchar\number\mathcode`\=}} - \edef\rmathbr@colon{\noexpand\brokenrel{\mathchar\number\mathcode`\:}} + \def\rmathbr@mathchar#1{\mathchar\number\mathcode#1} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@makeactivemathopen} +% \begin{macrocode} + \def\rmathbr@makeactivemathopen#1{% + \begingroup + \xdef\@tempa{\mathopen\delimiter\number\delcode#1 \noexpand\nobr } + \begingroup\lccode`~=#1\catcode#1\active\lowercase{\endgroup\xdef~}{\@tempa} + \endgroup +% \end{macrocode} +% \end{macro} +% \begin{macrocode} + } \else - \def\rmathbr@letsign#1{\brokenrel{\mathchar12346\mathchar12349}} - \def\rmathbr@colon{\brokenrel{\mathchar12346}} -\fi +% \end{macrocode} +% XeTeX/LuaTeX +% \begin{macro}{\rmathbr@activemathcode} +% \begin{macrocode} + \begingroup + \mathcode`\+="8000 + \xdef\rmathbr@activemathcode{\number\Umathcodenum`\+} + \endgroup % \end{macrocode} % \end{macro} -% -% Check for 'icomma' package and 'eulervm' package with 'icomma' option. +% \begin{macro}{\rmathbr@checkmathchar} % \begin{macrocode} -\begingroup - \catcode`\,\active - \@ifpackageloaded{icomma}% check for 'icomma' package - { - \expandafter\gdef\expandafter\sm@rtcomma\expandafter{\sm@rtcomma\nobr} - }{ - \ifx\domathcomma\undefined% check for 'eulervm' package with 'icomma' option - \ifnum\mathcode`\,<32768 - \xdef,{\mathpunct\mathchar\number\mathcode`\,\noexpand\nobr } + \def\rmathbr@checkmathchar#1{% + \ifnum\Umathcodenum#1=\rmathbr@activemathcode\relax% + \expandafter\rmathbr@activemathchartrue% + \else% + \expandafter\rmathbr@activemathcharfalse% + \fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@mathchar} +% \begin{macrocode} + \def\rmathbr@mathchar#1{\Umathcharnum\number\Umathcodenum#1} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@truncdiv} +% \begin{macrocode} + \def\rmathbr@truncdiv#1#2{((#1-(#2-1)/2)/#2)} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@modulo} +% \begin{macrocode} + \def\rmathbr@modulo#1#2{(#1-\rmathbr@truncdiv{#1}{#2}*#2)} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@makeactivemathopen} +% \begin{macrocode} + \def\rmathbr@makeactivemathopen#1{% + \begingroup + \def\@tempa{\Udelcodenum#1} + \ifnum\@tempa<"1000000 + \xdef\@tempb{\mathopen\delimiter\number\@tempa\space\noexpand\nobr } \else - \gdef,{\mathpunct\mathchar24891\nobr } + \xdef\@tempb{\mathopen\Udelimiter4 % +\number\numexpr\rmathbr@truncdiv{\rmathbr@modulo{\@tempa}{"40000000}}{"200000}\relax% +\space\number\numexpr\rmathbr@modulo{\@tempa}{"200000}\relax\noexpand\nobr } \fi + \begingroup\lccode`~=#1\catcode#1\active\expandafter\lowercase\expandafter% +{\expandafter\endgroup\expandafter\gdef\expandafter~\expandafter}\expandafter{\@tempb} + \endgroup +% \end{macrocode} +% \end{macro} +% \begin{macrocode} + } +\fi +% \end{macrocode} +% \begin{macro}{\rmathbr@makeactivemath} +% \begin{macrocode} +\def\rmathbr@makeactivemath#1#2#3{ + \begingroup + \rmathbr@checkmathchar{#1} + \lccode`~=#1 + \catcode#1\active + \ifrmathbr@activemathchar + \PackageWarning{rmathbr}{Redeclare active math #1 symbol to default mathchar value} + \lowercase{\gdef~}{#2{#3}} \else - \expandafter\gdef\expandafter\domathcomma\expandafter{\domathcomma\nobr} + \lowercase{\xdef~}{\noexpand#2{\rmathbr@mathchar{#1}}} \fi - } -\endgroup + \endgroup +} % \end{macrocode} -% -% Check for 'program' package. +% \end{macro} +% \begin{macro}{\rmathbr@makeactivemathpunct} % \begin{macrocode} -\begingroup - \catcode`\;\active - \@ifpackageloaded{program}% - { - \gdef;{\ifmmode\semicolon\;\nobr\else\@semicolon\fi} - }{ - \ifnum\mathcode`\;<32768 - \xdef;{\mathpunct\mathchar\number\mathcode`\;\noexpand\nobr } +\def\rmathbr@makeactivemathpunct#1#2{ + \begingroup + \rmathbr@checkmathchar{#1} + \lccode`~=#1 + \catcode#1\active + \ifrmathbr@activemathchar + \PackageWarning{rmathbr}{Redeclare active math #1 symbol to default mathchar value} + \lowercase{\gdef~}{\mathpunct#2\nobr } \else - \gdef;{\mathpunct\mathchar24635\nobr } + \lowercase{\xdef~}{\mathpunct\rmathbr@mathchar{#1} \noexpand\nobr } \fi - } -\endgroup + \endgroup +} % \end{macrocode} -% +% \end{macro} +% \begin{macrocode} +\newif\ifrmathbr@protected +% \end{macrocode} +% \begin{macro}{\rmathbr@ifprotected} +% \begin{macrocode} +\def\rmathbr@ifprotected#1{% + \rmathbr@protectedfalse + \edef\str@cmd{\string#1\space} + \edef\meaning@cmd{\meaning#1} + \def\str@contains##1##2{\begingroup\edef\x{\endgroup\noexpand\in@{##1}{##2}}\x} + \str@contains\str@cmd\meaning@cmd + \ifin@ + \str@contains{\string\protect\space}\meaning@cmd + \ifin@\rmathbr@protectedtrue\else + \str@contains{\string\x@protect\space}\meaning@cmd + \ifin@\rmathbr@protectedtrue\else + \str@contains{\string\@testopt\space}\meaning@cmd + \ifin@\rmathbr@protectedtrue\else + \str@contains{\string\@protected@testopt\space}\meaning@cmd + \ifin@\rmathbr@protectedtrue\fi + \fi + \fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\rmathbr@ReDeclareRobustCommand} +% Command without arguments % \begin{macrocode} -\def\rmathbr@ReDeclareRobustCommand#1#2% Command without arguments -{ +\def\rmathbr@ReDeclareRobustCommand#1#2{% \begingroup - \ifx#1\undefined + \ifx#1\@undefined \else \edef\var@orig@I{rmathbr@orig@\expandafter\@gobble\string#1} \edef\var@Ispace{\expandafter\@gobble\string#1 } \expandafter\ifx\csname\var@orig@I\endcsname\relax - \expandafter\ifx\csname\var@Ispace\endcsname\relax - \global\expandafter\let\csname\var@orig@I\endcsname#1 + \ifetex + \expandafter\global\expandafter\let\csname\var@orig@I\endcsname#1 \else - \global\expandafter\let\csname\var@orig@I\expandafter\endcsname\csname\var@Ispace\endcsname + \rmathbr@ifprotected#1 + \ifrmathbr@protected + \expandafter\global\expandafter\let\csname\var@orig@I\expandafter\endcsname% +\csname\var@Ispace\endcsname + \else + \expandafter\global\expandafter\let\csname\var@orig@I\endcsname#1 + \fi \fi \fi - \expandafter\gdef\csname\var@Ispace\endcsname{#2}% no arguments - \xdef#1{\noexpand\protect\expandafter\noexpand\csname\var@Ispace\endcsname} + \ifetex + \protected\gdef#1{#2} + \else + \expandafter\gdef\csname\var@Ispace\endcsname{#2}% no arguments + \xdef#1{\noexpand\protect\expandafter\noexpand\csname\var@Ispace\endcsname} + \fi \fi \endgroup% } % \end{macrocode} % \end{macro} -% % \begin{macro}{\rmathbr@ReDeclareRobustCommandI} +% Command with one argument % \begin{macrocode} -\def\rmathbr@ReDeclareRobustCommandI#1#2% Command with one argument -{ +\def\rmathbr@ReDeclareRobustCommandI#1#2{% \begingroup - \ifx#1\undefined + \ifx#1\@undefined \else \edef\var@orig@I{rmathbr@orig@\expandafter\@gobble\string#1} - \edef\var@Ispace{\expandafter\@gobble\string#1 } + \edef\var@Ispace{\expandafter\@gobble\string#1\space} \expandafter\ifx\csname\var@orig@I\endcsname\relax - \expandafter\ifx\csname\var@Ispace\endcsname\relax - \global\expandafter\let\csname\var@orig@I\endcsname#1 + \ifetex + \expandafter\global\expandafter\let\csname\var@orig@I\endcsname#1 \else - \global\expandafter\let\csname\var@orig@I\expandafter\endcsname\csname\var@Ispace\endcsname + \rmathbr@ifprotected#1 + \ifrmathbr@protected + \expandafter\global\expandafter\let\csname\var@orig@I\expandafter\endcsname% +\csname\var@Ispace\endcsname + \else + \expandafter\global\expandafter\let\csname\var@orig@I\endcsname#1 + \fi \fi \fi - \expandafter\gdef\csname\var@Ispace\endcsname##1{#2}% one argument - \xdef#1{\noexpand\protect\expandafter\noexpand\csname\var@Ispace\endcsname} + \ifetex + \protected\gdef#1##1{#2} + \else + \expandafter\gdef\csname\var@Ispace\endcsname##1{#2}% one argument + \xdef#1{\noexpand\protect\expandafter\noexpand\csname\var@Ispace\endcsname} + \fi \fi \endgroup% } % \end{macrocode} % \end{macro} -% -% +% \begin{macro}{\brokenrel} +% \begin{macrocode} +\rmathbr@ReDeclareRobustCommandI{\brokenrel}{\rmathbr@brokenrel{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\brokenbin} +% \begin{macrocode} +\rmathbr@ReDeclareRobustCommandI{\brokenbin}{\rmathbr@brokenbin{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\brokeninner} +% \begin{macrocode} +\rmathbr@ReDeclareRobustCommandI{\brokeninner}{\rmathbr@brokeninner{#1}}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\let\rmathbr@save@brokenrel=\brokenrel +\let\rmathbr@save@brokenbin@on=\brokenbin +\let\rmathbr@save@brokenbin=\brokenbin +\let\rmathbr@save@brokeninner=\brokeninner +% \end{macrocode} +% \begin{macro}{\rmathbr@brokenbinon} +% \begin{macrocode} +\def\rmathbr@brokenbinon{% + \let\rmathbr@save@brokenbin=\rmathbr@save@brokenbin@on + \ifx\brokenbin\@firstofone\else + \let\brokenbin=\rmathbr@save@brokenbin + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@brokenbinoff} +% \begin{macrocode} +\def\rmathbr@brokenbinoff{% + \let\rmathbr@save@brokenbin=\mathbin + \ifx\brokenbin\@firstofone\else + \let\brokenbin=\rmathbr@save@brokenbin + \fi +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\rmathbr@setbrokens} % \begin{macrocode} -\def\rmathbr@setbrokens% -{ - \rmathbr@ReDeclareRobustCommandI{\brokenbin}{\rmathbr@brokenbin{##1}} - \rmathbr@ReDeclareRobustCommandI{\brokenrel}{\rmathbr@brokenrel{##1}} - \rmathbr@ReDeclareRobustCommandI{\brokeninner}{\rmathbr@brokeninner{##1}}% +\def\rmathbr@setbrokens{% + \let\brokenrel=\rmathbr@save@brokenrel + \let\brokenbin=\rmathbr@save@brokenbin + \let\brokeninner=\rmathbr@save@brokeninner + \let\rmathbr@colontest=\rmathbr@save@colontest } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@unsetbrokens} % \begin{macrocode} -\def\rmathbr@unsetbrokens% -{ - \def\brokenbin##1{##1} - \def\brokenrel##1{##1} - \def\brokeninner##1{##1}% +\def\rmathbr@unsetbrokens{% + \let\brokenrel=\@firstofone + \let\brokenbin=\@firstofone + \let\brokeninner=\@firstofone + \let\rmathbr@colontest=\rmathbr@colon@std } % \end{macrocode} % \end{macro} -% -% -% \begin{macro}{\rmathbr@brokenbin} +% \begin{macro}{\rmathbr@brokenrel} % \begin{macrocode} -\def\rmathbr@brokenbin#1% -{ - \relax +\def\rmathbr@brokenrel#1{% \def\rmathbr@arg{#1} - \def\rmathbr@this{\rmathbr@brokenbin} - \def\rmathbr@output{\rmathbr@@brokenbin} + \let\rmathbr@this=\rmathbr@brokenrel + \let\rmathbr@output=\rmathbr@@brokenrel \futurelet\rmathbr@let@token\rmathbr@brokenop% } % \end{macrocode} % \end{macro} -% -% -% \begin{macro}{\rmathbr@brokenrel} +% \begin{macro}{\rmathbr@brokenbin} % \begin{macrocode} -\def\rmathbr@brokenrel#1% -{ - \relax +\def\rmathbr@brokenbin#1{% \def\rmathbr@arg{#1} - \def\rmathbr@this{\rmathbr@brokenrel} - \def\rmathbr@output{\rmathbr@@brokenrel} + \let\rmathbr@this=\rmathbr@brokenbin + \let\rmathbr@output=\rmathbr@@brokenbin \futurelet\rmathbr@let@token\rmathbr@brokenop% } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@brokeninner} % \begin{macrocode} -\def\rmathbr@brokeninner#1% -{ - \relax +\def\rmathbr@brokeninner#1{% \def\rmathbr@arg{#1} - \def\rmathbr@this{\rmathbr@brokeninner} - \def\rmathbr@output{\rmathbr@@brokeninner} + \let\rmathbr@this=\rmathbr@brokeninner + \let\rmathbr@output=\rmathbr@@brokeninner \futurelet\rmathbr@let@token\rmathbr@brokenop% } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@mathop} % \begin{macrocode} -\def\rmathbr@mathop#1% -{ - \relax +\def\rmathbr@mathop#1{% \def\rmathbr@arg{#1} - \def\rmathbr@this{\rmathbr@mathop} - \def\rmathbr@output{\rmathbr@@mathop} + \let\rmathbr@this=\rmathbr@mathop + \let\rmathbr@output=\rmathbr@@mathop \futurelet\rmathbr@let@token\rmathbr@brokenop% } % \end{macrocode} % \end{macro} -% -% -% \begin{macro}{\rmathbr@@brokenbin} +% \begin{macro}{\rmathbr@@brokenrel} +% LuaTeX only supports per-disc-node penalties % \begin{macrocode} -\def\rmathbr@@brokenbin#1% -{ +\def\rmathbr@@brokenrel#1{% \ifnum\lastpenalty=\relpenalty - \mathbin{#1} + \mathrel{#1} \else - \mathbin{#1} + \mathrel{#1} \ifx$\rmathbr@let@token \else - \rmathbr@selector{#1} + \begingroup + \hyphenpenalty\rmathbr@orig@relpenalty + \rmathbr@selector{#1} + \endgroup \fi \fi \rmathbr@setbrokens - \penalty\binoppenalty % + \penalty\relpenalty % } % \end{macrocode} % \end{macro} -% -% -% \begin{macro}{\rmathbr@@brokenrel} +% \begin{macro}{\rmathbr@@brokenbin} % \begin{macrocode} -\def\rmathbr@@brokenrel#1% -{ +\def\rmathbr@@brokenbin#1{% \ifnum\lastpenalty=\relpenalty - \mathrel{#1} + \mathbin{#1} \else - \mathrel{#1} + \mathbin{#1} \ifx$\rmathbr@let@token \else - \rmathbr@selector{#1} + \begingroup + \hyphenpenalty\rmathbr@orig@binoppenalty + \rmathbr@selector{#1} + \endgroup \fi \fi \rmathbr@setbrokens - \penalty\relpenalty % + \penalty\binoppenalty % } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@@brokeninner} % \begin{macrocode} -\def\rmathbr@@brokeninner#1% -{ +\def\rmathbr@@brokeninner#1{% \ifnum\lastpenalty=\relpenalty \mathinner{#1} \else \mathinner{#1} \ifx$\rmathbr@let@token \else - \rmathbr@selector{#1} + \begingroup + \hyphenpenalty\rmathbr@orig@relpenalty + \rmathbr@selector{#1} + \endgroup \fi \fi \rmathbr@setbrokens @@ -784,23 +1043,17 @@ } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@@mathop} % \begin{macrocode} -\def\rmathbr@@mathop#1% -{ +\def\rmathbr@@mathop#1{% \rmathbr@setbrokens #1\nobr % } % \end{macrocode} % \end{macro} -% -% % \begin{macro}{\rmathbr@selector} % \begin{macrocode} -\def\rmathbr@selector#1% -{ +\def\rmathbr@selector#1{% \mathchoice {\discretionary{}{\hbox{$\m@th\displaystyle#1$}}{}} {\discretionary{}{\hbox{$\m@th\textstyle#1$}}{}} @@ -809,33 +1062,30 @@ } % \end{macrocode} % \end{macro} -% \begin{macrocode} -\begingroup\catcode`\_=12\catcode`\^=12 -% \end{macrocode} -% % \begin{macro}{\rmathbr@brokenop} % \begin{macrocode} -\gdef\rmathbr@brokenop% -{ +\def\rmathbr@brokenop{% \ifmmode \rmathbr@unsetbrokens - \ifx\rmathbr@subscript@macro\rmathbr@let@token + \ifx\rmathbr@subscript@std\rmathbr@let@token \let\@command=\rmathbr@brokenglue - \else\ifx_\rmathbr@let@token + \else\ifx\rmathbr@subscript@other\rmathbr@let@token \let\@command=\rmathbr@brokenglue - \else\ifx\rmathbr@superscript@macro\rmathbr@let@token + \else\ifx\rmathbr@superscript@std\rmathbr@let@token \let\@command=\rmathbr@brokenglue - \else\ifx^\rmathbr@let@token + \else\ifx\rmathbr@superscript@other\rmathbr@let@token \let\@command=\rmathbr@brokenglue \else\ifx\limits\rmathbr@let@token \let\@command=\rmathbr@brokenskip \else\ifx\nolimits\rmathbr@let@token \let\@command=\rmathbr@brokenskip + \else\ifx\rmathbr@prime\rmathbr@let@token + \let\@command=\rmathbr@brokenskip \else\ifx\relax\rmathbr@let@token \let\@command=\rmathbr@brokenskip \else \let\@command=\rmathbr@output - \fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi \else \let\@command=\relax \fi @@ -843,57 +1093,67 @@ } % \end{macrocode} % \end{macro} -% \begin{macrocode} -\endgroup -% \end{macrocode} -% % \begin{macro}{\rmathbr@brokenglue} % \begin{macrocode} -\def\rmathbr@brokenglue#1#2#3% -{ +\def\rmathbr@brokenglue#1#2#3{% \def\rmathbr@temp{#1#2{#3}} \expandafter\rmathbr@this\expandafter{\rmathbr@temp}% } % \end{macrocode} % \end{macro} -% % \begin{macro}{\rmathbr@brokenskip} % \begin{macrocode} -\def\rmathbr@brokenskip#1#2% -{ +\def\rmathbr@brokenskip#1#2{% \def\rmathbr@temp{#1#2} \expandafter\rmathbr@this\expandafter{\rmathbr@temp}% } % \end{macrocode} % \end{macro} % +% +% % \begin{macro}{\rmathbr@setbreakable} % \begin{macrocode} -\def\rmathbr@setbreakable#1#2% -{ +\def\rmathbr@setbreakable#1#2{% \begingroup - \ifx#1\undefined + \ifx#1\@undefined \else \edef\rmathbr@orig{rmathbr@orig@\expandafter\@gobble\string#1} \expandafter\ifx\csname\rmathbr@orig\endcsname\relax - \expandafter\rmathbr@ReDeclareRobustCommand\expandafter#1\expandafter{\expandafter#2\expandafter{\csname\rmathbr@orig\endcsname}} + \expandafter\rmathbr@ReDeclareRobustCommand\expandafter#1\expandafter{% +\expandafter#2\expandafter{\csname\rmathbr@orig\endcsname}} \fi \fi \endgroup% } % \end{macrocode} % \end{macro} -% % \begin{macro}{\rmathbr@nobrafter} % \begin{macrocode} -\def\rmathbr@nobrafter#1% -{ +\def\rmathbr@nobrafter#1{% \begingroup - \ifx#1\undefined + \ifx#1\@undefined \else \edef\rmathbr@orig{rmathbr@orig@\expandafter\@gobble\string#1} \expandafter\ifx\csname\rmathbr@orig\endcsname\relax - \expandafter\rmathbr@ReDeclareRobustCommand\expandafter#1\expandafter{\csname\rmathbr@orig\endcsname\nobr} + \expandafter\rmathbr@ReDeclareRobustCommand\expandafter#1\expandafter{% +\csname\rmathbr@orig\endcsname\nobr} + \fi + \fi + \endgroup% +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@unsetbroken} +% \begin{macrocode} +\def\rmathbr@unsetbroken#1{ + \begingroup + \ifx#1\@undefined + \else + \edef\rmathbr@orig{rmathbr@orig@\expandafter\@gobble\string#1} + \expandafter\ifx\csname\rmathbr@orig\endcsname\relax + \else + \expandafter\global\expandafter\let\expandafter#1\csname\rmathbr@orig\endcsname \fi \fi \endgroup% @@ -903,26 +1163,234 @@ % % \subsection*{Redeclaration of math signs} % +% \begin{macro}{\rmathbr@patch@commands} +% \begin{macrocode} +\def\rmathbr@patch@commands{% +% \end{macrocode} +% \end{macro} +% +% Basic math. +% \begin{macro}{=} +% \begin{macrocode} +\rmathbr@makeactivemath{`\=}{\brokenrel}{\mathchar12349} +% \end{macrocode} +% \end{macro} +% \begin{macro}{<} +% \begin{macrocode} +\rmathbr@makeactivemath{`\<}{\brokenrel}{\mathchar12604} +% \end{macrocode} +% \end{macro} +% \begin{macro}{>} +% \begin{macrocode} +\rmathbr@makeactivemath{`\>}{\brokenrel}{\mathchar12606} +% \end{macrocode} +% \end{macro} +% \begin{macro}{+} +% \begin{macrocode} +\rmathbr@makeactivemath{`\+}{\brokenbin}{\mathchar8235} +% \end{macrocode} +% \end{macro} +% \begin{macro}{-} +% \begin{macrocode} +\ifrmathbr@kv@brokenminus + \rmathbr@makeactivemath{`\-}{\brokenbin}{\mathchar8704} +\fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{*} +% \begin{macrocode} +\rmathbr@makeactivemath{`\*}{\brokenbin}{\mathchar8707} +% \end{macrocode} +% \end{macro} +% \begin{macro}{(} +% \begin{macrocode} +\rmathbr@makeactivemathopen{`\(} +% \end{macrocode} +% \end{macro} +% \begin{macro}{[} +% \begin{macrocode} +\rmathbr@makeactivemathopen{`\[} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{,} +% Check for the \textsf{icomma} package and the \textsf{eulervm} package with \verb|icomma| option. +% \begin{macrocode} +\@ifpackageloaded{icomma}{% + \expandafter\def\expandafter\sm@rtcomma\expandafter{\sm@rtcomma\nobr} +}{ + \ifx\domathcomma\@undefined% + \rmathbr@makeactivemathpunct{`\,}{\mathchar24891} + \else% + \expandafter\def\expandafter\domathcomma\expandafter{\domathcomma\nobr} + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{;} +% Check for the \textsf{program} package. +% \begin{macrocode} +\@ifpackageloaded{program}{% + \begingroup + \catcode`\;\active + \lccode`\~=`\;% + \lowercase{\gdef~}{\ifmmode\semicolon\;\nobr\else\@semicolon\fi} + \endgroup +}{ + \rmathbr@makeactivemathpunct{`\;}{\mathchar24635} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{:} +% Some extra code is necessary to distinguish between binary operation |:| and +% relation |:=|. +% \begin{macrocode} +\begingroup% + \catcode`\:\active% + \lccode`\~=`\:% + \lowercase{\gdef~}{\rmathbr@colontest}% +\endgroup +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@colontest} +% Check for \verb|:=|. +% \begin{macrocode} +\def\rmathbr@colontest{\futurelet\rmathbr@let@token\rmathbr@do@colontest} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\rmathbr@do@colontest} +% \begin{macrocode} +\def\rmathbr@do@colontest{% + \ifx=\rmathbr@let@token + \expandafter\rmathbr@letsign + \else + \expandafter\rmathbr@colon + \fi +}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\rmathbr@checkmathchar{`\:} +% \end{macrocode} +% \begin{macrocode} +\ifrmathbr@activemathchar +% \end{macrocode} +% \begin{macrocode} + \PackageWarning{rmathbr}{Redeclare active math `\: symbol to default mathchar value} +% \end{macrocode} +% \begin{macrocode} + \def\rmathbr@colon@std{\mathchar12346} +% \end{macrocode} +% \begin{macrocode} + \ifrmathbr@kv@brokencolon + \def\rmathbr@colon{\brokenbin{\rmathbr@colon@std}} + \else + \def\rmathbr@colon{\mathbin{\rmathbr@colon@std}} + \fi +% \end{macrocode} +% \begin{macrocode} + \def\rmathbr@letsign##1{\brokenrel{\rmathbr@colon@std\mathchar12349}} +% \end{macrocode} +% \begin{macrocode} +\else +% \end{macrocode} +% \begin{macrocode} + \edef\rmathbr@colon@std{\rmathbr@mathchar{`\:}} +% \end{macrocode} +% \begin{macrocode} + \ifrmathbr@kv@brokencolon + \def\rmathbr@colon{\brokenbin{\rmathbr@colon@std}} + \else + \def\rmathbr@colon{\mathbin{\rmathbr@colon@std}} + \fi +% \end{macrocode} +% \begin{macrocode} + \edef\rmathbr@letsign##1{\noexpand\brokenrel{\rmathbr@colon@std\rmathbr@mathchar{`\=}}} +% \end{macrocode} +% \begin{macrocode} +\fi +% \end{macrocode} +% \begin{macrocode} +\let\rmathbr@save@colontest=\rmathbr@colontest% +% \end{macrocode} +% Support of \textsf{unicode-math} package +% \begin{macrocode} +\@ifpackageloaded{unicode-math}{ + \begingroup + \def\UnicodeMathSymbol##1##2##3##4{% + \ifnum\number##1>127\relax + \expandafter\let\expandafter\@char\Uchar\number##1\relax + \ifx\@char##2\relax + \let\cmd\relax + \ifx##3\mathrel + \def\cmd{\brokenrel} + \else\ifx##3\mathbin + \def\cmd{\brokenbin} + \else\ifx##3\mathop + \def\cmd{\rmathbr@mathop} + \else\ifx##3\mathpunct + \let\cmd=\nobr + \fi\fi\fi\fi + \ifx\cmd\relax\else + \edef\var@orig@name{rmathbr@orig@\expandafter\@gobble\string##2} + \expandafter\def\expandafter\var@orig\expandafter{\csname\var@orig@name\endcsname} + \rmathbr@checkmathchar{\number##1} + \ifrmathbr@activemathchar + \begingroup + \lccode`~=\number##1 + \catcode\number##1\active + \lowercase{\endgroup\expandafter\global\expandafter\let\var@orig~} + \else + \expandafter\xdef\var@orig{\rmathbr@mathchar{\number##1}} + \global\mathcode\number##1="8000 + \fi + \ifx\cmd\nobr + \edef\@tempa{\expandafter\noexpand\var@orig\noexpand\nobr} + \else + \edef\@tempa{\expandafter\noexpand\cmd{\expandafter\noexpand\var@orig}} + \fi + \begingroup + \lccode`~=\number##1 + \catcode\number##1\active + \lowercase{\endgroup\expandafter\gdef\expandafter~\expandafter}{\@tempa} + \fi + \fi + \fi + } + \let\par=\relax + \catcode`\"=12 + \@@input{unicode-math-table.tex} + \endgroup +}{} +% \end{macrocode} +% +% \begin{macro}{\not} % Redeclare \verb|\not|. % \begin{macrocode} -\rmathbr@ReDeclareRobustCommandI{\not}% -{ +\rmathbr@ReDeclareRobustCommandI{\not}{% \begingroup - \edef\rmathbr@orig{rmathbr@orig@\expandafter\@gobble\string#1} - \expandafter\ifx\csname\rmathbr@orig\endcsname\relax - \brokenrel{\rmathbr@orig@not#1} + \edef\rmathbr@orig{rmathbr@orig@\expandafter\@gobble\string##1} + \expandafter\let\expandafter\rmathbr@origmacro\csname\rmathbr@orig\endcsname + \ifx\rmathbr@origmacro##1\relax + \begingroup + \let##1=\rmathbr@origmacro + \brokenrel{\rmathbr@orig@not##1} + \endgroup \else - \expandafter\brokenrel\expandafter{\expandafter\rmathbr@orig@not\csname\rmathbr@orig\endcsname} + \brokenrel{\rmathbr@orig@not##1} \fi \endgroup% } % \end{macrocode} +% \end{macro} % Open brackets. % \begin{macrocode} -\rmathbr@ReDeclareRobustCommandI{\bigl}{\rmathbr@mathop{\mathopen\big#1}} -\rmathbr@ReDeclareRobustCommandI{\Bigl}{\rmathbr@mathop{\mathopen\Big#1}} -\rmathbr@ReDeclareRobustCommandI{\biggl}{\rmathbr@mathop{\mathopen\bigg#1}} -\rmathbr@ReDeclareRobustCommandI{\Biggl}{\rmathbr@mathop{\mathopen\Bigg#1}} +\rmathbr@ReDeclareRobustCommandI{\bigl}{\rmathbr@mathop{\mathopen\big##1}} +\rmathbr@ReDeclareRobustCommandI{\Bigl}{\rmathbr@mathop{\mathopen\Big##1}} +\rmathbr@ReDeclareRobustCommandI{\biggl}{\rmathbr@mathop{\mathopen\bigg##1}} +\rmathbr@ReDeclareRobustCommandI{\Biggl}{\rmathbr@mathop{\mathopen\Bigg##1}} \SetOpenBracket{\lmoustache} \SetOpenBracket{\langle} \SetOpenBracket{\lbrace} @@ -960,7 +1428,6 @@ \SetPunctuation{\colon} \SetPunctuation{\period} % \end{macrocode} -% % Binary Operations. % \begin{macrocode} \SetBreakableBin{\triangleleft} @@ -996,66 +1463,70 @@ \SetBreakableBin{\times} \SetBreakableBin{\cdot} % \end{macrocode} -% -% \begin{macro}{\cdott} +% \begin{macro}{\rmathbr@cdott} % \verb|\cdott| is \verb|\cdot| that is changed to \verb|\times| at break point. % \begin{macrocode} \def\rmathbr@cdott{% - %% inplace-expanded mathchoice from mathstyle.sty - \mathchoice{% - \mkern\medmuskip$% - \discretionary{\the\textfont2\char2}{\the\textfont2\char2}{\the\textfont2\char1}% - $\displaystyle\mkern\medmuskip% - }{% - \mkern\medmuskip$% - \discretionary{\the\textfont2\char2}{\the\textfont2\char2}{\the\textfont2\char1}% - $\textstyle\mkern\medmuskip% - }{% - $% - \discretionary{\the\scriptfont2\char2}{\the\scriptfont2\char2}{\the\scriptfont2\char1}% - $\scriptstyle% - }{% - $% - \discretionary{\the\scriptscriptfont2\char2}{\the\scriptscriptfont2\char2}{\the\scriptscriptfont2\char1}% - $\scriptscriptstyle% - } + $\begingroup\hyphenpenalty\rmathbr@orig@binoppenalty\discretionary% + {\hbox{$\m@th\rmathbr@orig@times$}}% + {\hbox{$\m@th\rmathbr@orig@times$}}% + {\hbox{$\m@th\mkern\medmuskip\rmathbr@orig@cdot\mkern\medmuskip$}}\endgroup$ } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\cdott} +% \begin{macrocode} \def\cdott{% - \ensuremath - \ifetex - \ifinner% - \ifnum\currentgrouptype=15\relax - \rmathbr@cdott + \ifmmode + \ifetex + \ifinner% + \ifnum\currentgrouptype=15\relax + \rmathbr@cdott + \else + \rmathbr@orig@cdot + \fi \else - \cdot + \rmathbr@orig@cdot \fi \else - \cdot + \rmathbr@cdott \fi \else - \rmathbr@cdott + \rmathbr@orig@cdot \fi } % \end{macrocode} % \end{macro} -% +% \begin{macro}{\cdot} +% \begin{macrocode} +\ifrmathbr@kv@cdottimes + \let\cdot\cdott +\fi +% \end{macrocode} +% \end{macro} % \begin{macro}{\*} % \begin{macrocode} \def\*{\mathbin{}% - \mathchoice{% - \discretionary{\hbox{$\m@th\displaystyle\times$}}{\hbox{$\m@th\displaystyle\times$}}{}% - }{% - \discretionary{\hbox{$\m@th\textstyle\times$}}{\hbox{$\m@th\textstyle\times$}}{}% - }{% - \discretionary{\hbox{$\m@th\scriptstyle\times$}}{\hbox{$\m@th\scriptstyle\times$}}{}% - }{% - \discretionary{\hbox{$\m@th\scriptscriptstyle\times$}}{\hbox{$\m@th\scriptscriptstyle\times$}}{}% - }% + \begingroup% + \hyphenpenalty\rmathbr@orig@binoppenalty% + \mathchoice{% + \discretionary{\hbox{$\m@th\displaystyle\mkern\thinmuskip\times$}}% +{\hbox{$\m@th\displaystyle\times\mkern\thinmuskip$}}{}% + }{% + \discretionary{\hbox{$\m@th\textstyle\mkern\thinmuskip\times$}}% +{\hbox{$\m@th\textstyle\times\mkern\thinmuskip$}}{}% + }{% + \discretionary{\hbox{$\m@th\scriptstyle\mkern\thinmuskip\times$}}% +{\hbox{$\m@th\scriptstyle\times\mkern\thinmuskip$}}{}% + }{% + \discretionary{\hbox{$\m@th\scriptscriptstyle\mkern\thinmuskip\times$}}% +{\hbox{$\m@th\scriptscriptstyle\times\mkern\thinmuskip$}}{}% + }% + \endgroup% \penalty\binoppenalty% } % \end{macrocode} % \end{macro} -% % Relations. % \begin{macrocode} \SetBreakableRel{\propto} @@ -1123,7 +1594,7 @@ \SetBreakableRel{\hookrightarrow} \SetBreakableRel{\rightleftharpoons} % \end{macrocode} -% From latexsym. +% Commands from \textsf{latexsym}. % \begin{macrocode} \SetBreakableBin{\lhd} \SetBreakableBin{\unlhd} @@ -1134,10 +1605,9 @@ \SetBreakableRel{\sqsubset} \SetBreakableRel{\sqsupset} % \end{macrocode} -% amsfonts +% Support \textsf{amsfonts} package % \begin{macrocode} -\@ifpackageloaded{amsfonts}% amsfonts -{ +\@ifpackageloaded{amsfonts}{ \SetBreakableRel{\dashrightarrow} \SetBreakableRel{\dasharrow} \SetBreakableRel{\dashleftarrow} \SetBreakableRel{\vartriangleright} @@ -1147,10 +1617,9 @@ \SetBreakableRel{\rightsquigarrow} \SetBreakableRel{\leadsto} }{} % \end{macrocode} -% amssymb +% Support \textsf{amssymb} package % \begin{macrocode} -\@ifpackageloaded{amssymb}% amssymb -{ +\@ifpackageloaded{amssymb}{ \SetBreakableBin{\boxdot} \SetBreakableBin{\boxplus} \SetBreakableBin{\boxtimes} @@ -1330,10 +1799,9 @@ \SetBreakableRel{\backepsilon} }{} % \end{macrocode} -% amstex +% Support \textsf{amstex} package % \begin{macrocode} -\@ifpackageloaded{amstex}% amstex -{ +\@ifpackageloaded{amstex}{ \SetBreakableRel{\vartriangleright} \SetBreakableRel{\rhd} \SetBreakableRel{\vartriangleleft} \SetBreakableRel{\lhd} \SetBreakableRel{\trianglerighteq} \SetBreakableRel{\unrhd} @@ -1341,10 +1809,9 @@ \SetBreakableRel{\rightsquigarrow} \SetBreakableRel{\leadsto} }{} % \end{macrocode} -% boisik +% Support \textsf{boisik} package % \begin{macrocode} -\@ifpackageloaded{boisik}% boisik -{ +\@ifpackageloaded{boisik}{ \SetMathOperator{\intup} \SetOpenBracket{\binampersand} \SetBreakableRel{\upharpoonright} @@ -1745,10 +2212,9 @@ \SetBreakableRel{\leftrightarrowtriangle} }{} % \end{macrocode} -% euler +% Support \textsf{euler} package % \begin{macrocode} -\@ifpackageloaded{euler}% euler -{ +\@ifpackageloaded{euler}{% euler \SetBreakableRel{\uparrow} \SetBreakableRel{\downarrow} \SetBreakableRel{\updownarrow} @@ -1759,10 +2225,9 @@ % \SetBreakableRel{\rhook} }{} % \end{macrocode} -% fourier +% Support \textsf{fourier} package % \begin{macrocode} -\@ifpackageloaded{fourier}% fourier -{ +\@ifpackageloaded{fourier}{ \SetMathOperator{\iint} \SetMathOperator{\iiint} \SetMathOperator{\oiint} @@ -1793,10 +2258,9 @@ }{} % \end{macrocode} % -% Lucida font (lucbmath,lucidabr,lucmin,lucmtime,luctime) -% +% Support Lucida font packages (\textsf{lucbmath}, \textsf{lucidabr}, \textsf{lucmin}, +% \textsf{lucmtime}, \textsf{luctime}) % \begin{macrocode} - \ifnum\@ifpackageloaded{lucbmath}{1}{% \@ifpackageloaded{lucidabr}{1}{% \@ifpackageloaded{lucmin}{1}{% @@ -2005,36 +2469,52 @@ \SetBreakableRel{\backepsilon} \fi % \end{macrocode} -% mathbbol +% Support \textsf{mathbbol} package % \begin{macrocode} -\@ifpackageloaded{mathbbol}% mathbbol -{ +\@ifpackageloaded{mathbbol}{ \SetOpenBracket{\Langle} \SetOpenBracket{\Lparen} }{} % \end{macrocode} -% mdwmath +% Support \textsf{mathtools}/\textsf{empheq} packages +% \begin{macrocode} +\@ifpackageloaded{mathtools}{ + \SetBreakableRel{\vcentcolon} + \SetBreakableRel{\dblcolon} + \SetBreakableRel{\coloneqq} + \SetBreakableRel{\Coloneqq} + \SetBreakableRel{\coloneq} + \SetBreakableRel{\Coloneq} + \SetBreakableRel{\eqqcolon} + \SetBreakableRel{\Eqqcolon} + \SetBreakableRel{\eqcolon} + \SetBreakableRel{\Eqcolon} + \SetBreakableRel{\colonapprox} + \SetBreakableRel{\Colonapprox} + \SetBreakableRel{\colonsim} + \SetBreakableRel{\Colonsim} +}{} +% \end{macrocode} +% Support \textsf{mdwmath} package % \begin{macrocode} -\@ifpackageloaded{mdwmath}% mdwmath -{ +\@ifpackageloaded{mdwmath}{ \SetBreakableBin{\bitand} \begingroup - \catcode`\&\active \xdef&{\noexpand\brokenbin{\mathchar\number\mathcode`\&}} + \catcode`\&\active + \xdef&{\noexpand\brokenbin{\rmathbr@mathchar{`\&}}} \endgroup \AtBeginDocument{\mathcode`\&=32768 } }{} % \end{macrocode} -% sbmm +% Support \textsf{sbmm} package % \begin{macrocode} -\@ifpackageloaded{sbbm}% sbbm -{ +\@ifpackageloaded{sbbm}{ \SetOpenBracket{\Lparen} }{} % \end{macrocode} -% stmaryrd +% Support \textsf{stmaryrd} package % \begin{macrocode} -\@ifpackageloaded{stmaryrd}% stmaryrd -{ +\@ifpackageloaded{stmaryrd}{ \SetOpenBracket{\Lbag} \SetOpenBracket{\llparenthesis} \SetOpenBracket{\binampersand} @@ -2134,10 +2614,9 @@ \SetBreakableRel{\Longmapsfrom} }{} % \end{macrocode} -% wasysym +% Support \textsf{wasysym} package % \begin{macrocode} -\@ifpackageloaded{wasysym}% wasysym -{ +\@ifpackageloaded{wasysym}{ \SetMathOperator{\varint} \SetMathOperator{\iint} \SetMathOperator{\iiint} @@ -2153,6 +2632,87 @@ \SetBreakableRel{\logof} }{} % \end{macrocode} +% \begin{macrocode} +} % \rmathbr@patch@commands +% \end{macrocode} +% +% Execute \verb|\rmathbr@patch@commands| depending on options: +% \begin{macrocode} +\ifrmathbr@patch@begindocument + \AtBeginDocument{\rmathbr@patch@commands} +\else + \rmathbr@patch@commands +\fi +% \end{macrocode} +% +% Switch to active math mode at \verb|\begin{document}| +% \begin{macrocode} +\AtBeginDocument{% + \mathcode`\==32768% "8000 + \mathcode`\<=32768 + \mathcode`\>=32768 + \mathcode`\+=32768 + \ifrmathbr@kv@brokenminus + \mathcode`\-=32768 + \fi + \mathcode`\*=32768 + \mathcode`\(=32768 + \mathcode`\[=32768 %\] + \mathcode`\,=32768 + \mathcode`\;=32768 + \mathcode`\:=32768 + \@ifundefined{resetMathstrut@}{}{% fix amsmath + \let\rmathbr@orig@resetMathstrut=\resetMathstrut@ + \gdef\resetMathstrut@{% + \mathcode`\(=16424% "4028 + \rmathbr@orig@resetMathstrut + \mathcode`\(=32768% "8000 + } + \gdef\newmcodes@{% + \mathcode`\'=39 + \mathcode`\*=42 + \mathcode`\.=24890% "613A + \mathcode`\-=45 + \mathcode`\/=47 + \mathcode`\:=24634% "603A + \relax + } + }% +} +% \end{macrocode} +% +% Patch for \textsf{bm} package: +% \begin{macrocode} +\@ifpackageloaded{bm}{% + \let\rmathbr@save@bm@general=\bm@general + \def\bm@general#1#2#3#4#5{ + \rmathbr@save@bm@general{#1}{#2}{% + \let\nobr\copy + \def\brokenrel##1{\unvcopy{\brokenrel{##1}}} + \def\brokenbin##1{\unvcopy{\brokenbin{##1}}} + \def\brokeninner##1{\unvcopy{\brokeninner{##1}}} + \def\rmathbr@mathop##1{\unvcopy{\rmathbr@mathop{##1}}} + \begingroup\catcode`\_\active\lccode`\~`\_\lowercase{\endgroup\def~}##1{\unvcopy{_{##1}}} + \begingroup\catcode`\^\active\lccode`\~`\^\lowercase{\endgroup\def~}##1{\unvcopy{^{##1}}} + #3}{#4}{#5} + } + \PackageInfo{rmathbr}{Note: 'bm' package has been patched}{}% +}{} +% \end{macrocode} +% +% Patch for \textsf{xy} package: +% \begin{macrocode} +\@ifpackageloaded{xy}{% + \ifnum\rmathbr@scriptsmode>0\relax + \let\rmathbr@save@xy=\xy + \let\rmathbr@save@endxy=\endxy + \def\xy{\begingroup\catcode`\^7\catcode`\_8\rmathbr@save@xy} + \def\endxy{\rmathbr@save@endxy\endgroup} + \PackageInfo{rmathbr}{Note: \string\xy and \string\endxy commands from 'xy' + package have been patched}{}% + \fi +}{} +% \end{macrocode} % % \iffalse %</package> diff --git a/macros/latex/contrib/rmathbr/rmathbr.ins b/macros/latex/contrib/rmathbr/rmathbr.ins index 40f251e448..ca4c7f2ddc 100644 --- a/macros/latex/contrib/rmathbr/rmathbr.ins +++ b/macros/latex/contrib/rmathbr/rmathbr.ins @@ -1,4 +1,4 @@ -%% Copyright (C) 2008-2016 by Denis Ryabov <dryabov@yandex.ru> +%% Copyright (C) 2008-2020 by Denis Ryabov <dryabov@yandex.ru> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -25,7 +25,7 @@ This is a generated file. -Copyright (C) 2008-2016 by Denis Ryabov <dryabov@yandex.ru> +Copyright (C) 2008-2020 by Denis Ryabov <dryabov@yandex.ru> -------------------------------------------------------------------------- This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -45,9 +45,9 @@ version 2005/12/01 or later. \Msg{* To finish the installation you have to move the following *} \Msg{* file into a directory searched by TeX: *} \Msg{* *} -\Msg{* rmathbr.sty *} +\Msg{* rmathbr.sty *} \Msg{* *} -\Msg{* To produce the documentation run the file rmathbr.dtx *} +\Msg{* To produce the documentation run the file rmathbr.dtx *} \Msg{* through LaTeX. *} \Msg{* *} \Msg{* Happy TeXing! *} diff --git a/macros/latex/contrib/rmathbr/rmathbr.pdf b/macros/latex/contrib/rmathbr/rmathbr.pdf Binary files differindex 270819baf9..c5ded84ddb 100644 --- a/macros/latex/contrib/rmathbr/rmathbr.pdf +++ b/macros/latex/contrib/rmathbr/rmathbr.pdf |