Crop, not scale, the background image and produce an image instead of a pdf
up vote
2
down vote
favorite
Here is my MWE:
documentclass{standalone}
usepackage{graphicx, lipsum}
usepackage[most]{tcolorbox}
newtcolorbox{myminipage}[3]{
breakable,
blankest,
watermark graphics=#3,
watermark stretch=1,
width=#2,
#1
}
begin{document}
begin{myminipage}{3cm}{example-image}
lipsum[2]
end{myminipage}
end{document}
This is taken from here.
The background image scales. Can it be cropped, instead?
And lastly, will it be possible to produce a jpeg or png directly?
graphics crop export
add a comment |
up vote
2
down vote
favorite
Here is my MWE:
documentclass{standalone}
usepackage{graphicx, lipsum}
usepackage[most]{tcolorbox}
newtcolorbox{myminipage}[3]{
breakable,
blankest,
watermark graphics=#3,
watermark stretch=1,
width=#2,
#1
}
begin{document}
begin{myminipage}{3cm}{example-image}
lipsum[2]
end{myminipage}
end{document}
This is taken from here.
The background image scales. Can it be cropped, instead?
And lastly, will it be possible to produce a jpeg or png directly?
graphics crop export
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Here is my MWE:
documentclass{standalone}
usepackage{graphicx, lipsum}
usepackage[most]{tcolorbox}
newtcolorbox{myminipage}[3]{
breakable,
blankest,
watermark graphics=#3,
watermark stretch=1,
width=#2,
#1
}
begin{document}
begin{myminipage}{3cm}{example-image}
lipsum[2]
end{myminipage}
end{document}
This is taken from here.
The background image scales. Can it be cropped, instead?
And lastly, will it be possible to produce a jpeg or png directly?
graphics crop export
Here is my MWE:
documentclass{standalone}
usepackage{graphicx, lipsum}
usepackage[most]{tcolorbox}
newtcolorbox{myminipage}[3]{
breakable,
blankest,
watermark graphics=#3,
watermark stretch=1,
width=#2,
#1
}
begin{document}
begin{myminipage}{3cm}{example-image}
lipsum[2]
end{myminipage}
end{document}
This is taken from here.
The background image scales. Can it be cropped, instead?
And lastly, will it be possible to produce a jpeg or png directly?
graphics crop export
graphics crop export
edited 1 hour ago
asked 2 hours ago
deshmukh
1,0141326
1,0141326
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
tikzpagenodes
allows you to precisely determined the text area.
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {
includegraphics[width=textwidth,height=textheight,%
]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
lipsum[1-1]
end{document}
Here is something that crops the image against the text...
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
usetikzlibrary{tikzmark}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
path ([yshift=12pt]pic cs:start) coordinate(aux1) ([yshift=-3pt]pic cs:end) coordinate(aux2);
clip (current page text area.west |-aux1) rectangle
(current page text area.east |-aux2);
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {%
includegraphics[width=textwidth]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
tikzmark{start}lipsum[1-1]tikzmark{end}
end{document}
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
tikzpagenodes
allows you to precisely determined the text area.
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {
includegraphics[width=textwidth,height=textheight,%
]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
lipsum[1-1]
end{document}
Here is something that crops the image against the text...
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
usetikzlibrary{tikzmark}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
path ([yshift=12pt]pic cs:start) coordinate(aux1) ([yshift=-3pt]pic cs:end) coordinate(aux2);
clip (current page text area.west |-aux1) rectangle
(current page text area.east |-aux2);
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {%
includegraphics[width=textwidth]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
tikzmark{start}lipsum[1-1]tikzmark{end}
end{document}
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
add a comment |
up vote
1
down vote
tikzpagenodes
allows you to precisely determined the text area.
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {
includegraphics[width=textwidth,height=textheight,%
]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
lipsum[1-1]
end{document}
Here is something that crops the image against the text...
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
usetikzlibrary{tikzmark}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
path ([yshift=12pt]pic cs:start) coordinate(aux1) ([yshift=-3pt]pic cs:end) coordinate(aux2);
clip (current page text area.west |-aux1) rectangle
(current page text area.east |-aux2);
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {%
includegraphics[width=textwidth]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
tikzmark{start}lipsum[1-1]tikzmark{end}
end{document}
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
add a comment |
up vote
1
down vote
up vote
1
down vote
tikzpagenodes
allows you to precisely determined the text area.
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {
includegraphics[width=textwidth,height=textheight,%
]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
lipsum[1-1]
end{document}
Here is something that crops the image against the text...
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
usetikzlibrary{tikzmark}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
path ([yshift=12pt]pic cs:start) coordinate(aux1) ([yshift=-3pt]pic cs:end) coordinate(aux2);
clip (current page text area.west |-aux1) rectangle
(current page text area.east |-aux2);
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {%
includegraphics[width=textwidth]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
tikzmark{start}lipsum[1-1]tikzmark{end}
end{document}
tikzpagenodes
allows you to precisely determined the text area.
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {
includegraphics[width=textwidth,height=textheight,%
]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
lipsum[1-1]
end{document}
Here is something that crops the image against the text...
documentclass{article}
usepackage{geometry, eso-pic, tikzpagenodes, lipsum}
usetikzlibrary{tikzmark}
linespread{2}
newcommandBackgroundPic{%
begin{tikzpicture}[overlay,remember picture]
path ([yshift=12pt]pic cs:start) coordinate(aux1) ([yshift=-3pt]pic cs:end) coordinate(aux2);
clip (current page text area.west |-aux1) rectangle
(current page text area.east |-aux2);
node[anchor=north west,inner sep=0pt] at (current page text area.north west) {%
includegraphics[width=textwidth]{example-image}};
end{tikzpicture}}
geometry{
a4paper,
portrait,
margin=1in,
top=.25in,
bottom=1.75in
}
begin{document}
AddToShipoutPicture*{BackgroundPic}
thispagestyle{empty}
tikzmark{start}lipsum[1-1]tikzmark{end}
end{document}
edited 1 hour ago
answered 2 hours ago
marmot
80.4k491172
80.4k491172
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
add a comment |
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Thanks. But is not the page much larger than the text needs it to be?
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Also, I found solution to part of the problem. I will modify the question to reflect it.
– deshmukh
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes, I think a tcolorbox is a possible solution to the updated question. Do you actually still have a question? (With tikzmark one could cook up something that is truly on the background and does not influence the text, at least as long as there is no page break. I am also not saying that tikzmark is the only or the "best" possible way.)
– marmot
2 hours ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
Yes. I still have a question. The image is scaling. I wish I could crop it from, say, top left
– deshmukh
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
@deshmukh Could you please explain what "crop it from, say, top left " means? Does that mean you want no longer adjust the size of the image but literally crop it?
– marmot
1 hour ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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.
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%2f463075%2fcrop-not-scale-the-background-image-and-produce-an-image-instead-of-a-pdf%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