Why does standalone not detect the TikZ crop correctly?











up vote
14
down vote

favorite
3












This small example



documentclass{standalone}
usepackage{xltxtra,textcomp,graphicx,color,tikz}
usepackage[absolute,overlay]{textpos}
begin{document}
begin{tikzpicture}
clip (0,0) rectangle (12.8cm, 1.15cm);
draw (0,0) grid (12.8cm, 1.15cm);
end{tikzpicture}
end{document}


generates this output:



output



Where is the margin / extra space on the left side coming from, and how can I remove it? Shouldn't clip take care of that?










share|improve this question






















  • You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
    – cfr
    Jun 7 '16 at 22:21















up vote
14
down vote

favorite
3












This small example



documentclass{standalone}
usepackage{xltxtra,textcomp,graphicx,color,tikz}
usepackage[absolute,overlay]{textpos}
begin{document}
begin{tikzpicture}
clip (0,0) rectangle (12.8cm, 1.15cm);
draw (0,0) grid (12.8cm, 1.15cm);
end{tikzpicture}
end{document}


generates this output:



output



Where is the margin / extra space on the left side coming from, and how can I remove it? Shouldn't clip take care of that?










share|improve this question






















  • You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
    – cfr
    Jun 7 '16 at 22:21













up vote
14
down vote

favorite
3









up vote
14
down vote

favorite
3






3





This small example



documentclass{standalone}
usepackage{xltxtra,textcomp,graphicx,color,tikz}
usepackage[absolute,overlay]{textpos}
begin{document}
begin{tikzpicture}
clip (0,0) rectangle (12.8cm, 1.15cm);
draw (0,0) grid (12.8cm, 1.15cm);
end{tikzpicture}
end{document}


generates this output:



output



Where is the margin / extra space on the left side coming from, and how can I remove it? Shouldn't clip take care of that?










share|improve this question













This small example



documentclass{standalone}
usepackage{xltxtra,textcomp,graphicx,color,tikz}
usepackage[absolute,overlay]{textpos}
begin{document}
begin{tikzpicture}
clip (0,0) rectangle (12.8cm, 1.15cm);
draw (0,0) grid (12.8cm, 1.15cm);
end{tikzpicture}
end{document}


generates this output:



output



Where is the margin / extra space on the left side coming from, and how can I remove it? Shouldn't clip take care of that?







tikz-pgf margins standalone






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 13 '13 at 18:03









barbaz

64011018




64011018












  • You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
    – cfr
    Jun 7 '16 at 22:21


















  • You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
    – cfr
    Jun 7 '16 at 22:21
















You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
– cfr
Jun 7 '16 at 22:21




You don't need graphicx,color if you're loading TikZ. You almost certainly shouldn't be loading both xltxtra and textcomp. That suggests some level of confusion. Do you really want textpos for a standalone TikZ picture?
– cfr
Jun 7 '16 at 22:21










1 Answer
1






active

oldest

votes

















up vote
15
down vote



accepted










use



documentclass[
tikz,
%border=1pt
]{standalone}


With the tikz option the standalone class knows that it should crop the
environment(s) tikzpicture and not only the given text box.



With the border option you can better control the result






share|improve this answer



















  • 2




    thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
    – barbaz
    Oct 14 '13 at 9:38






  • 1




    see documentation page 7
    – Herbert
    Oct 14 '13 at 9:41










  • This reference shows a simple solution: documentclass[border=10pt]{standalone}.
    – Rubens
    Jul 22 '14 at 21:56






  • 2




    @Rubens: border=... doesn't solve the problem with the tikz key ...
    – Herbert
    Jul 23 '14 at 4:40






  • 1




    Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
    – stefanct
    Nov 10 '17 at 13:58











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',
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%2f138677%2fwhy-does-standalone-not-detect-the-tikz-crop-correctly%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








up vote
15
down vote



accepted










use



documentclass[
tikz,
%border=1pt
]{standalone}


With the tikz option the standalone class knows that it should crop the
environment(s) tikzpicture and not only the given text box.



With the border option you can better control the result






