Which are the advantages/disadvantages of includestandalone?Conflict between color, graphicx and libertineTwo figures side by side with text wrappingIncluding .tex files that need a different style file than the main textHow to make the (COMPLETE) preamble of a Standalone document available to a `Main Document`?I cannot add pictures to my document using latex and texstudioStandalone proper alignment of plotsTikz external files and pdfGraphicx Displays File Path, not ImageWhen using inputdocument_with_tikz.tex the paths inside document_with_tikz.tex getting wrongPicture created with standalone looks quite different than the original one
How to respond to an upset student?
My employer faked my resume to acquire projects
What is the object moving across the ceiling in this stock footage?
How to deal with a colleague who is being aggressive?
Why are C64 games inconsistent with which joystick port they use?
Can I tell a prospective employee that everyone in the team is leaving?
How strong are Wi-Fi signals?
Who will lead the country until there is a new Tory leader?
Count Even Digits In Number
How did these characters "suit up" so quickly?
How do I partition a matrx into blocks and replace zeros with dots?
What is a really good book for complex variables?
I know that there is a preselected candidate for a position to be filled at my department. What should I do?
Do photons bend spacetime or not?
Construct a word ladder
Did 20% of US soldiers in Vietnam use heroin, 95% of whom quit afterwards?
Why would Ryanair allow me to book this journey through a third party, but not through their own website?
Compaq Portable vs IBM 5155 Portable PC
Plot twist where the antagonist wins
Is Jon Snow the last of his House?
Why were helmets and other body armour not commonplace in the 1800s?
Statue View: Tetrominoes
What is Theresa May waiting for?
Why does this if-statement combining assignment and an equality check return true?
Which are the advantages/disadvantages of includestandalone?
Conflict between color, graphicx and libertineTwo figures side by side with text wrappingIncluding .tex files that need a different style file than the main textHow to make the (COMPLETE) preamble of a Standalone document available to a `Main Document`?I cannot add pictures to my document using latex and texstudioStandalone proper alignment of plotsTikz external files and pdfGraphicx Displays File Path, not ImageWhen using inputdocument_with_tikz.tex the paths inside document_with_tikz.tex getting wrongPicture created with standalone looks quite different than the original one
I've just found out that the command
includestandalone[<options>]<file>
exists.
Which are its advantages/disadvantages with respect to the includegraphics<file> of the output image?
For example, if I have myfile.tex:
documentclassstandalone
usepackagetikz
begindocument
begintikzpicture
node[fill=red]A;
endtikzpicture
enddocument
with includestandalone I have to put in the preamble of the main file all the packages present in the standalone preamble:
documentclassarticle
usepackagetikz
usepackagestandalone
begindocument
includestandalonemyfile
enddocument
whereas if I only include the output, of course, I don't need them:
documentclassarticle
usepackagegraphicx
begindocument
includegraphicsmyfile
enddocument
graphics standalone
add a comment |
I've just found out that the command
includestandalone[<options>]<file>
exists.
Which are its advantages/disadvantages with respect to the includegraphics<file> of the output image?
For example, if I have myfile.tex:
documentclassstandalone
usepackagetikz
begindocument
begintikzpicture
node[fill=red]A;
endtikzpicture
enddocument
with includestandalone I have to put in the preamble of the main file all the packages present in the standalone preamble:
documentclassarticle
usepackagetikz
usepackagestandalone
begindocument
includestandalonemyfile
enddocument
whereas if I only include the output, of course, I don't need them:
documentclassarticle
usepackagegraphicx
begindocument
includegraphicsmyfile
enddocument
graphics standalone
5
Looking at the package code ofstandaloneit looks like it checks the modification time of the.texfile and if it is newer than that of the.pdffile then it starts a standalone job to update the.pdffile. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.
– Phelype Oleinik
May 19 at 18:18
1
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
5
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41
add a comment |
I've just found out that the command
includestandalone[<options>]<file>
exists.
Which are its advantages/disadvantages with respect to the includegraphics<file> of the output image?
For example, if I have myfile.tex:
documentclassstandalone
usepackagetikz
begindocument
begintikzpicture
node[fill=red]A;
endtikzpicture
enddocument
with includestandalone I have to put in the preamble of the main file all the packages present in the standalone preamble:
documentclassarticle
usepackagetikz
usepackagestandalone
begindocument
includestandalonemyfile
enddocument
whereas if I only include the output, of course, I don't need them:
documentclassarticle
usepackagegraphicx
begindocument
includegraphicsmyfile
enddocument
graphics standalone
I've just found out that the command
includestandalone[<options>]<file>
exists.
Which are its advantages/disadvantages with respect to the includegraphics<file> of the output image?
For example, if I have myfile.tex:
documentclassstandalone
usepackagetikz
begindocument
begintikzpicture
node[fill=red]A;
endtikzpicture
enddocument
with includestandalone I have to put in the preamble of the main file all the packages present in the standalone preamble:
documentclassarticle
usepackagetikz
usepackagestandalone
begindocument
includestandalonemyfile
enddocument
whereas if I only include the output, of course, I don't need them:
documentclassarticle
usepackagegraphicx
begindocument
includegraphicsmyfile
enddocument
graphics standalone
graphics standalone
edited May 19 at 18:07
Phelype Oleinik
28.3k64794
28.3k64794
asked May 19 at 17:58
CarLaTeXCarLaTeX
36.9k558163
36.9k558163
5
Looking at the package code ofstandaloneit looks like it checks the modification time of the.texfile and if it is newer than that of the.pdffile then it starts a standalone job to update the.pdffile. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.
– Phelype Oleinik
May 19 at 18:18
1
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
5
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41
add a comment |
5
Looking at the package code ofstandaloneit looks like it checks the modification time of the.texfile and if it is newer than that of the.pdffile then it starts a standalone job to update the.pdffile. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.
– Phelype Oleinik
May 19 at 18:18
1
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
5
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41
5
5
Looking at the package code of
standalone it looks like it checks the modification time of the .tex file and if it is newer than that of the .pdf file then it starts a standalone job to update the .pdf file. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.– Phelype Oleinik
May 19 at 18:18
Looking at the package code of
standalone it looks like it checks the modification time of the .tex file and if it is newer than that of the .pdf file then it starts a standalone job to update the .pdf file. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.– Phelype Oleinik
May 19 at 18:18
1
1
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
5
5
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41
add a comment |
1 Answer
1
active
oldest
votes
This is one advantage, I do not claim it is the most important one. It goes in the same direction as the comments by Phelype and KJO, and is essentially copied from here. Consider this subfile sub.tex.
documentclass[tikz]standalone
begindocument
ifstandalone
tikzsetmy style/.style=line width=3pt
fi
begintikzpicture
draw[->,my style] (0,1cm)--++(4,-5);
endtikzpicture
enddocument
If you compile it, you get

However, you can also embed and modify it in a main document.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
beginfigure[h]
tikzsetmy style/.style=line width=15pt
includestandalone[mode=tex]sub
captionVersion 1.
endfigure
beginfigure[h]
tikzsetmy style/.style=red, line width=7pt
includestandalone[mode=tex]subcaptionVersion 2.
endfigure
enddocument

As you can see, you can manipulate it from outside which you can't if you use includegraphics.
Of course, you can generalize this example in many ways. Within TikZ, you can play with every node and the like, but this discussion is certainly restricted to TikZ. With
ifstandalone
<some defintions>
fi
you can create many examples where you define a macro in one way if it is compiled as standalone and in other ways depending on which document embeds the stuff. I started using these things for figures that get embedded in either notes or beamer presentations, but do not have used them extensively. So far these tricks work great.
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
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%2f491645%2fwhich-are-the-advantages-disadvantages-of-includestandalone%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
This is one advantage, I do not claim it is the most important one. It goes in the same direction as the comments by Phelype and KJO, and is essentially copied from here. Consider this subfile sub.tex.
documentclass[tikz]standalone
begindocument
ifstandalone
tikzsetmy style/.style=line width=3pt
fi
begintikzpicture
draw[->,my style] (0,1cm)--++(4,-5);
endtikzpicture
enddocument
If you compile it, you get

However, you can also embed and modify it in a main document.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
beginfigure[h]
tikzsetmy style/.style=line width=15pt
includestandalone[mode=tex]sub
captionVersion 1.
endfigure
beginfigure[h]
tikzsetmy style/.style=red, line width=7pt
includestandalone[mode=tex]subcaptionVersion 2.
endfigure
enddocument

As you can see, you can manipulate it from outside which you can't if you use includegraphics.
Of course, you can generalize this example in many ways. Within TikZ, you can play with every node and the like, but this discussion is certainly restricted to TikZ. With
ifstandalone
<some defintions>
fi
you can create many examples where you define a macro in one way if it is compiled as standalone and in other ways depending on which document embeds the stuff. I started using these things for figures that get embedded in either notes or beamer presentations, but do not have used them extensively. So far these tricks work great.
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
add a comment |
This is one advantage, I do not claim it is the most important one. It goes in the same direction as the comments by Phelype and KJO, and is essentially copied from here. Consider this subfile sub.tex.
documentclass[tikz]standalone
begindocument
ifstandalone
tikzsetmy style/.style=line width=3pt
fi
begintikzpicture
draw[->,my style] (0,1cm)--++(4,-5);
endtikzpicture
enddocument
If you compile it, you get

