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













10















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









share|improve this question



















  • 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






  • 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















10















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









share|improve this question



















  • 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






  • 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













10












10








10


3






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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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





    @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





    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





    @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










1 Answer
1






active

oldest

votes


















7














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



enter image description here



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


enter image description here



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.






share|improve this answer




















  • 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












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
);



);













draft saved

draft discarded


















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









7














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



enter image description here



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


enter image description here



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.






share|improve this answer




















  • 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
















7














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



enter image description here



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


enter image description here



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.






share|improve this answer




















  • 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














7












7








7







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



enter image description here



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


enter image description here



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.






share|improve this answer















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



enter image description here



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


enter image description here



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.







share|improve this answer














share|improve this answer



share|improve this answer








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













  • 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


















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림