Comments (23)
Something like this I guess? (for both issues)
\documentclass{article}
\makeatletter
\def\big#1{{\leavevmode
\hbox{$\left#1\vbox to8.5\p@{}\right.\n@space$}}}
\usepackage{amsmath}
\def\bBigg@#1#2{%
{\leavevmode\check@mathfonts\@mathmeasure\z@{\nulldelimiterspace\z@}%
{\left#2\vcenter to#1\big@size{}\right.}%
\box\z@}}
\begin{document}
We claim that $16^{3^2} = (8^4)^3$.
\big(Recall that $x^{y^z}=x^{(y^z)}$.\big)
The number $\varphi$ \big(equal to $(1+\sqrt{5})/2$\marginpar{\tiny Golden ratio~$\varphi$.}\big) is nice.
\end{document}
from latex2e.
Actually might be better to put the \check@mathfonts
inside the \hbox
in the definition of \@mathmeasure
from latex2e.
Would it be better for \leavevmode
to be outside the group, to avoid possible issues with \everypar
being run in a group? I would expect something like \ifvmode\leavevmode\fi{....}
to be better. On the other hand \mbox
does {\leavevmode\hbox{...}}
so I suppose it's safe enough.
from latex2e.
@blefloch well I was worried about $x^\big($
which is pretty crazy markup but you never know.... also there may be other more reasonable cases that are implicitly grabbing a math {}
group.
from latex2e.
from latex2e.
At #50 Enrico points out a few other commands that don't have \leavevmode
, and if I understand him properly he suggests that that's fine because they are not documented in the LaTeX manual.
I would argue that at least \smash
should have \leavevmode
since it explicitly distinguishes math mode from non-math mode. Now it's possible actually that people want the vmode behaviour for \smash
?
from latex2e.
“he suggests that that's fine because they are not documented in the LaTeX manual.”
That maybe a reasonable argument for non-amsmath LaTeX, but when using amsmath, users expect, quite reasonably, to be able to use all the “plain math stuff” (with LaTeX conventions that keverything is in a paragraph’) except stuff that is clearly replaced by LaTeX stuff.
But it may be OK, in some cases, to insist on an explicit mathmode when using amsmath, unless it is clearly documented that they should work outside math.
I think that \smash \phantom etc., should do something sensible in vmode, but without starting a paragraph. Or maybe a *-variant for ‘in-para’ (or for the ‘no-para’) version.
from latex2e.
One of the cornerstones of LaTeX behavior is that everything that produces or acts on textual material ends up being or starting LR mode, i.e., Leslie tried hard to add \leavevmode in all such places to avoid the behavior of, say, \hbox that acts differently if at the start of paragraph (ie still being in vmode) or in the middle of it.
The downside of this approach is that sometimes you find yourself getting into LR mode when you really don't want it: good example is a tabular* or minipage of full \textwidth which gets an \indent added in front while one really want to have something filling the whole line.
However, because of the consisteny here it is understandable what happens and how to avoid it.
I therefore think that the correct LaTeX approach for \smash and \phantom is in fact starting LR mode including (implicitly adding the indentation if in vmode) and not staying in vmode, ie behave like mbox in that respect.
from latex2e.
from latex2e.
Actually in amsmath \big
doesn't work properly outside math mode and I'm not sure it is worth trying to fix as that would slow down all use of that code in documents. Of course that then begs the question if it is the right choice to allow \big
in std LaTeX outside math or make those math only. For \phantom
and \smash
it is clear that they can and are used in text, but for \big(ggg)
that is not so clear.
Here is an MWE with the problem:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
This is \big( no good \big)!
\setbox0\hbox{$ $}
But this \big( is \big).
\end{document}
Basically amsmath circumvents the font inits (under the assumption that \@mathmeasure
is only called in math mode) and so you may end up with unset math fonts if this is the first time that math is used.
from latex2e.
from latex2e.
from latex2e.
Whilst, from a typographic viewpoint, I would question the aesthetics of distinguishing these by making the text parentheses larger than normal, this (and presumably Bruno’s own detailed requirements) certainly show a need for such a distinction. However, it would be better to provide this possibility (together with smaller versions) with new text-mode commands.
from latex2e.
from latex2e.
from latex2e.
from latex2e.
from latex2e.
Is there not already a package that provides relative text sizes? Maybe even something like
\textbigger {(} ??
We did at some stage think of adding such to the 2e kernel.
from latex2e.
from latex2e.
from latex2e.
from latex2e.
from latex2e.
from latex2e.
Related Issues (20)
- fntguide: No redefinition information in the transcript file HOT 3
- `\AddToHook` broken in old lthooks release for undeclared hooks
- \verbatiminput* from the verbatim package vs TABs HOT 2
- Bad filehook-bug-140.lvt HOT 1
- Package textcomp Info: Symbol ... not provided by HOT 9
- Conditional statements syntax HOT 5
- `\dots` not working correctly with `\cong` HOT 4
- minor doc tweaks to ltfilehook HOT 2
- source2e documentation footers/ \ProvidesFile of base .dtx HOT 3
- Possible source2e improvements HOT 3
- Automatically adjust horizontal boxes in table of contents HOT 4
- Image upscaled for no apparent reason HOT 7
- Avoid option conflicts between classs and packages HOT 4
- Test more packages before publishing a new release HOT 14
- Reformatting examples in clsguide.tex HOT 5
- fpeval expands past its argument HOT 2
- New command: \__kernel_set_arg_to_keyvalue:Nnn HOT 4
- amsmath: `{align}` inherits line-depth of above `{gather}`, results in incorrect vertical placement tags HOT 3
- `\disable@package@load` ready to be used by third-party classes? HOT 1
- \if@reversemargin wrongly documented in source code HOT 1
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.