However, you can also embed and modify it in a main document.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
beginfigure[h]
tikzsetmy style/.style=line width=15pt
includestandalone[mode=tex]sub
captionVersion 1.
endfigure
beginfigure[h]
tikzsetmy style/.style=red, line width=7pt
includestandalone[mode=tex]subcaptionVersion 2.
endfigure
enddocument

As you can see, you can manipulate it from outside which you can't if you use includegraphics.
Of course, you can generalize this example in many ways. Within TikZ, you can play with every node and the like, but this discussion is certainly restricted to TikZ. With
ifstandalone
<some defintions>
fi
you can create many examples where you define a macro in one way if it is compiled as standalone and in other ways depending on which document embeds the stuff. I started using these things for figures that get embedded in either notes or beamer presentations, but do not have used them extensively. So far these tricks work great.
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
add a comment |
This is one advantage, I do not claim it is the most important one. It goes in the same direction as the comments by Phelype and KJO, and is essentially copied from here. Consider this subfile sub.tex.
documentclass[tikz]standalone
begindocument
ifstandalone
tikzsetmy style/.style=line width=3pt
fi
begintikzpicture
draw[->,my style] (0,1cm)--++(4,-5);
endtikzpicture
enddocument
If you compile it, you get

However, you can also embed and modify it in a main document.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
beginfigure[h]
tikzsetmy style/.style=line width=15pt
includestandalone[mode=tex]sub
captionVersion 1.
endfigure
beginfigure[h]
tikzsetmy style/.style=red, line width=7pt
includestandalone[mode=tex]subcaptionVersion 2.
endfigure
enddocument

As you can see, you can manipulate it from outside which you can't if you use includegraphics.
Of course, you can generalize this example in many ways. Within TikZ, you can play with every node and the like, but this discussion is certainly restricted to TikZ. With
ifstandalone
<some defintions>
fi
you can create many examples where you define a macro in one way if it is compiled as standalone and in other ways depending on which document embeds the stuff. I started using these things for figures that get embedded in either notes or beamer presentations, but do not have used them extensively. So far these tricks work great.
This is one advantage, I do not claim it is the most important one. It goes in the same direction as the comments by Phelype and KJO, and is essentially copied from here. Consider this subfile sub.tex.
documentclass[tikz]standalone
begindocument
ifstandalone
tikzsetmy style/.style=line width=3pt
fi
begintikzpicture
draw[->,my style] (0,1cm)--++(4,-5);
endtikzpicture
enddocument
If you compile it, you get

However, you can also embed and modify it in a main document.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
beginfigure[h]
tikzsetmy style/.style=line width=15pt
includestandalone[mode=tex]sub
captionVersion 1.
endfigure
beginfigure[h]
tikzsetmy style/.style=red, line width=7pt
includestandalone[mode=tex]subcaptionVersion 2.
endfigure
enddocument

As you can see, you can manipulate it from outside which you can't if you use includegraphics.
Of course, you can generalize this example in many ways. Within TikZ, you can play with every node and the like, but this discussion is certainly restricted to TikZ. With
ifstandalone
<some defintions>
fi
you can create many examples where you define a macro in one way if it is compiled as standalone and in other ways depending on which document embeds the stuff. I started using these things for figures that get embedded in either notes or beamer presentations, but do not have used them extensively. So far these tricks work great.
edited May 20 at 0:25
answered May 19 at 19:44
marmotmarmot
130k6164311
130k6164311
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
add a comment |
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
1
1
+1, interesting!
– CarLaTeX
May 19 at 19:57
+1, interesting!
– CarLaTeX
May 19 at 19:57
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
@CarLaTeX I think Marmot has it covered but I was playing with begindocument inputcarlatex scalebox2inputMarmot Hats off to you M'am enddocument :-} edit PS my Marmot was a variation on Issue#1 in GitHub issues with a 40^ jaunty hat e.g. begintikzpicture marmot thing[hat,xshift=1.2cm,yshift=-0.9cm,rotate=40]
– KJO
May 19 at 22:33
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%2f491645%2fwhich-are-the-advantages-disadvantages-of-includestandalone%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
5
Looking at the package code of
standaloneit looks like it checks the modification time of the.texfile and if it is newer than that of the.pdffile then it starts a standalone job to update the.pdffile. It looks like the externalisation thing in TikZ. So I'd say that an advantage is that it updates the file if necessary. There's probably much more than that, but this is what I saw by quickly looking into the code.– Phelype Oleinik
May 19 at 18:18
1
@PhelypeOleinik Thank you, you could also write an answer if you like.
– CarLaTeX
May 19 at 18:34
5
As I understand it it is in effect a variation of the principles of subfiles. That is the subfiles are potentially compilable standalone OR can be included in which case they are not only physically cropped area but also tex is cropped from begindocument to enddocument thus why it needs the preambles to be included for those imported commands
– KJO
May 19 at 18:36
@KJO Thanks, you could write an answer, too, if you like.
– CarLaTeX
May 19 at 18:41