share|improve this answer



















  • 2




    thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
    – barbaz
    Oct 14 '13 at 9:38






  • 1




    see documentation page 7
    – Herbert
    Oct 14 '13 at 9:41










  • This reference shows a simple solution: documentclass[border=10pt]{standalone}.
    – Rubens
    Jul 22 '14 at 21:56






  • 2




    @Rubens: border=... doesn't solve the problem with the tikz key ...
    – Herbert
    Jul 23 '14 at 4:40






  • 1




    Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
    – stefanct
    Nov 10 '17 at 13:58















up vote
15
down vote



accepted










use



documentclass[
tikz,
%border=1pt
]{standalone}


With the tikz option the standalone class knows that it should crop the
environment(s) tikzpicture and not only the given text box.



With the border option you can better control the result






share|improve this answer



















  • 2




    thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
    – barbaz
    Oct 14 '13 at 9:38






  • 1




    see documentation page 7
    – Herbert
    Oct 14 '13 at 9:41










  • This reference shows a simple solution: documentclass[border=10pt]{standalone}.
    – Rubens
    Jul 22 '14 at 21:56






  • 2




    @Rubens: border=... doesn't solve the problem with the tikz key ...
    – Herbert
    Jul 23 '14 at 4:40






  • 1




    Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
    – stefanct
    Nov 10 '17 at 13:58













up vote
15
down vote



accepted







up vote
15
down vote



accepted






use



documentclass[
tikz,
%border=1pt
]{standalone}


With the tikz option the standalone class knows that it should crop the
environment(s) tikzpicture and not only the given text box.



With the border option you can better control the result






share|improve this answer














use



documentclass[
tikz,
%border=1pt
]{standalone}


With the tikz option the standalone class knows that it should crop the
environment(s) tikzpicture and not only the given text box.



With the border option you can better control the result







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 6 at 16:11

























answered Oct 13 '13 at 18:11









Herbert

267k23407716




267k23407716








  • 2




    thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
    – barbaz
    Oct 14 '13 at 9:38






  • 1




    see documentation page 7
    – Herbert
    Oct 14 '13 at 9:41










  • This reference shows a simple solution: documentclass[border=10pt]{standalone}.
    – Rubens
    Jul 22 '14 at 21:56






  • 2




    @Rubens: border=... doesn't solve the problem with the tikz key ...
    – Herbert
    Jul 23 '14 at 4:40






  • 1




    Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
    – stefanct
    Nov 10 '17 at 13:58














  • 2




    thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
    – barbaz
    Oct 14 '13 at 9:38






  • 1




    see documentation page 7
    – Herbert
    Oct 14 '13 at 9:41










  • This reference shows a simple solution: documentclass[border=10pt]{standalone}.
    – Rubens
    Jul 22 '14 at 21:56






  • 2




    @Rubens: border=... doesn't solve the problem with the tikz key ...
    – Herbert
    Jul 23 '14 at 4:40






  • 1




    Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
    – stefanct
    Nov 10 '17 at 13:58








2




2




thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
– barbaz
Oct 14 '13 at 9:38




thank you, that worked just fine. Could you maybe elaborate a bit about the use of the tikz option, what does it do?
– barbaz
Oct 14 '13 at 9:38




1




1




see documentation page 7
– Herbert
Oct 14 '13 at 9:41




see documentation page 7
– Herbert
Oct 14 '13 at 9:41












This reference shows a simple solution: documentclass[border=10pt]{standalone}.
– Rubens
Jul 22 '14 at 21:56




This reference shows a simple solution: documentclass[border=10pt]{standalone}.
– Rubens
Jul 22 '14 at 21:56




2




2




@Rubens: border=... doesn't solve the problem with the tikz key ...
– Herbert
Jul 23 '14 at 4:40




@Rubens: border=... doesn't solve the problem with the tikz key ...
– Herbert
Jul 23 '14 at 4:40




1




1




Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
– stefanct
Nov 10 '17 at 13:58




Alternatively, one could use multi=tikzpicture,varwidth=false instead. The only difference according to the documentation is that standalone would not load the tikz package itself thus one has to do that manually. However, this might help in some situations, e.g., if one uses usepackage[svgnames]{xcolor} which has to be loaded before tikz or else results in LaTeX Error: Option clash for package xcolor. (which would be impossible if the document class has loaded tikz already.
– stefanct
Nov 10 '17 at 13:58


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f138677%2fwhy-does-standalone-not-detect-the-tikz-crop-correctly%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

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?