Comments (4)
we could pull \DOTSB out of the protection but I think it might be better to use \protected\def
and then make the lookahead cope with a \protected
meaning (similar to how we added support for \newcommand
aka \long\def
a while back)
from latex2e.
\documentclass{article}
% Any preamble code goes here
\usepackage{amsmath}
\makeatletter
{\uccode`9=`\p %
\uppercase{\gdef\stripprotected@#1#2#3\relax{%
\ifx9#2 \@xp\@xp\@xp\zap@to@space\fi}}}
\def\mdots@@{\gdef\thedots@{\dotso@}%
\ifx\@let@token\boldsymbol
\gdef\thedots@\boldsymbol{\boldsymboldots@}%
\else
\ifx,\@let@token \gdef\thedots@{\dotsc}%
\else
\ifx\not\@let@token
\gdef\thedots@{\dotsb@}%
\else
\keybin@
\ifgtest@ % if \keybin@ test
\gdef\thedots@{\dotsb@}%
\else
\xdef\meaning@{\meaning\@let@token. .........}%
\xdef\meaning@@{\@xp\striplong@\meaning@\relax\meaning@}%
% NEW BIT
\xdef\meaning@@{\@xp\stripprotected@\meaning@@\relax\meaning@@}%
% END NEW BIT
\@xp\math@\meaning@\math@
\ifgtest@ % if \mathxxx test
\@xp\mathch@\meaning@\mathch@
\ifgtest@ % if \mathchar
\@xp\getmathch@\meaning@\getmathch@
\fi % end if \mathchar
\else % \not \mathxxx
\@xp\Umathch@\meaning@"0"\Umathch@
\ifgtest@ % if \Umathchar
\else % else not \Umathcar
\@xp\macro@\meaning@@\macro@
\ifgtest@ % if macro test
\@xp\not@\meaning@\not@
\ifgtest@ % if macro starts \not test
\gdef\thedots@{\dotsb@}%
\else% else not \not
\@xp\DOTS@\meaning@\DOTS@
\ifgtest@ % \if DOTS
\ifcase\number\DOTSCASE@ %ifcase dots
\gdef\thedots@{\dotsb@}%
\or\gdef\thedots@{\dotsi}\else
\fi % endifcase dots
\else % not macro starts \DOTS
\@xp\math@\meaning@\math@
\ifgtest@ % \if macro starts \mathxxxx
\@xp\mathbin@\meaning@\mathbin@
\ifgtest@ % if macro starts \mathbin
\gdef\thedots@{\dotsb@}%
\else % not macro starting \mathbin
\@xp\mathrel@\meaning@\mathrel@
\ifgtest@ % if macro starts \mathrel
\gdef\thedots@{\dotsb@}%
\fi % endif macro starts \mathrel (no else)
\fi % endif macro starts \mathbin
\fi % endif macro starts with \mathxxx (no else)
\fi % endif macro starts \DOTS else
\fi % end macro starting \not \ifgtest@ test (no else)
\else
\@xp\thecharacter@\meaning@\thecharacter@
\fi % end macro \ifgtest@ test (no else)
\fi % end if \Umathchar test
\fi % end \math@ \ifgtest@
\fi % end \keybin@ \ifgtest@ test (no else)
\fi % end if \not (no else)
\fi % end if comma (no else)
\fi % end if boldsymbol (no else)
\thedots@}
\protected
\def
\cong{\mathrel{\mathpalette\@vereq\sim}} % congruence sign
\makeatother
\begin{document}
% Demonstration of issue here
$\equiv\dots\equiv$
$\cong\dots\cong$
\end{document}
from latex2e.
we could pull \DOTSB out of the protection but I think it might be better to use
\protected\def
and then make the lookahead cope with a\protected
meaning (similar to how we added support for\newcommand
aka\long\def
a while back)
agreed, but then we should alter this for all symbols that use \DOTSB etc, shouldn't we?
By the way where is \DOTSB in your code sample?
from latex2e.
agreed, but then we should alter this for all symbols that use \DOTSB etc, shouldn't we?
probably or at least such a change gives a way forward for that to work.
By the way where is \DOTSB in your code sample?
it is not needed as once the lookahead can get past the \protected
(or we could make it work with the existing \DeclareRobstCommand
\protect
version) then it sees the \mathrel
so defaults to centred dots just a it does with \equiv
in the example (which also has no \DOTS...
prefix).
from latex2e.
Related Issues (20)
- `\disable@package@load` ready to be used by third-party classes? HOT 1
- \if@reversemargin wrongly documented in source code HOT 1
- expansion of key-value package options differ on the first and second call HOT 2
- \IfInstanceExistTF unavailable in 2024-06-01 pre-release 1 HOT 9
- Adding a .dir-locals.el to the project root directory HOT 5
- \afterpage from afterpage package broken with recent distribution HOT 3
- Changes in horizontal spacing in some equations HOT 3
- CamelCase or Pascal case? HOT 3
- array package exhibits a surprising spacing difference when math cells end in explicit spaces
- `flushright` isn't right in rtl paragraphs HOT 13
- Loading `textcomp` turns `LaTeX Info` messages into `Package textcomp Info` messages HOT 22
- Rollback declarations should be improved in several files HOT 2
- \textcircled and TS1 missing circle. HOT 2
- \resizebox* mentioned but unexplained in grfguide? HOT 6
- Error in multicolumn environment with footnotes per page HOT 1
- Incorrect numbering and positioning of footnotes with multicols environment. HOT 5
- \overrightarrow and \overleftarrow paragraph start + documentation HOT 1
- trivial \Umathcar typo in amsmath.dtx
- Multicol with Right-to-Left Languages Misaligned on Last Page HOT 2
- Improvement to package rotating part of the graphics suit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latex2e.