1

How can I get the results I described in the picture?

Latex output

\documentclass[%
   draft=false,   
   paper=a4
   paper=portrait,
   pagesize=auto,
   fontsize=11pt
   version=last,
   english, 
]{scrbook}

\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Description and examples of I do not want}
\includegraphics[width=4ex]{symbols/symbol_q.PNG} The text should be automatically always in he middle of the symbol. Here it is wrong. And the second line is at the beginning not in vertical line with the first line.\\ \\
\includegraphics[width=4ex]{symbols/symbol_l.PNG} The text should be automatically always in he middle of the symbol. Here it is wrong. And the second line is at the beginning not in vertical line with the first line.\\ \\
\includegraphics[width=4ex]{symbols/symbol_q.PNG} Not perfect in he middle of the symbol. It is at the bottem.\\ \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{This is almost perfect}
\begin{wrapfigure}[3]{l}[0pt]{0.05\textwidth}
\includegraphics[width=4ex]{symbols/symbol_q.PNG}
\vspace{-2\baselineskip}
\end{wrapfigure}
The text should be automatically always in he middle of the symbol. Here it is almost \textbf{perfect}. And the second line is at the beginning \textbf{perfect} in vertical line with the first line!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The first is almost perfect. How I can handle the others? I did not know!}
\begin{wrapfigure}{l}{0.05\textwidth}
\includegraphics[width=4ex]{symbols/symbol_q.PNG}
\vspace{-2\baselineskip}
\end{wrapfigure}
The text should be automatically always in he middle of the symbol. Here it is almost \textbf{perfect}. And the second line is at the beginning \textbf{perfect} in vertical line with the first line!
\\
\begin{wrapfigure}{l}{0.05\textwidth}
\includegraphics[width=4ex]{symbols/symbol_l.PNG}
\vspace{-2\baselineskip}
\end{wrapfigure}
The text should be automatically always in he middle of the symbol. And the second line should be at the beginning in vertical line with the first line.
\\
\begin{wrapfigure}{L}{0.05\textwidth}
\includegraphics[width=4ex]{symbols/symbol_q.PNG}
\vspace{-2\baselineskip}
\end{wrapfigure}
The text should be automatically always in he middle of the symbol. And the second line should be at the beginning in vertical line with the first line.
\vspace{5\baselineskip}
\end{document}

You need at least 10 reputation to post more than 2 links.

So, sorry, only one symbol-Picture possible!

Symbol_l

1

2 Answers 2

1

The following is not breakable across the page boundary, but sets the image vertically centred with respect to the text provided:

enter image description here

\documentclass{article}

\usepackage{graphicx, tabularx}
\usepackage[nopar]{lipsum}

\newenvironment{centerentry}[2][]
  {\renewcommand{\tabularxcolumn}[1]{m{##1}}
   \noindent
   \tabularx{\linewidth}{ @{} m{\imagecolwidth} X @{} }
     \includegraphics[width=\linewidth,#1]{#2} &
  }{%
   \endtabularx%
  }
\newlength{\imagecolwidth}
\setlength{\imagecolwidth}{2em}

\sloppy% Just for this example

\begin{document}

\section{A section}

\begin{centerentry}{example-image-a}
  \lipsum[1]
\end{centerentry}

\begin{centerentry}[height=5em]{example-image-b}
  \lipsum[2]
\end{centerentry}

\end{document}

You can adjust the width of the image column (yes, the structure is set inside a tabularx) by adjusting the length \imagecolwidth. For example,

\setlength{\imagecolwidth}{5em}
1

I think you can just use simple parboxes

enter image description here

\documentclass[%
   draft=false,   
   paper=a4
   paper=portrait,
   pagesize=auto,
   fontsize=11pt
   version=last,
   english, 
]{scrbook}

\usepackage{graphicx}

\newcommand\zz[2]{%
\begin{flushleft}%
\parbox{3em}{\includegraphics[width=\linewidth]{#1}}%
\hfil
\parbox{\dimexpr\textwidth-3.5em}{#2}%
\end{flushleft}}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Description and examples of I do not want}

\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. Here it is wrong. And the second line is at the beginning
  not in vertical line with the first line.}

\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. Here it is wrong. And the second line is at the beginning
  not in vertical line with the first line.}

\zz{example-image}
{Not perfect in he middle of the symbol. It is at the bottem.}% never do this!!!!\\ \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{This is almost perfect}

\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. Here it is almost \textbf{perfect}. And the second line is
  at the beginning \textbf{perfect} in vertical line with the first
  line!}

\section{The first is almost perfect. How I can handle the others? I did not know!}

\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. Here it is almost \textbf{perfect}. And the second line is
  at the beginning \textbf{perfect} in vertical line with the first
  line!}


\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. And the second line should be at the beginning in vertical
  line with the first line.}


\zz{example-image}
{The text should be automatically always in he middle of the
  symbol. And the second line should be at the beginning in vertical
  line with the first line.}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .