To add the image, you can use the fromlogo
insert:
\setkomavar{fromlogo}{<contents>}
To get rid of the folding marks, replace
foldmarks=true
with
foldmarks=false
A complete example (depending on your actual image, you might need to adjust some of the lengths used):
% Original author:
% Micha Elmueller (http://micha.elmueller.net/)
\documentclass[
pagenumber=false, % Removes page numbers from page 2 onwards
parskip=half, % Separates paragraphs with some whitespace, use parskip=full for more space or comment out to return to default
fromalign=right, % Aligns the from address to the right
foldmarks=false, % If "true", prints small fold marks on the left of the page
addrfield=true, % Set to false to hide the addressee section - you will then want to adjust the height of the body of the letter on the page by adding the following in this section: \makeatletter \@setplength{refvpos}{\useplength{toaddrvpos}} \makeatletter
fromlogo=true
]{scrlttr2}
\usepackage[english]{babel} % Explicitly load the babel package to stop an error occurring on some LaTeX installations
\renewcommand*{\raggedsignature}{\raggedright} % Stop the signature from indenting
\usepackage{graphicx}
%----------------------------------------------------------------------------------------
% YOUR INFORMATION AND LETTER DATE
%----------------------------------------------------------------------------------------
\setkomavar{fromname}{John Smith} % Your name used in the from address
\setkomavar{fromaddress}{123 Broadway \\ City, State 12345} % Your address
\setkomavar{signature}{John Smith} % Your name used in the signature
\setkomavar{fromlogo}{\raisebox{-2pt}{\includegraphics[width=5.84cm,height=1.5cm]{example-image-a}}}
\date{\today} % Date of the letter
%----------------------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
% ADDRESSEE
%----------------------------------------------------------------------------------------
\begin{letter}{Director \\ Corporation \\ 123 Pleasant Lane \\ City, State 12345} % Addressee name and address
%----------------------------------------------------------------------------------------
% LETTER CONTENT
%----------------------------------------------------------------------------------------
%\includeimage[width=5cm,height=2cm]{example-image-a}
\opening{Dear Sir or Madam,}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquet tellus vel justo porta et semper libero rutrum. Duis vestibulum sagittis aliquam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac velit eu dolor lobortis fringilla. Quisque imperdiet porta ante in pretium. Maecenas facilisis varius metus et blandit. Proin rhoncus arcu non ante elementum non vehicula sem varius. Morbi feugiat, elit eget tristique posuere, urna eros vestibulum nibh, at tempus neque justo nec enim.
Curabitur id est enim. Suspendisse potenti. Fusce eleifend sodales tortor, a interdum tortor sollicitudin vel. Morbi vel tellus enim, eget hendrerit ligula. Proin molestie suscipit erat, eget consectetur orci convallis at. Ut vestibulum, odio vitae blandit dignissim, dui magna auctor leo, at molestie augue magna sed nisi. Phasellus ipsum magna, fringilla id tempor id, tristique vitae mauris. Maecenas sed orci vel eros consectetur ultrices.
Mauris enim velit, feugiat at venenatis eu, scelerisque vitae mauris. Nullam accumsan facilisis mauris sagittis iaculis. Mauris condimentum dictum libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam consequat malesuada feugiat. Vestibulum tempor commodo turpis id gravida.
\closing{Sincerely,}
\setkomavar*{enclseparator}{Attached} % Change the default "encl:" to "Attached:"
\encl{Copyright permission form} % Attached documents
%----------------------------------------------------------------------------------------
\end{letter}
\end{document}
To remove the from information from the "backadress" and its rule, add
backaddress=off
to the class options, as in
\documentclass[
pagenumber=false,
parskip=half,
fromalign=right,
foldmarks=false,
addrfield=true,
fromlogo=true,
backaddress=off
]{scrlttr2}
You can use adjustbox
with its export
option which will make keys like max width
, available inside \includegraphics
. Also, it offers keys width
, height
etc to be used for adjustbox
environment.
Here is a sample.
\documentclass{article}
\usepackage[export]{adjustbox}
\usepackage{showframe} %% for demo
\setkeys{Gin}{height=2cm}
\begin{document}
\noindent
\begin{adjustbox}{width=\textwidth}
\includegraphics{helen19}
\includegraphics{helen18}
\includegraphics{helen20}
\includegraphics{helen22}
\includegraphics{helen19}
\includegraphics{helen18}
\end{adjustbox}
\bigskip
\noindent
\begin{adjustbox}{max width=0.8\textwidth} %% change to \textwidth and see
\includegraphics[height=1.5cm]{helen19}
\includegraphics[height=1.5cm]{helen18}
\includegraphics[height=1.5cm]{helen20}
\includegraphics[height=1.5cm]{helen22}
\includegraphics[height=1.5cm]{helen19}
\includegraphics[height=1.5cm]{helen18}
\includegraphics[height=1.5cm]{helen20}
\includegraphics[height=1.5cm]{helen22}
\end{adjustbox}
\end{document}
Best Answer
Environment
textblock
has also an optional parameter that specifies the anchor point of the text block:[0,1]
means, the left bottom corner. Then you do not need to know the height of the image:Measurements
In this case the height of the image does not need to be known. In other circumstances it can be useful to get the height.
The height of the image can be measured by
\settoheight
:Or the image can be put into a box:
The height, depth, and width of the box are available via:
\ht\imagebox
,\dp\imagebox
or\wd\imagebox
. (LaTeX purists can use packagesettobox
instead.)