Is it possible to force a package to be called last in the entirety of the LaTeX, when called in the class file? The 2019 Stack Overflow Developer Survey Results Are InProblem adding pdfpages to current class and/or tex filePackage options and RequirePackage: order of commands and option conflicts?LaTeX Error: File `knitting.sty' not found - cannot get knitting package to runLocal package inside other local packageApplying options to already loaded packageIs there a way to find out which packages are used (rather than merely called) by a document?How do I install LaTeX package on-the-fly on Mac?Modular LaTeX document preambles and class filesPossible LaTeX package to maintain simultaneous text translationsUnstable page numbering in aaltothesis class?
Is flight data recorder erased after every flight?
Is an up-to-date browser secure on an out-of-date OS?
What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?
Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?
Where to refill my bottle in India?
Did Section 31 appear in Star Trek: The Next Generation?
Deal with toxic manager when you can't quit
Why is the maximum length of OpenWrt’s root password 8 characters?
Is there a symbol for a right arrow with a square in the middle?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
I see my dog run
Can you compress metal and what would be the consequences?
What is the accessibility of a package's `Private` context variables?
Geography at the pixel level
How to support a colleague who finds meetings extremely tiring?
Is a "Democratic" Oligarchy-Style System Possible?
One word riddle: Vowel in the middle
Right tool to dig six foot holes?
Apparent duplicates between Haynes service instructions and MOT
Statement true because not provable
Output the Arecibo Message
Is this app Icon Browser Safe/Legit?
Identify This Plant (Flower)
What is the meaning of the verb "bear" in this context?
Is it possible to force a package to be called last in the entirety of the LaTeX, when called in the class file?
The 2019 Stack Overflow Developer Survey Results Are InProblem adding pdfpages to current class and/or tex filePackage options and RequirePackage: order of commands and option conflicts?LaTeX Error: File `knitting.sty' not found - cannot get knitting package to runLocal package inside other local packageApplying options to already loaded packageIs there a way to find out which packages are used (rather than merely called) by a document?How do I install LaTeX package on-the-fly on Mac?Modular LaTeX document preambles and class filesPossible LaTeX package to maintain simultaneous text translationsUnstable page numbering in aaltothesis class?
I have designed a class that needs the xepersian package. This package is unique in the way that it needs to be called last so it doesn't get overwritten. I usually define my packages in the class file using the "RequirePackage".
Is there a way to force a package to be called last where it is called in the .cls file with the possibility of other packages being called using the usepackage in the .tex file?
xetex packages
add a comment |
I have designed a class that needs the xepersian package. This package is unique in the way that it needs to be called last so it doesn't get overwritten. I usually define my packages in the class file using the "RequirePackage".
Is there a way to force a package to be called last where it is called in the .cls file with the possibility of other packages being called using the usepackage in the .tex file?
xetex packages
You can useAtBeginDocumentRequirePackagexepersian.
– Phelype Oleinik
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
2
@campaAfterEndPreambleis too late to load a package. You'll get aLaTeX Error: Can be used only in preamble.. TheAtBeginDocumentis the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).
– Phelype Oleinik
11 hours ago
4
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loadinghyperrefon top of it is a nightmare :-)
– Phelype Oleinik
11 hours ago
add a comment |
I have designed a class that needs the xepersian package. This package is unique in the way that it needs to be called last so it doesn't get overwritten. I usually define my packages in the class file using the "RequirePackage".
Is there a way to force a package to be called last where it is called in the .cls file with the possibility of other packages being called using the usepackage in the .tex file?
xetex packages
I have designed a class that needs the xepersian package. This package is unique in the way that it needs to be called last so it doesn't get overwritten. I usually define my packages in the class file using the "RequirePackage".
Is there a way to force a package to be called last where it is called in the .cls file with the possibility of other packages being called using the usepackage in the .tex file?
xetex packages
xetex packages
asked 11 hours ago
Al_FhAl_Fh
826
826
You can useAtBeginDocumentRequirePackagexepersian.
– Phelype Oleinik
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
2
@campaAfterEndPreambleis too late to load a package. You'll get aLaTeX Error: Can be used only in preamble.. TheAtBeginDocumentis the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).
– Phelype Oleinik
11 hours ago
4
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loadinghyperrefon top of it is a nightmare :-)
– Phelype Oleinik
11 hours ago
add a comment |
You can useAtBeginDocumentRequirePackagexepersian.
– Phelype Oleinik
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
2
@campaAfterEndPreambleis too late to load a package. You'll get aLaTeX Error: Can be used only in preamble.. TheAtBeginDocumentis the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).
– Phelype Oleinik
11 hours ago
4
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loadinghyperrefon top of it is a nightmare :-)
– Phelype Oleinik
11 hours ago
You can use
AtBeginDocumentRequirePackagexepersian.– Phelype Oleinik
11 hours ago
You can use
AtBeginDocumentRequirePackagexepersian.– Phelype Oleinik
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
2
2
@campa
AfterEndPreamble is too late to load a package. You'll get a LaTeX Error: Can be used only in preamble.. The AtBeginDocument is the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).– Phelype Oleinik
11 hours ago
@campa
AfterEndPreamble is too late to load a package. You'll get a LaTeX Error: Can be used only in preamble.. The AtBeginDocument is the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).– Phelype Oleinik
11 hours ago
4
4
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loading
hyperref on top of it is a nightmare :-)– Phelype Oleinik
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loading
hyperref on top of it is a nightmare :-)– Phelype Oleinik
11 hours ago
add a comment |
1 Answer
1
active
oldest
votes
You can delay the package loading using AtBeginDocument:
AtBeginDocumentRequirePackagexepersian
this will put the package loading after the .aux file is read but before the “proper end” of the preamble, where all the preamble-only commands are redefined to throw an error; from this point on any usepackage (or RequirePackage) will not work.
If the package, for some reason, needs to be loaded before the begindocument even starts, then you can load the etoolbox package and use:
BeforeBeginEnvironmentdocumentRequirePackagexepersian
this will execute the RequirePackage before executing anything from the begindocument. The effect is the same as if you had put the RequirePackage line right before begindocument in your .tex file.
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 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%2f484102%2fis-it-possible-to-force-a-package-to-be-called-last-in-the-entirety-of-the-latex%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
You can delay the package loading using AtBeginDocument:
AtBeginDocumentRequirePackagexepersian
this will put the package loading after the .aux file is read but before the “proper end” of the preamble, where all the preamble-only commands are redefined to throw an error; from this point on any usepackage (or RequirePackage) will not work.
If the package, for some reason, needs to be loaded before the begindocument even starts, then you can load the etoolbox package and use:
BeforeBeginEnvironmentdocumentRequirePackagexepersian
this will execute the RequirePackage before executing anything from the begindocument. The effect is the same as if you had put the RequirePackage line right before begindocument in your .tex file.
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 hours ago
add a comment |
You can delay the package loading using AtBeginDocument:
AtBeginDocumentRequirePackagexepersian
this will put the package loading after the .aux file is read but before the “proper end” of the preamble, where all the preamble-only commands are redefined to throw an error; from this point on any usepackage (or RequirePackage) will not work.
If the package, for some reason, needs to be loaded before the begindocument even starts, then you can load the etoolbox package and use:
BeforeBeginEnvironmentdocumentRequirePackagexepersian
this will execute the RequirePackage before executing anything from the begindocument. The effect is the same as if you had put the RequirePackage line right before begindocument in your .tex file.
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 hours ago
add a comment |
You can delay the package loading using AtBeginDocument:
AtBeginDocumentRequirePackagexepersian
this will put the package loading after the .aux file is read but before the “proper end” of the preamble, where all the preamble-only commands are redefined to throw an error; from this point on any usepackage (or RequirePackage) will not work.
If the package, for some reason, needs to be loaded before the begindocument even starts, then you can load the etoolbox package and use:
BeforeBeginEnvironmentdocumentRequirePackagexepersian
this will execute the RequirePackage before executing anything from the begindocument. The effect is the same as if you had put the RequirePackage line right before begindocument in your .tex file.
You can delay the package loading using AtBeginDocument:
AtBeginDocumentRequirePackagexepersian
this will put the package loading after the .aux file is read but before the “proper end” of the preamble, where all the preamble-only commands are redefined to throw an error; from this point on any usepackage (or RequirePackage) will not work.
If the package, for some reason, needs to be loaded before the begindocument even starts, then you can load the etoolbox package and use:
BeforeBeginEnvironmentdocumentRequirePackagexepersian
this will execute the RequirePackage before executing anything from the begindocument. The effect is the same as if you had put the RequirePackage line right before begindocument in your .tex file.
edited 11 hours ago
answered 11 hours ago
Phelype OleinikPhelype Oleinik
25k54690
25k54690
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 hours ago
add a comment |
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 hours ago
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
What do you mean by the "proper end" of the preamble? Can you clarify?
– Al_Fh
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
@Al_Fh I just invented that name :P I clarified the answer.
– Phelype Oleinik
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Thank you very much.
– Al_Fh
11 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 hours ago
Of course, you can always load xpersian in the preamble (before hyperref). It will not be loaded twice.
– John Kormylo
6 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%2f484102%2fis-it-possible-to-force-a-package-to-be-called-last-in-the-entirety-of-the-latex%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
You can use
AtBeginDocumentRequirePackagexepersian.– Phelype Oleinik
11 hours ago
@PhelypeOleinik I see. Thanks.
– Al_Fh
11 hours ago
2
@campa
AfterEndPreambleis too late to load a package. You'll get aLaTeX Error: Can be used only in preamble.. TheAtBeginDocumentis the latest a package can be loaded because right after that the preamble ends (i.e. preamble-only commands become error messages).– Phelype Oleinik
11 hours ago
4
@PhelypeOleinik assuming that none of the packages you load later use the same trick to delay some package loading ...
– Ulrike Fischer
11 hours ago
@UlrikeFischer Ah, yes, there's that. If I recall correctly, there's an infamous Brazilian class file which does something like that and loading
hyperrefon top of it is a nightmare :-)– Phelype Oleinik
11 hours ago