etoolbox: AtBeginEnvironment is not At Begin EnvironmentRemove space after figure and before textSpacing around table and figure environmentsmultiple lists in etoolboxPhantom and etoolbox iftogglePackage etoolbox Warning: Patching 'begin' failed!Hide an environment and show it later in the documentetoolbox conflict with bm packageProblem changing spacing for equation environmentquestion of ifstrequal in etoolboxImage Not Found in Command with EtoolboxEnd mark switching fails because @ifnextchar's behavior in an environment hook is not as naively expectedObeylines and gappto from etoolbox
What is/are this/these giant NASA box(es)?
What is the indigenous Russian word for a wild boar?
Why would Lupin kill Pettigrew?
Can a helicopter mask itself from Radar?
Is this light switch installation safe and legal?
Beginner's snake game using PyGame
The deliberate use of misleading terminology
Can non-English-speaking characters use wordplay specific to English?
What does it mean when you think without speaking?
Strange math syntax in old basic listing
What does "tea juice" mean in this context?
Is floating in space similar to falling under gravity?
Select row of data if next row contains zero
Is it possible to kill all life on Earth?
When a current flow in an inductor is interrupted, what limits the voltage rise?
Comment dit-on « I’ll tell you what » ?
Can't connect to Internet in bash using Mac OS
If I create magical darkness with the Silent Image spell, can I see through it if I have the Devil's Sight warlock invocation?
Thousands and thousands of words
Is having a hidden directory under /etc safe?
Why do Russians call their women expensive ("дорогая")?
Self-Preservation: How to DM NPCs that Love Living?
How do I subvert the tropes of a train heist?
Why is there a need to modify system call tables in linux?
etoolbox: AtBeginEnvironment is not At Begin Environment
Remove space after figure and before textSpacing around table and figure environmentsmultiple lists in etoolboxPhantom and etoolbox iftogglePackage etoolbox Warning: Patching 'begin' failed!Hide an environment and show it later in the documentetoolbox conflict with bm packageProblem changing spacing for equation environmentquestion of ifstrequal in etoolboxImage Not Found in Command with EtoolboxEnd mark switching fails because @ifnextchar's behavior in an environment hook is not as naively expectedObeylines and gappto from etoolbox
I tried the following MWE:
documentclassarticle
usepackageetoolbox
AtBeginEnvironmenttableAtBeginEnvironmentpar
AtEndEnvironmenttableAtEndEnvironmentpar
BeforeBeginEnvironmenttableBeforeBeginEnvironmentpar
AfterEndEnvironmenttableAfterEndEnvironmentpar
begindocument
Text beforepar
begintable [t]%
Table textpar
endtable
Text afterpar
enddocument
and got the following result:
Table text
AtEndEnvironment
Text before
BeforeBeginEnvironment
AtBeginEnvironment
AfterEndEnvironment
Text after
I was expecting AtBeginEnvironment to travel to the top of the page together with the float.
Here is what the manual has to say on the matter:
AtBeginEnvironment<environment><code>
Appends arbitrary <code> to a hook executed by the begin command
at the beginning of a given <environment>, immediately before
<environment>, inside the group opened by begin.
I do not know what happens inside an environment definition; I guess it declares some special commands called <environment>
(e.g. table
) and end<environment>
(e.g. endtable
).
But in this case, shouldn't it be immediately after <environment>
, in order to be a complement to AtEndEnvironment
just as BeforeBeginEnvironment
is a complement to AfterEndEnvironment
?
Anyway, how can I add code to the beginning of an environment? I'm trying to set a certain font style for all tables, and AtBeginEnvironmenttablesmall
does not work. Also I guess this behavior makes this answer incorrect, because addvspace
would stay at the point of declaration of the figure instead of moving together with it.
etoolbox
add a comment |
I tried the following MWE:
documentclassarticle
usepackageetoolbox
AtBeginEnvironmenttableAtBeginEnvironmentpar
AtEndEnvironmenttableAtEndEnvironmentpar
BeforeBeginEnvironmenttableBeforeBeginEnvironmentpar
AfterEndEnvironmenttableAfterEndEnvironmentpar
begindocument
Text beforepar
begintable [t]%
Table textpar
endtable
Text afterpar
enddocument
and got the following result:
Table text
AtEndEnvironment
Text before
BeforeBeginEnvironment
AtBeginEnvironment
AfterEndEnvironment
Text after
I was expecting AtBeginEnvironment to travel to the top of the page together with the float.
Here is what the manual has to say on the matter:
AtBeginEnvironment<environment><code>
Appends arbitrary <code> to a hook executed by the begin command
at the beginning of a given <environment>, immediately before
<environment>, inside the group opened by begin.
I do not know what happens inside an environment definition; I guess it declares some special commands called <environment>
(e.g. table
) and end<environment>
(e.g. endtable
).
But in this case, shouldn't it be immediately after <environment>
, in order to be a complement to AtEndEnvironment
just as BeforeBeginEnvironment
is a complement to AfterEndEnvironment
?
Anyway, how can I add code to the beginning of an environment? I'm trying to set a certain font style for all tables, and AtBeginEnvironmenttablesmall
does not work. Also I guess this behavior makes this answer incorrect, because addvspace
would stay at the point of declaration of the figure instead of moving together with it.
etoolbox
add a comment |
I tried the following MWE:
documentclassarticle
usepackageetoolbox
AtBeginEnvironmenttableAtBeginEnvironmentpar
AtEndEnvironmenttableAtEndEnvironmentpar
BeforeBeginEnvironmenttableBeforeBeginEnvironmentpar
AfterEndEnvironmenttableAfterEndEnvironmentpar
begindocument
Text beforepar
begintable [t]%
Table textpar
endtable
Text afterpar
enddocument
and got the following result:
Table text
AtEndEnvironment
Text before
BeforeBeginEnvironment
AtBeginEnvironment
AfterEndEnvironment
Text after
I was expecting AtBeginEnvironment to travel to the top of the page together with the float.
Here is what the manual has to say on the matter:
AtBeginEnvironment<environment><code>
Appends arbitrary <code> to a hook executed by the begin command
at the beginning of a given <environment>, immediately before
<environment>, inside the group opened by begin.
I do not know what happens inside an environment definition; I guess it declares some special commands called <environment>
(e.g. table
) and end<environment>
(e.g. endtable
).
But in this case, shouldn't it be immediately after <environment>
, in order to be a complement to AtEndEnvironment
just as BeforeBeginEnvironment
is a complement to AfterEndEnvironment
?
Anyway, how can I add code to the beginning of an environment? I'm trying to set a certain font style for all tables, and AtBeginEnvironmenttablesmall
does not work. Also I guess this behavior makes this answer incorrect, because addvspace
would stay at the point of declaration of the figure instead of moving together with it.
etoolbox
I tried the following MWE:
documentclassarticle
usepackageetoolbox
AtBeginEnvironmenttableAtBeginEnvironmentpar
AtEndEnvironmenttableAtEndEnvironmentpar
BeforeBeginEnvironmenttableBeforeBeginEnvironmentpar
AfterEndEnvironmenttableAfterEndEnvironmentpar
begindocument
Text beforepar
begintable [t]%
Table textpar
endtable
Text afterpar
enddocument
and got the following result:
Table text
AtEndEnvironment
Text before
BeforeBeginEnvironment
AtBeginEnvironment
AfterEndEnvironment
Text after
I was expecting AtBeginEnvironment to travel to the top of the page together with the float.
Here is what the manual has to say on the matter:
AtBeginEnvironment<environment><code>
Appends arbitrary <code> to a hook executed by the begin command
at the beginning of a given <environment>, immediately before
<environment>, inside the group opened by begin.
I do not know what happens inside an environment definition; I guess it declares some special commands called <environment>
(e.g. table
) and end<environment>
(e.g. endtable
).
But in this case, shouldn't it be immediately after <environment>
, in order to be a complement to AtEndEnvironment
just as BeforeBeginEnvironment
is a complement to AfterEndEnvironment
?
Anyway, how can I add code to the beginning of an environment? I'm trying to set a certain font style for all tables, and AtBeginEnvironmenttablesmall
does not work. Also I guess this behavior makes this answer incorrect, because addvspace
would stay at the point of declaration of the figure instead of moving together with it.
etoolbox
etoolbox
edited 8 hours ago
ScumCoder
asked 8 hours ago
ScumCoderScumCoder
625512
625512
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The etoolbox
package redefines begin
so that
@beforebegin@<envname>@hook
is executed- the usual bookkeeping is performed (setting
@currenvir
, for instance) @begin@<envname>@hook
is executed
1 a group is started- the macro
<envname>
is executed
Thus what you get is
@beforebegin@table@hook
<bookkeeping>
@begin@table@hook
begingroup
table
The macro table
is responsible for starting the creation of a float and expands to @floattable
.
Thus the tokens AtBeginEnvironmentpar
and BeforeBeginEnvironmentpar
are seen and the paragraphs are typeset before the float is started.
To the contrary, end
is redefined to execute the AtEndEnvironment
tokens before end<envname>
is executed.
This should explain the output you get.
There is a hook for doing things when the float has already begun and is @floatboxreset
.
I would be wary of using the hooks for adding text: they're meant for additional setup.
@begin@table@hook
isn't inside the group?
– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.
– ScumCoder
7 hours ago
Also, I must add that I ended up usingsetfloatadjustment
command frommemoir
, on which I stumbled upon when I read your answer and started digging the@floatboxreset
.
– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in@floatboxreset
you just need to test@captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493087%2fetoolbox-atbeginenvironment-is-not-at-begin-environment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The etoolbox
package redefines begin
so that
@beforebegin@<envname>@hook
is executed- the usual bookkeeping is performed (setting
@currenvir
, for instance) @begin@<envname>@hook
is executed
1 a group is started- the macro
<envname>
is executed
Thus what you get is
@beforebegin@table@hook
<bookkeeping>
@begin@table@hook
begingroup
table
The macro table
is responsible for starting the creation of a float and expands to @floattable
.
Thus the tokens AtBeginEnvironmentpar
and BeforeBeginEnvironmentpar
are seen and the paragraphs are typeset before the float is started.
To the contrary, end
is redefined to execute the AtEndEnvironment
tokens before end<envname>
is executed.
This should explain the output you get.
There is a hook for doing things when the float has already begun and is @floatboxreset
.
I would be wary of using the hooks for adding text: they're meant for additional setup.
@begin@table@hook
isn't inside the group?
– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.
– ScumCoder
7 hours ago
Also, I must add that I ended up usingsetfloatadjustment
command frommemoir
, on which I stumbled upon when I read your answer and started digging the@floatboxreset
.
– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in@floatboxreset
you just need to test@captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
add a comment |
The etoolbox
package redefines begin
so that
@beforebegin@<envname>@hook
is executed- the usual bookkeeping is performed (setting
@currenvir
, for instance) @begin@<envname>@hook
is executed
1 a group is started- the macro
<envname>
is executed
Thus what you get is
@beforebegin@table@hook
<bookkeeping>
@begin@table@hook
begingroup
table
The macro table
is responsible for starting the creation of a float and expands to @floattable
.
Thus the tokens AtBeginEnvironmentpar
and BeforeBeginEnvironmentpar
are seen and the paragraphs are typeset before the float is started.
To the contrary, end
is redefined to execute the AtEndEnvironment
tokens before end<envname>
is executed.
This should explain the output you get.
There is a hook for doing things when the float has already begun and is @floatboxreset
.
I would be wary of using the hooks for adding text: they're meant for additional setup.
@begin@table@hook
isn't inside the group?
– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.
– ScumCoder
7 hours ago
Also, I must add that I ended up usingsetfloatadjustment
command frommemoir
, on which I stumbled upon when I read your answer and started digging the@floatboxreset
.
– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in@floatboxreset
you just need to test@captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
add a comment |
The etoolbox
package redefines begin
so that
@beforebegin@<envname>@hook
is executed- the usual bookkeeping is performed (setting
@currenvir
, for instance) @begin@<envname>@hook
is executed
1 a group is started- the macro
<envname>
is executed
Thus what you get is
@beforebegin@table@hook
<bookkeeping>
@begin@table@hook
begingroup
table
The macro table
is responsible for starting the creation of a float and expands to @floattable
.
Thus the tokens AtBeginEnvironmentpar
and BeforeBeginEnvironmentpar
are seen and the paragraphs are typeset before the float is started.
To the contrary, end
is redefined to execute the AtEndEnvironment
tokens before end<envname>
is executed.
This should explain the output you get.
There is a hook for doing things when the float has already begun and is @floatboxreset
.
I would be wary of using the hooks for adding text: they're meant for additional setup.
The etoolbox
package redefines begin
so that
@beforebegin@<envname>@hook
is executed- the usual bookkeeping is performed (setting
@currenvir
, for instance) @begin@<envname>@hook
is executed
1 a group is started- the macro
<envname>
is executed
Thus what you get is
@beforebegin@table@hook
<bookkeeping>
@begin@table@hook
begingroup
table
The macro table
is responsible for starting the creation of a float and expands to @floattable
.
Thus the tokens AtBeginEnvironmentpar
and BeforeBeginEnvironmentpar
are seen and the paragraphs are typeset before the float is started.
To the contrary, end
is redefined to execute the AtEndEnvironment
tokens before end<envname>
is executed.
This should explain the output you get.
There is a hook for doing things when the float has already begun and is @floatboxreset
.
I would be wary of using the hooks for adding text: they're meant for additional setup.
answered 7 hours ago
egregegreg
744k8919493288
744k8919493288
@begin@table@hook
isn't inside the group?
– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.
– ScumCoder
7 hours ago
Also, I must add that I ended up usingsetfloatadjustment
command frommemoir
, on which I stumbled upon when I read your answer and started digging the@floatboxreset
.
– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in@floatboxreset
you just need to test@captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
add a comment |
@begin@table@hook
isn't inside the group?
– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.
– ScumCoder
7 hours ago
Also, I must add that I ended up usingsetfloatadjustment
command frommemoir
, on which I stumbled upon when I read your answer and started digging the@floatboxreset
.
– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in@floatboxreset
you just need to test@captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
@begin@table@hook
isn't inside the group?– touhami
7 hours ago
@begin@table@hook
isn't inside the group?– touhami
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is
@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.– ScumCoder
7 hours ago
Thank you. > I would be wary of using the hooks for adding text: they're meant for additional setup. I'm wary too, I just used it to see what goes where. > There is a hook for doing things when the float has already begun and is
@floatboxreset.
That’s helpful, but alas, it does not allow to set different settings for different float types.– ScumCoder
7 hours ago
Also, I must add that I ended up using
setfloatadjustment
command from memoir
, on which I stumbled upon when I read your answer and started digging the @floatboxreset
.– ScumCoder
7 hours ago
Also, I must add that I ended up using
setfloatadjustment
command from memoir
, on which I stumbled upon when I read your answer and started digging the @floatboxreset
.– ScumCoder
7 hours ago
@ScumCoder you can put float-type specific code in
@floatboxreset
you just need to test @captype
– David Carlisle
7 hours ago
@ScumCoder you can put float-type specific code in
@floatboxreset
you just need to test @captype
– David Carlisle
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
@DavidCarlisle I'm afraid this is a bit too hardcore for me yet, I'll just settle for something more philistine for the time being :)
– ScumCoder
7 hours ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493087%2fetoolbox-atbeginenvironment-is-not-at-begin-environment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown