Loading but not using TikZ changes a fileHow to get pdftex to have same PDF output for each run on the same inputHow can I put a coloured outline around fraction lines?Conflict between color, graphicx and libertineGenerating PDF/A-1b compliant documents using pdfx and pdfLaTeXLibertine fonts: spaces in PDF filesWhy do I get an extra white page before my TikZ picture?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingHow to draw a square and its diagonals with arrows?pdflatex does not support updated version pdf creationCompound Pathway Problem with holesCreate PDF/A-2u compliant file using pdflatex

I didn't do any exit passport control when leaving Japan. What should I do?

Employer says he needs to delay payment by 3 months due to bureaucracy

How to execute a project with two resources where you need three resources?

Did smallpox emerge in 1580?

What is the type of this light bulb?

How does Firefox know my ISP login page?

Is it possible to do a low carb diet for a month in Sicily?

How to respond when insulted by a grad student in a different department?

Is it plausible that an interrupted Windows update can cause the motherboard to fail?

Why is coffee provided during big chess events when it contains a banned substance?

Why (come) instead of (go)?

Negative feedbacks and "Language smoother"

Short story about aliens who tried using the common cold as a weapon

Can the Bountiful Luck halfling racial feat be used multiple times in one round?

How can demon technology be prevented from surpassing humans?

Can a character dodge an attack that beats their Armor Class?

UK PM is taking his proposal to EU but has not proposed to his own parliament - can he legally bypass the UK parliament?

How can AnyDVD destroy a DVD drive?

I can't find Denoiser in 2.80

How is the corresponding author on a (math) paper typically chosen?

Is the value of a probability density function for a given input a point, a range, or both?

How to make a PCB based on ATtiny easily updatable by end users?

Future of iTunes and audio files in its library

What's the current zodiac?



Loading but not using TikZ changes a file


How to get pdftex to have same PDF output for each run on the same inputHow can I put a coloured outline around fraction lines?Conflict between color, graphicx and libertineGenerating PDF/A-1b compliant documents using pdfx and pdfLaTeXLibertine fonts: spaces in PDF filesWhy do I get an extra white page before my TikZ picture?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingHow to draw a square and its diagonals with arrows?pdflatex does not support updated version pdf creationCompound Pathway Problem with holesCreate PDF/A-2u compliant file using pdflatex






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









4

















In the file below:



documentclassreport

usepackagetikz

begindocument
This is a test.
enddocument


commenting and uncommenting the tikz entry changes the PDF file produced. Since tikz is not being used -- in what ways the PDF file is changed?










share|improve this question




























  • What is the change you observe

    – subham soni
    Apr 29 at 13:57











  • Indeed: there is none here.

    – Denis
    Apr 29 at 14:03






  • 4





    Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

    – Ulrike Fischer
    Apr 29 at 14:15












  • @subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

    – Paulo Ney
    Apr 29 at 15:49

















4

















In the file below:



documentclassreport

usepackagetikz

begindocument
This is a test.
enddocument


commenting and uncommenting the tikz entry changes the PDF file produced. Since tikz is not being used -- in what ways the PDF file is changed?










share|improve this question




























  • What is the change you observe

    – subham soni
    Apr 29 at 13:57











  • Indeed: there is none here.

    – Denis
    Apr 29 at 14:03






  • 4





    Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

    – Ulrike Fischer
    Apr 29 at 14:15












  • @subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

    – Paulo Ney
    Apr 29 at 15:49













4












4








4








In the file below:



documentclassreport

usepackagetikz

begindocument
This is a test.
enddocument


commenting and uncommenting the tikz entry changes the PDF file produced. Since tikz is not being used -- in what ways the PDF file is changed?










share|improve this question
















In the file below:



documentclassreport

usepackagetikz

begindocument
This is a test.
enddocument


commenting and uncommenting the tikz entry changes the PDF file produced. Since tikz is not being used -- in what ways the PDF file is changed?







tikz-pgf pdftex pdf






share|improve this question















share|improve this question













share|improve this question




share|improve this question



share|improve this question








edited Apr 29 at 16:11









Phelype Oleinik

35.4k7 gold badges62 silver badges118 bronze badges




35.4k7 gold badges62 silver badges118 bronze badges










asked Apr 29 at 13:50









Paulo NeyPaulo Ney

1,18110 silver badges17 bronze badges




1,18110 silver badges17 bronze badges















  • What is the change you observe

    – subham soni
    Apr 29 at 13:57











  • Indeed: there is none here.

    – Denis
    Apr 29 at 14:03






  • 4





    Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

    – Ulrike Fischer
    Apr 29 at 14:15












  • @subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

    – Paulo Ney
    Apr 29 at 15:49

















  • What is the change you observe

    – subham soni
    Apr 29 at 13:57











  • Indeed: there is none here.

    – Denis
    Apr 29 at 14:03






  • 4





    Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

    – Ulrike Fischer
    Apr 29 at 14:15












  • @subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

    – Paulo Ney
    Apr 29 at 15:49
















What is the change you observe

– subham soni
Apr 29 at 13:57





What is the change you observe

– subham soni
Apr 29 at 13:57













Indeed: there is none here.

– Denis
Apr 29 at 14:03





Indeed: there is none here.

– Denis
Apr 29 at 14:03




4




4





Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

– Ulrike Fischer
Apr 29 at 14:15






Yes, pgf will load the graphics-drivers and this will set/change the pdf page size to letter.

– Ulrike Fischer
Apr 29 at 14:15














@subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

– Paulo Ney
Apr 29 at 15:49





@subhamsoni Denis I do not care so much for changes in the date of creation of the file and things like that, but the changes here go beyond that, as explained by Phelype Oleinik down below.

– Paulo Ney
Apr 29 at 15:49










1 Answer
1






active

oldest

votes


















9


















Long story short, there are two differences:



  1. The color is changed from the default color to explicit black;


  2. The paper size is changed from the default of your TeX distribution setup to letter paper.



One thing that changes is the PDF metadata which contains the date in which it was generated and an unique ID generated with that info. You can suppress those to create the exact same PDF using (reference):



pdfinfoomitdate=1
pdfsuppressptexinfo=-1
pdftrailerid


(assuming you are using pdfTeX).



That said, you can disable the compression to make the PDF human-readable (or as close as it can get):



pdfcompresslevel=0
pdfobjcompresslevel=0


and then run pdflatex on two files and diff them:



$ diff -a notikz.pdf tikz.pdf
3c3
< 3 0 obj
---
> 6 0 obj
5c5
< /Length 103
---
> /Length 144
7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G
14c20
< 2 0 obj
---
> 5 0 obj
17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R
23c29
< 1 0 obj
---
> 4 0 obj
25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>
29c36,45
< 6 0 obj
---
> 1 0 obj
> <<>>
> endobj
> 2 0 obj
> <<>>
> endobj
> 3 0 obj
> << /pgfprgb [/Pattern /DeviceRGB] >>
> endobj
> 9 0 obj
32c48
< 7 0 obj
---
> 10 0 obj
128c144
< 8 0 obj
---
> 11 0 obj
141c157
< /FontFile 7 0 R
---
> /FontFile 10 0 R
144c160
< 4 0 obj
---
> 7 0 obj
149c165
< /FontDescriptor 8 0 R
---
> /FontDescriptor 11 0 R
152c168
< /Widths 6 0 R
---
> /Widths 9 0 R
155c171
< 5 0 obj
---
> 8 0 obj
159c175
< /Kids [2 0 R]
---
> /Kids [5 0 R]
162c178
< 9 0 obj
---
> 12 0 obj
165c181
< /Pages 5 0 R
---
> /Pages 8 0 R
168c184
< 10 0 obj
---
> 13 0 obj
176c192
< 0 11
---
> 0 14
178,179c194,198
< 0000000287 00000 n
< 0000000176 00000 n
---
> 0000000440 00000 n
> 0000000460 00000 n
> 0000000480 00000 n
> 0000000321 00000 n
> 0000000217 00000 n
181,187c200,206
< 0000011782 00000 n
< 0000011919 00000 n
< 0000000354 00000 n
< 0000000750 00000 n
< 0000011544 00000 n
< 0000011976 00000 n
< 0000012025 00000 n
---
> 0000011964 00000 n
> 0000012102 00000 n
> 0000000533 00000 n
> 0000000929 00000 n
> 0000011724 00000 n
> 0000012159 00000 n
> 0000012209 00000 n
189,191c208,210
< << /Size 11
< /Root 9 0 R
< /Info 10 0 R
---
> << /Size 14
> /Root 12 0 R
> /Info 13 0 R
194c213
< 12105
---
> 12289


It seems to be a lot, but actually there are only few relevant changes. Most of the above are address changes to PDF objects, for example the first difference:



3c3
< 3 0 obj
---
> 6 0 obj


Says that the difference is an object which was numbered 3 and now is numberered 6. Later on references to this object will change as well (edited):



17,20c23,26
< /Contents 3 0 R
---
> /Contents 6 0 R


Also, at the end, the addresses (offset in bytes) of the objects in the file are changed because the file has changed.



The only relevant changes are three:



7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G


17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>


The first one is the actual text you printed. The stream without tikz was:



stream
BT
/F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
ET
endstream


and with tikz it became:



stream
0 g 0 G
0 g 0 G
0 g 0 G
BT
/F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
0 g 0 G
154.421 -567.87 Td [(1)]TJ
0 g 0 G
ET
endstream


The 0 g 0 G are color specification which are inserted in the PDF. These changes are actually inserted by the color driver and you can see them if you usepackagecolor. They are explicitly saying that the text is black, and not the default color (which is also black :).



The third difference is also related to the color driver which adds color information to the loaded fonts:



 /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R 


(remember object number 3 which changed to 6? This statement points to the new object number 3).



Finally, the second part is related to the graphics driver:



17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


which, apart from object references, changed the value of /MediaBox, which is basically the paper size. When you usepackagegraphics the paper size is changed from the default (which depends on how your TeX distribution is set up) to letter paper.






share|improve this answer


























  • This must be one of the most complete answer I have ever seen in SX. Many thanks!

    – Paulo Ney
    Apr 29 at 15:42











  • @PauloNey I'm glad you liked :-)

    – Phelype Oleinik
    Apr 29 at 16:10












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/4.0/"u003ecc by-sa 4.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%2f488245%2floading-but-not-using-tikz-changes-a-file%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









9


















Long story short, there are two differences:



  1. The color is changed from the default color to explicit black;


  2. The paper size is changed from the default of your TeX distribution setup to letter paper.



One thing that changes is the PDF metadata which contains the date in which it was generated and an unique ID generated with that info. You can suppress those to create the exact same PDF using (reference):



pdfinfoomitdate=1
pdfsuppressptexinfo=-1
pdftrailerid


(assuming you are using pdfTeX).



That said, you can disable the compression to make the PDF human-readable (or as close as it can get):



pdfcompresslevel=0
pdfobjcompresslevel=0


and then run pdflatex on two files and diff them:



$ diff -a notikz.pdf tikz.pdf
3c3
< 3 0 obj
---
> 6 0 obj
5c5
< /Length 103
---
> /Length 144
7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G
14c20
< 2 0 obj
---
> 5 0 obj
17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R
23c29
< 1 0 obj
---
> 4 0 obj
25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>
29c36,45
< 6 0 obj
---
> 1 0 obj
> <<>>
> endobj
> 2 0 obj
> <<>>
> endobj
> 3 0 obj
> << /pgfprgb [/Pattern /DeviceRGB] >>
> endobj
> 9 0 obj
32c48
< 7 0 obj
---
> 10 0 obj
128c144
< 8 0 obj
---
> 11 0 obj
141c157
< /FontFile 7 0 R
---
> /FontFile 10 0 R
144c160
< 4 0 obj
---
> 7 0 obj
149c165
< /FontDescriptor 8 0 R
---
> /FontDescriptor 11 0 R
152c168
< /Widths 6 0 R
---
> /Widths 9 0 R
155c171
< 5 0 obj
---
> 8 0 obj
159c175
< /Kids [2 0 R]
---
> /Kids [5 0 R]
162c178
< 9 0 obj
---
> 12 0 obj
165c181
< /Pages 5 0 R
---
> /Pages 8 0 R
168c184
< 10 0 obj
---
> 13 0 obj
176c192
< 0 11
---
> 0 14
178,179c194,198
< 0000000287 00000 n
< 0000000176 00000 n
---
> 0000000440 00000 n
> 0000000460 00000 n
> 0000000480 00000 n
> 0000000321 00000 n
> 0000000217 00000 n
181,187c200,206
< 0000011782 00000 n
< 0000011919 00000 n
< 0000000354 00000 n
< 0000000750 00000 n
< 0000011544 00000 n
< 0000011976 00000 n
< 0000012025 00000 n
---
> 0000011964 00000 n
> 0000012102 00000 n
> 0000000533 00000 n
> 0000000929 00000 n
> 0000011724 00000 n
> 0000012159 00000 n
> 0000012209 00000 n
189,191c208,210
< << /Size 11
< /Root 9 0 R
< /Info 10 0 R
---
> << /Size 14
> /Root 12 0 R
> /Info 13 0 R
194c213
< 12105
---
> 12289


It seems to be a lot, but actually there are only few relevant changes. Most of the above are address changes to PDF objects, for example the first difference:



3c3
< 3 0 obj
---
> 6 0 obj


Says that the difference is an object which was numbered 3 and now is numberered 6. Later on references to this object will change as well (edited):



17,20c23,26
< /Contents 3 0 R
---
> /Contents 6 0 R


Also, at the end, the addresses (offset in bytes) of the objects in the file are changed because the file has changed.



The only relevant changes are three:



7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G


17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>


The first one is the actual text you printed. The stream without tikz was:



stream
BT
/F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
ET
endstream


and with tikz it became:



stream
0 g 0 G
0 g 0 G
0 g 0 G
BT
/F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
0 g 0 G
154.421 -567.87 Td [(1)]TJ
0 g 0 G
ET
endstream


The 0 g 0 G are color specification which are inserted in the PDF. These changes are actually inserted by the color driver and you can see them if you usepackagecolor. They are explicitly saying that the text is black, and not the default color (which is also black :).



The third difference is also related to the color driver which adds color information to the loaded fonts:



 /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R 


(remember object number 3 which changed to 6? This statement points to the new object number 3).



Finally, the second part is related to the graphics driver:



17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


which, apart from object references, changed the value of /MediaBox, which is basically the paper size. When you usepackagegraphics the paper size is changed from the default (which depends on how your TeX distribution is set up) to letter paper.






share|improve this answer


























  • This must be one of the most complete answer I have ever seen in SX. Many thanks!

    – Paulo Ney
    Apr 29 at 15:42











  • @PauloNey I'm glad you liked :-)

    – Phelype Oleinik
    Apr 29 at 16:10















9


















Long story short, there are two differences:



  1. The color is changed from the default color to explicit black;


  2. The paper size is changed from the default of your TeX distribution setup to letter paper.



One thing that changes is the PDF metadata which contains the date in which it was generated and an unique ID generated with that info. You can suppress those to create the exact same PDF using (reference):



pdfinfoomitdate=1
pdfsuppressptexinfo=-1
pdftrailerid


(assuming you are using pdfTeX).



That said, you can disable the compression to make the PDF human-readable (or as close as it can get):



pdfcompresslevel=0
pdfobjcompresslevel=0


and then run pdflatex on two files and diff them:



$ diff -a notikz.pdf tikz.pdf
3c3
< 3 0 obj
---
> 6 0 obj
5c5
< /Length 103
---
> /Length 144
7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G
14c20
< 2 0 obj
---
> 5 0 obj
17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R
23c29
< 1 0 obj
---
> 4 0 obj
25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>
29c36,45
< 6 0 obj
---
> 1 0 obj
> <<>>
> endobj
> 2 0 obj
> <<>>
> endobj
> 3 0 obj
> << /pgfprgb [/Pattern /DeviceRGB] >>
> endobj
> 9 0 obj
32c48
< 7 0 obj
---
> 10 0 obj
128c144
< 8 0 obj
---
> 11 0 obj
141c157
< /FontFile 7 0 R
---
> /FontFile 10 0 R
144c160
< 4 0 obj
---
> 7 0 obj
149c165
< /FontDescriptor 8 0 R
---
> /FontDescriptor 11 0 R
152c168
< /Widths 6 0 R
---
> /Widths 9 0 R
155c171
< 5 0 obj
---
> 8 0 obj
159c175
< /Kids [2 0 R]
---
> /Kids [5 0 R]
162c178
< 9 0 obj
---
> 12 0 obj
165c181
< /Pages 5 0 R
---
> /Pages 8 0 R
168c184
< 10 0 obj
---
> 13 0 obj
176c192
< 0 11
---
> 0 14
178,179c194,198
< 0000000287 00000 n
< 0000000176 00000 n
---
> 0000000440 00000 n
> 0000000460 00000 n
> 0000000480 00000 n
> 0000000321 00000 n
> 0000000217 00000 n
181,187c200,206
< 0000011782 00000 n
< 0000011919 00000 n
< 0000000354 00000 n
< 0000000750 00000 n
< 0000011544 00000 n
< 0000011976 00000 n
< 0000012025 00000 n
---
> 0000011964 00000 n
> 0000012102 00000 n
> 0000000533 00000 n
> 0000000929 00000 n
> 0000011724 00000 n
> 0000012159 00000 n
> 0000012209 00000 n
189,191c208,210
< << /Size 11
< /Root 9 0 R
< /Info 10 0 R
---
> << /Size 14
> /Root 12 0 R
> /Info 13 0 R
194c213
< 12105
---
> 12289


