Aligning Graphics and multiple lines











up vote
3
down vote

favorite












I'm trying to align and image and some lines of text (not a paragraph) to resemble this.
enter image description here



this is my code:



documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{xcolor}
usepackage[10pt]{moresize}
usepackage{graphicx}
usepackage[a6paper]{geometry}
usepackage{fancyhdr}
usepackage{hyperref}
usepackage{wrapfig}
usepackage{amssymb}
usepackage{amsmath}
usepackage{enumitem}
usepackage{soul}
usepackage[T1]{fontenc}
usepackage{lipsum}
usepackage{fontspec}

definecolor{blu1000}{RGB}{15, 57, 101}
definecolor{marrone1000}{HTML}{a4895e}
definecolor{marronescuro1000}{HTML}{483a26}

begin{document}
vspace*{-5baselineskip}
nullhfill {color{marrone1000} tiny Certificato d'iscrizione} \ [baselineskip]

vspace*{2baselineskip}
centering
includegraphics[height=2.5cm]{img-1} \ [baselineskip]
color{marrone1000}{
noindentframebox[3cm][c]{color{blu1000}textbf{N. 1001-P}}
noindentframebox[3cm][c]{color{blu1000}textbf{1001-P-YY-YY}} \ [.15baselineskip]
}
raggedright hspace{2.5em}tiny color{marrone1000} Identification Number hspace{5.7em}tiny Certificate Number \ [baselineskip]
centering
color{blu1000}{
noindentframebox[6cm][c]{normalsizecolor{blu1000}textbf{Class Winner}} \ [.15baselineskip]
raggedright hspace{5em}tiny Category \ [3baselineskip]
}

vspace{5baselineskip}

begin{wrapfigure}{l}{.4textwidth}
vspace{-24pt}
hspace{-14em}
centering
includegraphics[width=0.40textwidth]{default_qrcode}
% vspace{-20pt}
end{wrapfigure}

textcolor{blu1000}{CERTIFICATE} \ [2baselineskip]
color{marrone1000}{
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Date of Issue \ [2baselineskip]}
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Expiry Date\ [2baselineskip]}
}
clearpage
end{document}


Resulting
enter image description here



I'm using XeLatex and I'd like to left align the text as in 1










share|improve this question
























  • welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
    – Zarko
    Nov 12 at 23:47










  • Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
    – Sukhdev Mohan
    Nov 13 at 0:00

















up vote
3
down vote

favorite












I'm trying to align and image and some lines of text (not a paragraph) to resemble this.
enter image description here



this is my code:



documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{xcolor}
usepackage[10pt]{moresize}
usepackage{graphicx}
usepackage[a6paper]{geometry}
usepackage{fancyhdr}
usepackage{hyperref}
usepackage{wrapfig}
usepackage{amssymb}
usepackage{amsmath}
usepackage{enumitem}
usepackage{soul}
usepackage[T1]{fontenc}
usepackage{lipsum}
usepackage{fontspec}

definecolor{blu1000}{RGB}{15, 57, 101}
definecolor{marrone1000}{HTML}{a4895e}
definecolor{marronescuro1000}{HTML}{483a26}

begin{document}
vspace*{-5baselineskip}
nullhfill {color{marrone1000} tiny Certificato d'iscrizione} \ [baselineskip]

vspace*{2baselineskip}
centering
includegraphics[height=2.5cm]{img-1} \ [baselineskip]
color{marrone1000}{
noindentframebox[3cm][c]{color{blu1000}textbf{N. 1001-P}}
noindentframebox[3cm][c]{color{blu1000}textbf{1001-P-YY-YY}} \ [.15baselineskip]
}
raggedright hspace{2.5em}tiny color{marrone1000} Identification Number hspace{5.7em}tiny Certificate Number \ [baselineskip]
centering
color{blu1000}{
noindentframebox[6cm][c]{normalsizecolor{blu1000}textbf{Class Winner}} \ [.15baselineskip]
raggedright hspace{5em}tiny Category \ [3baselineskip]
}

vspace{5baselineskip}

begin{wrapfigure}{l}{.4textwidth}
vspace{-24pt}
hspace{-14em}
centering
includegraphics[width=0.40textwidth]{default_qrcode}
% vspace{-20pt}
end{wrapfigure}

textcolor{blu1000}{CERTIFICATE} \ [2baselineskip]
color{marrone1000}{
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Date of Issue \ [2baselineskip]}
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Expiry Date\ [2baselineskip]}
}
clearpage
end{document}


Resulting
enter image description here



I'm using XeLatex and I'd like to left align the text as in 1










share|improve this question
























  • welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
    – Zarko
    Nov 12 at 23:47










  • Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
    – Sukhdev Mohan
    Nov 13 at 0:00















up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm trying to align and image and some lines of text (not a paragraph) to resemble this.
enter image description here



this is my code:



documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{xcolor}
usepackage[10pt]{moresize}
usepackage{graphicx}
usepackage[a6paper]{geometry}
usepackage{fancyhdr}
usepackage{hyperref}
usepackage{wrapfig}
usepackage{amssymb}
usepackage{amsmath}
usepackage{enumitem}
usepackage{soul}
usepackage[T1]{fontenc}
usepackage{lipsum}
usepackage{fontspec}

definecolor{blu1000}{RGB}{15, 57, 101}
definecolor{marrone1000}{HTML}{a4895e}
definecolor{marronescuro1000}{HTML}{483a26}

begin{document}
vspace*{-5baselineskip}
nullhfill {color{marrone1000} tiny Certificato d'iscrizione} \ [baselineskip]

vspace*{2baselineskip}
centering
includegraphics[height=2.5cm]{img-1} \ [baselineskip]
color{marrone1000}{
noindentframebox[3cm][c]{color{blu1000}textbf{N. 1001-P}}
noindentframebox[3cm][c]{color{blu1000}textbf{1001-P-YY-YY}} \ [.15baselineskip]
}
raggedright hspace{2.5em}tiny color{marrone1000} Identification Number hspace{5.7em}tiny Certificate Number \ [baselineskip]
centering
color{blu1000}{
noindentframebox[6cm][c]{normalsizecolor{blu1000}textbf{Class Winner}} \ [.15baselineskip]
raggedright hspace{5em}tiny Category \ [3baselineskip]
}

vspace{5baselineskip}

begin{wrapfigure}{l}{.4textwidth}
vspace{-24pt}
hspace{-14em}
centering
includegraphics[width=0.40textwidth]{default_qrcode}
% vspace{-20pt}
end{wrapfigure}

textcolor{blu1000}{CERTIFICATE} \ [2baselineskip]
color{marrone1000}{
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Date of Issue \ [2baselineskip]}
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Expiry Date\ [2baselineskip]}
}
clearpage
end{document}


Resulting
enter image description here



I'm using XeLatex and I'd like to left align the text as in 1










share|improve this question















I'm trying to align and image and some lines of text (not a paragraph) to resemble this.
enter image description here



this is my code:



documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage{xcolor}
usepackage[10pt]{moresize}
usepackage{graphicx}
usepackage[a6paper]{geometry}
usepackage{fancyhdr}
usepackage{hyperref}
usepackage{wrapfig}
usepackage{amssymb}
usepackage{amsmath}
usepackage{enumitem}
usepackage{soul}
usepackage[T1]{fontenc}
usepackage{lipsum}
usepackage{fontspec}

definecolor{blu1000}{RGB}{15, 57, 101}
definecolor{marrone1000}{HTML}{a4895e}
definecolor{marronescuro1000}{HTML}{483a26}

begin{document}
vspace*{-5baselineskip}
nullhfill {color{marrone1000} tiny Certificato d'iscrizione} \ [baselineskip]

vspace*{2baselineskip}
centering
includegraphics[height=2.5cm]{img-1} \ [baselineskip]
color{marrone1000}{
noindentframebox[3cm][c]{color{blu1000}textbf{N. 1001-P}}
noindentframebox[3cm][c]{color{blu1000}textbf{1001-P-YY-YY}} \ [.15baselineskip]
}
raggedright hspace{2.5em}tiny color{marrone1000} Identification Number hspace{5.7em}tiny Certificate Number \ [baselineskip]
centering
color{blu1000}{
noindentframebox[6cm][c]{normalsizecolor{blu1000}textbf{Class Winner}} \ [.15baselineskip]
raggedright hspace{5em}tiny Category \ [3baselineskip]
}

vspace{5baselineskip}

begin{wrapfigure}{l}{.4textwidth}
vspace{-24pt}
hspace{-14em}
centering
includegraphics[width=0.40textwidth]{default_qrcode}
% vspace{-20pt}
end{wrapfigure}

textcolor{blu1000}{CERTIFICATE} \ [2baselineskip]
color{marrone1000}{
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Date of Issue \ [2baselineskip]}
noindent rule{3cm}{0.4pt} \ [0.15baselineskip] hspace{-6em}{Expiry Date\ [2baselineskip]}
}
clearpage
end{document}


Resulting
enter image description here



I'm using XeLatex and I'd like to left align the text as in 1







xetex wrapfigure






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 23:57

























asked Nov 12 at 23:34









Sukhdev Mohan

254




254












  • welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
    – Zarko
    Nov 12 at 23:47










  • Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
    – Sukhdev Mohan
    Nov 13 at 0:00




















  • welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
    – Zarko
    Nov 12 at 23:47










  • Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
    – Sukhdev Mohan
    Nov 13 at 0:00


















welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
– Zarko
Nov 12 at 23:47




welcome to tex.se! please extend your code snippet to complete small document which we can test as it is. why do you use wrapfigure?
– Zarko
Nov 12 at 23:47












Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
– Sukhdev Mohan
Nov 13 at 0:00






Hello, thanks @Zarko for the welcome. I've added the code of the page where it should be. I'm using wrapfigure because I wanted to align the image and text and after googling a lot, I was told that this was the correct way, but as you can see had to fix some spacing... would gladly remove that if I could do it better... Thanks
– Sukhdev Mohan
Nov 13 at 0:00












1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










see if the following solution is acceptable to you:



documentclass{article}
usepackage[showframe, % <--- in real document delete option "showframe"
a6paper]{geometry}
usepackage{fontspec}

usepackage{xcolor}
definecolor{marrone1000}{HTML}{a4895e}

usepackage[10pt]{moresize}
usepackage[demo, % <--- in real document delete option "demo"
export]{adjustbox} % <--- it load the graphicx package

begin{document}
begin{center}
begin{minipage}[t]{0.3linewidth}centering
includegraphics[height=2.5cm, width=linewidth,valign=t]{img-1}
end{minipage}
quad
begin{minipage}[t]{0.3linewidth}raggedright
CERTIFICATE \[1.5baselineskip]
tiny
color{marrone1000}
rule[-0.5ex]{linewidth}{0.2pt}
Date of issue: \[1.5baselineskip]
rule[-0.5ex]{linewidth}{0.2pt}
Expire date
end{minipage}
end{center}
end{document}


as you can see, i reduce your document example to mwe (minimal working example), which produce result similar to the first image in your question.



edit: for aligning of image in the first minipage it is necessary to move its baseline from its middle to the top. this is done by use of the adjustbox with option export. This package also load the graphicx package.



enter image description here



(lines around image and text shows page layout)






share|improve this answer























  • Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
    – Sukhdev Mohan
    Nov 13 at 0:50











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%2f459707%2faligning-graphics-and-multiple-lines%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
3
down vote



accepted










see if the following solution is acceptable to you:



documentclass{article}
usepackage[showframe, % <--- in real document delete option "showframe"
a6paper]{geometry}
usepackage{fontspec}

usepackage{xcolor}
definecolor{marrone1000}{HTML}{a4895e}

usepackage[10pt]{moresize}
usepackage[demo, % <--- in real document delete option "demo"
export]{adjustbox} % <--- it load the graphicx package

begin{document}
begin{center}
begin{minipage}[t]{0.3linewidth}centering
includegraphics[height=2.5cm, width=linewidth,valign=t]{img-1}
end{minipage}
quad
begin{minipage}[t]{0.3linewidth}raggedright
CERTIFICATE \[1.5baselineskip]
tiny
color{marrone1000}
rule[-0.5ex]{linewidth}{0.2pt}
Date of issue: \[1.5baselineskip]
rule[-0.5ex]{linewidth}{0.2pt}
Expire date
end{minipage}
end{center}
end{document}


as you can see, i reduce your document example to mwe (minimal working example), which produce result similar to the first image in your question.



edit: for aligning of image in the first minipage it is necessary to move its baseline from its middle to the top. this is done by use of the adjustbox with option export. This package also load the graphicx package.



enter image description here



(lines around image and text shows page layout)






share|improve this answer























  • Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
    – Sukhdev Mohan
    Nov 13 at 0:50















up vote
3
down vote



accepted










see if the following solution is acceptable to you:



documentclass{article}
usepackage[showframe, % <--- in real document delete option "showframe"
a6paper]{geometry}
usepackage{fontspec}

usepackage{xcolor}
definecolor{marrone1000}{HTML}{a4895e}

usepackage[10pt]{moresize}
usepackage[demo, % <--- in real document delete option "demo"
export]{adjustbox} % <--- it load the graphicx package

begin{document}
begin{center}
begin{minipage}[t]{0.3linewidth}centering
includegraphics[height=2.5cm, width=linewidth,valign=t]{img-1}
end{minipage}
quad
begin{minipage}[t]{0.3linewidth}raggedright
CERTIFICATE \[1.5baselineskip]
tiny
color{marrone1000}
rule[-0.5ex]{linewidth}{0.2pt}
Date of issue: \[1.5baselineskip]
rule[-0.5ex]{linewidth}{0.2pt}
Expire date
end{minipage}
end{center}
end{document}


as you can see, i reduce your document example to mwe (minimal working example), which produce result similar to the first image in your question.



edit: for aligning of image in the first minipage it is necessary to move its baseline from its middle to the top. this is done by use of the adjustbox with option export. This package also load the graphicx package.



enter image description here



(lines around image and text shows page layout)






share|improve this answer























  • Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
    – Sukhdev Mohan
    Nov 13 at 0:50













up vote
3
down vote



accepted







up vote
3
down vote



accepted






see if the following solution is acceptable to you:



documentclass{article}
usepackage[showframe, % <--- in real document delete option "showframe"
a6paper]{geometry}
usepackage{fontspec}

usepackage{xcolor}
definecolor{marrone1000}{HTML}{a4895e}

usepackage[10pt]{moresize}
usepackage[demo, % <--- in real document delete option "demo"
export]{adjustbox} % <--- it load the graphicx package

begin{document}
begin{center}
begin{minipage}[t]{0.3linewidth}centering
includegraphics[height=2.5cm, width=linewidth,valign=t]{img-1}
end{minipage}
quad
begin{minipage}[t]{0.3linewidth}raggedright
CERTIFICATE \[1.5baselineskip]
tiny
color{marrone1000}
rule[-0.5ex]{linewidth}{0.2pt}
Date of issue: \[1.5baselineskip]
rule[-0.5ex]{linewidth}{0.2pt}
Expire date
end{minipage}
end{center}
end{document}


as you can see, i reduce your document example to mwe (minimal working example), which produce result similar to the first image in your question.



edit: for aligning of image in the first minipage it is necessary to move its baseline from its middle to the top. this is done by use of the adjustbox with option export. This package also load the graphicx package.



enter image description here



(lines around image and text shows page layout)






share|improve this answer














see if the following solution is acceptable to you:



documentclass{article}
usepackage[showframe, % <--- in real document delete option "showframe"
a6paper]{geometry}
usepackage{fontspec}

usepackage{xcolor}
definecolor{marrone1000}{HTML}{a4895e}

usepackage[10pt]{moresize}
usepackage[demo, % <--- in real document delete option "demo"
export]{adjustbox} % <--- it load the graphicx package

begin{document}
begin{center}
begin{minipage}[t]{0.3linewidth}centering
includegraphics[height=2.5cm, width=linewidth,valign=t]{img-1}
end{minipage}
quad
begin{minipage}[t]{0.3linewidth}raggedright
CERTIFICATE \[1.5baselineskip]
tiny
color{marrone1000}
rule[-0.5ex]{linewidth}{0.2pt}
Date of issue: \[1.5baselineskip]
rule[-0.5ex]{linewidth}{0.2pt}
Expire date
end{minipage}
end{center}
end{document}


as you can see, i reduce your document example to mwe (minimal working example), which produce result similar to the first image in your question.



edit: for aligning of image in the first minipage it is necessary to move its baseline from its middle to the top. this is done by use of the adjustbox with option export. This package also load the graphicx package.



enter image description here



(lines around image and text shows page layout)







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 13 at 5:10

























answered Nov 13 at 0:34









Zarko

116k865154




116k865154












  • Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
    – Sukhdev Mohan
    Nov 13 at 0:50


















  • Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
    – Sukhdev Mohan
    Nov 13 at 0:50
















Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
– Sukhdev Mohan
Nov 13 at 0:50




Awesome! thanks a lot, that's it. Most of the code you saw was because I just came into XeTeX from pure LaTex but I'm liking this more. Thanks again.
– Sukhdev Mohan
Nov 13 at 0:50


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459707%2faligning-graphics-and-multiple-lines%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

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?