It seems to be a lot, but actually there are only few relevant changes. Most of the above are address changes to PDF objects, for example the first difference:



3c3
< 3 0 obj
---
> 6 0 obj


Says that the difference is an object which was numbered 3 and now is numberered 6. Later on references to this object will change as well (edited):



17,20c23,26
< /Contents 3 0 R
---
> /Contents 6 0 R


Also, at the end, the addresses (offset in bytes) of the objects in the file are changed because the file has changed.



The only relevant changes are three:



7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G


17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>


The first one is the actual text you printed. The stream without tikz was:



stream
BT
/F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
ET
endstream


and with tikz it became:



stream
0 g 0 G
0 g 0 G
0 g 0 G
BT
/F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
0 g 0 G
154.421 -567.87 Td [(1)]TJ
0 g 0 G
ET
endstream


The 0 g 0 G are color specification which are inserted in the PDF. These changes are actually inserted by the color driver and you can see them if you usepackagecolor. They are explicitly saying that the text is black, and not the default color (which is also black :).



The third difference is also related to the color driver which adds color information to the loaded fonts:



 /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R 


(remember object number 3 which changed to 6? This statement points to the new object number 3).



Finally, the second part is related to the graphics driver:



17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


which, apart from object references, changed the value of /MediaBox, which is basically the paper size. When you usepackagegraphics the paper size is changed from the default (which depends on how your TeX distribution is set up) to letter paper.






share|improve this answer


























  • This must be one of the most complete answer I have ever seen in SX. Many thanks!

    – Paulo Ney
    Apr 29 at 15:42











  • @PauloNey I'm glad you liked :-)

    – Phelype Oleinik
    Apr 29 at 16:10













9














9










9









Long story short, there are two differences:



  1. The color is changed from the default color to explicit black;


  2. The paper size is changed from the default of your TeX distribution setup to letter paper.



One thing that changes is the PDF metadata which contains the date in which it was generated and an unique ID generated with that info. You can suppress those to create the exact same PDF using (reference):



pdfinfoomitdate=1
pdfsuppressptexinfo=-1
pdftrailerid


(assuming you are using pdfTeX).



That said, you can disable the compression to make the PDF human-readable (or as close as it can get):



pdfcompresslevel=0
pdfobjcompresslevel=0


and then run pdflatex on two files and diff them:



$ diff -a notikz.pdf tikz.pdf
3c3
< 3 0 obj
---
> 6 0 obj
5c5
< /Length 103
---
> /Length 144
7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G
14c20
< 2 0 obj
---
> 5 0 obj
17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R
23c29
< 1 0 obj
---
> 4 0 obj
25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>
29c36,45
< 6 0 obj
---
> 1 0 obj
> <<>>
> endobj
> 2 0 obj
> <<>>
> endobj
> 3 0 obj
> << /pgfprgb [/Pattern /DeviceRGB] >>
> endobj
> 9 0 obj
32c48
< 7 0 obj
---
> 10 0 obj
128c144
< 8 0 obj
---
> 11 0 obj
141c157
< /FontFile 7 0 R
---
> /FontFile 10 0 R
144c160
< 4 0 obj
---
> 7 0 obj
149c165
< /FontDescriptor 8 0 R
---
> /FontDescriptor 11 0 R
152c168
< /Widths 6 0 R
---
> /Widths 9 0 R
155c171
< 5 0 obj
---
> 8 0 obj
159c175
< /Kids [2 0 R]
---
> /Kids [5 0 R]
162c178
< 9 0 obj
---
> 12 0 obj
165c181
< /Pages 5 0 R
---
> /Pages 8 0 R
168c184
< 10 0 obj
---
> 13 0 obj
176c192
< 0 11
---
> 0 14
178,179c194,198
< 0000000287 00000 n
< 0000000176 00000 n
---
> 0000000440 00000 n
> 0000000460 00000 n
> 0000000480 00000 n
> 0000000321 00000 n
> 0000000217 00000 n
181,187c200,206
< 0000011782 00000 n
< 0000011919 00000 n
< 0000000354 00000 n
< 0000000750 00000 n
< 0000011544 00000 n
< 0000011976 00000 n
< 0000012025 00000 n
---
> 0000011964 00000 n
> 0000012102 00000 n
> 0000000533 00000 n
> 0000000929 00000 n
> 0000011724 00000 n
> 0000012159 00000 n
> 0000012209 00000 n
189,191c208,210
< << /Size 11
< /Root 9 0 R
< /Info 10 0 R
---
> << /Size 14
> /Root 12 0 R
> /Info 13 0 R
194c213
< 12105
---
> 12289


It seems to be a lot, but actually there are only few relevant changes. Most of the above are address changes to PDF objects, for example the first difference:



3c3
< 3 0 obj
---
> 6 0 obj


Says that the difference is an object which was numbered 3 and now is numberered 6. Later on references to this object will change as well (edited):



17,20c23,26
< /Contents 3 0 R
---
> /Contents 6 0 R


Also, at the end, the addresses (offset in bytes) of the objects in the file are changed because the file has changed.



The only relevant changes are three:



7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G


17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>


The first one is the actual text you printed. The stream without tikz was:



stream
BT
/F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
ET
endstream


and with tikz it became:



stream
0 g 0 G
0 g 0 G
0 g 0 G
BT
/F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
0 g 0 G
154.421 -567.87 Td [(1)]TJ
0 g 0 G
ET
endstream


The 0 g 0 G are color specification which are inserted in the PDF. These changes are actually inserted by the color driver and you can see them if you usepackagecolor. They are explicitly saying that the text is black, and not the default color (which is also black :).



The third difference is also related to the color driver which adds color information to the loaded fonts:



 /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R 


(remember object number 3 which changed to 6? This statement points to the new object number 3).



Finally, the second part is related to the graphics driver:



17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


which, apart from object references, changed the value of /MediaBox, which is basically the paper size. When you usepackagegraphics the paper size is changed from the default (which depends on how your TeX distribution is set up) to letter paper.






share|improve this answer














Long story short, there are two differences:



  1. The color is changed from the default color to explicit black;


  2. The paper size is changed from the default of your TeX distribution setup to letter paper.



One thing that changes is the PDF metadata which contains the date in which it was generated and an unique ID generated with that info. You can suppress those to create the exact same PDF using (reference):



pdfinfoomitdate=1
pdfsuppressptexinfo=-1
pdftrailerid


(assuming you are using pdfTeX).



That said, you can disable the compression to make the PDF human-readable (or as close as it can get):



pdfcompresslevel=0
pdfobjcompresslevel=0


and then run pdflatex on two files and diff them:



$ diff -a notikz.pdf tikz.pdf
3c3
< 3 0 obj
---
> 6 0 obj
5c5
< /Length 103
---
> /Length 144
7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G
14c20
< 2 0 obj
---
> 5 0 obj
17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R
23c29
< 1 0 obj
---
> 4 0 obj
25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>
29c36,45
< 6 0 obj
---
> 1 0 obj
> <<>>
> endobj
> 2 0 obj
> <<>>
> endobj
> 3 0 obj
> << /pgfprgb [/Pattern /DeviceRGB] >>
> endobj
> 9 0 obj
32c48
< 7 0 obj
---
> 10 0 obj
128c144
< 8 0 obj
---
> 11 0 obj
141c157
< /FontFile 7 0 R
---
> /FontFile 10 0 R
144c160
< 4 0 obj
---
> 7 0 obj
149c165
< /FontDescriptor 8 0 R
---
> /FontDescriptor 11 0 R
152c168
< /Widths 6 0 R
---
> /Widths 9 0 R
155c171
< 5 0 obj
---
> 8 0 obj
159c175
< /Kids [2 0 R]
---
> /Kids [5 0 R]
162c178
< 9 0 obj
---
> 12 0 obj
165c181
< /Pages 5 0 R
---
> /Pages 8 0 R
168c184
< 10 0 obj
---
> 13 0 obj
176c192
< 0 11
---
> 0 14
178,179c194,198
< 0000000287 00000 n
< 0000000176 00000 n
---
> 0000000440 00000 n
> 0000000460 00000 n
> 0000000480 00000 n
> 0000000321 00000 n
> 0000000217 00000 n
181,187c200,206
< 0000011782 00000 n
< 0000011919 00000 n
< 0000000354 00000 n
< 0000000750 00000 n
< 0000011544 00000 n
< 0000011976 00000 n
< 0000012025 00000 n
---
> 0000011964 00000 n
> 0000012102 00000 n
> 0000000533 00000 n
> 0000000929 00000 n
> 0000011724 00000 n
> 0000012159 00000 n
> 0000012209 00000 n
189,191c208,210
< << /Size 11
< /Root 9 0 R
< /Info 10 0 R
---
> << /Size 14
> /Root 12 0 R
> /Info 13 0 R
194c213
< 12105
---
> 12289


It seems to be a lot, but actually there are only few relevant changes. Most of the above are address changes to PDF objects, for example the first difference:



3c3
< 3 0 obj
---
> 6 0 obj


Says that the difference is an object which was numbered 3 and now is numberered 6. Later on references to this object will change as well (edited):



17,20c23,26
< /Contents 3 0 R
---
> /Contents 6 0 R


Also, at the end, the addresses (offset in bytes) of the objects in the file are changed because the file has changed.



The only relevant changes are three:



7a8,10
> 0 g 0 G
> 0 g 0 G
> 0 g 0 G
9c12,15
< /F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
---
> /F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
> 0 g 0 G
> 154.421 -567.87 Td [(1)]TJ
> 0 g 0 G


17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


25c31,32
< /Font << /F8 4 0 R >>
---
> /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R
> /Font << /F8 7 0 R >>


The first one is the actual text you printed. The stream without tikz was:



stream
BT
/F8 9.9626 Tf 148.712 707.125 Td [(This)-333(is)-334(a)-333(test.)]TJ 154.421 -567.87 Td [(1)]TJ
ET
endstream


and with tikz it became:



stream
0 g 0 G
0 g 0 G
0 g 0 G
BT
/F8 9.9626 Tf 148.712 657.235 Td [(This)-333(is)-334(a)-333(test.)]TJ
0 g 0 G
154.421 -567.87 Td [(1)]TJ
0 g 0 G
ET
endstream


The 0 g 0 G are color specification which are inserted in the PDF. These changes are actually inserted by the color driver and you can see them if you usepackagecolor. They are explicitly saying that the text is black, and not the default color (which is also black :).



The third difference is also related to the color driver which adds color information to the loaded fonts:



 /ColorSpace 3 0 R /Pattern 2 0 R /ExtGState 1 0 R 


(remember object number 3 which changed to 6? This statement points to the new object number 3).



Finally, the second part is related to the graphics driver:



17,20c23,26
< /Contents 3 0 R
< /Resources 1 0 R
< /MediaBox [0 0 595.276 841.89]
< /Parent 5 0 R
---
> /Contents 6 0 R
> /Resources 4 0 R
> /MediaBox [0 0 612 792]
> /Parent 8 0 R


which, apart from object references, changed the value of /MediaBox, which is basically the paper size. When you usepackagegraphics the paper size is changed from the default (which depends on how your TeX distribution is set up) to letter paper.







share|improve this answer













share|improve this answer




share|improve this answer



share|improve this answer










answered Apr 29 at 14:37









Phelype OleinikPhelype Oleinik

35.4k7 gold badges62 silver badges118 bronze badges




35.4k7 gold badges62 silver badges118 bronze badges















  • This must be one of the most complete answer I have ever seen in SX. Many thanks!

    – Paulo Ney
    Apr 29 at 15:42











  • @PauloNey I'm glad you liked :-)

    – Phelype Oleinik
    Apr 29 at 16:10

















  • This must be one of the most complete answer I have ever seen in SX. Many thanks!

    – Paulo Ney
    Apr 29 at 15:42











  • @PauloNey I'm glad you liked :-)

    – Phelype Oleinik
    Apr 29 at 16:10
















This must be one of the most complete answer I have ever seen in SX. Many thanks!

– Paulo Ney
Apr 29 at 15:42





This must be one of the most complete answer I have ever seen in SX. Many thanks!

– Paulo Ney
Apr 29 at 15:42













@PauloNey I'm glad you liked :-)

– Phelype Oleinik
Apr 29 at 16:10





@PauloNey I'm glad you liked :-)

– Phelype Oleinik
Apr 29 at 16:10


















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%2f488245%2floading-but-not-using-tikz-changes-a-file%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

Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü