2

In the code you see below I would like to add the option of introducing a picture right after the "employer"/"position" sections. Do you have any idea of how I could achieve that? (package+implementation within the \newcommand). Below you have a picture of the desired result:

enter image description here

    % Command for entering a new work position
\newcommand{\workposition}[5]{
    {\raggedleft\textsc{#1\expandafter\ifstrequal\expandafter{#2}{}{}{\hspace{6pt}\footnotesize{(#2)}}}\par} % Duration and conditional full time/part time text
    \expandafter\ifstrequal\expandafter{#3}{}{}{{\raggedright\large #3}\\} 
% Employer
    \expandafter\ifstrequal\expandafter{#4}{}{}{{\raggedright\large\textit{\textbf{#4}}}\\[4pt]} % Job title
    \expandafter\ifstrequal\expandafter{#5}{}{}{#5\\} % Description
        }
1
  • 2
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}.
    – Bobyandbob
    Aug 4, 2018 at 14:22

1 Answer 1

0

Here is a solution of mine using minipage and includegraphics:

\documentclass{article}
\usepackage{etoolbox}
\usepackage{graphicx}
\newcommand{\workposition}[6]{
  {\raggedleft\textsc{#1\expandafter\ifstrequal\expandafter{#2}{}{}{
        \hspace{6pt}\footnotesize{(#2)}}}\par
  } % Duration and conditional full time/part time text
  \begin{minipage}[T]{3cm}%
    \expandafter\ifstrequal\expandafter{#3}{}{}{
      {\raggedright\large #3}\\}%Job Title
    \expandafter\ifstrequal\expandafter{#5}{}{}{%
      {\raggedright\large\textit{\textbf{#5}}}%Employer
    }
  \end{minipage}
  \expandafter\ifstrequal\expandafter{#4}{}{}{
    \begin{minipage}[T]{0.5\textwidth}%
      \includegraphics[height=30pt]{#4}% Logo
    \end{minipage}\\[4pt]%
  }
  \expandafter\ifstrequal\expandafter{#6}{}{}{#6\\} % Description
}

\begin{document}

\workposition{potatoes}{potatoes}{potatoes}{logo}{potatoes}{potatoes}

\end{document}

EDIT:

Alternatively, if you want the image close to the employer's name you could use tabular instead of minipage. Here is an example.

\documentclass{article}
\usepackage{etoolbox}
\usepackage{graphicx}
\newcommand{\workposition}[6]{
  {\raggedleft\textsc{#1\expandafter\ifstrequal\expandafter{#2}{}{}{
        \hspace{6pt}\footnotesize{(#2)}}}\par
  } % Duration and conditional full time/part time text
  \noindent\begin{tabular}{l}
    \expandafter\ifstrequal\expandafter{#3}{}{}{%
      {\raggedright\large #3}\\}%Job Title
    \expandafter\ifstrequal\expandafter{#5}{}{}{%
      {\raggedright\large\textit{\newline\textbf{#5}}}%Employer
    }%
  \end{tabular}
  \expandafter\ifstrequal\expandafter{#4}{}{}{
    \begin{minipage}[T]{0.5\textwidth}%
      \includegraphics[height=30pt]{#4}% Logo
    \end{minipage}\\[4pt]%
  }\\[4pt]
  \expandafter\ifstrequal\expandafter{#6}{}{}{#6\\} % Description
}

\begin{document}

\workposition{potatoes}{potatoes}{potatoes}{logo}{potatoes}{potatoes}

\end{document}
3
  • Hi, thanks for replying. The only problem with this solution is that the picture is not positioned right next to the text but more in the middle. Do you have any workaround for that?
    – riversus
    Aug 4, 2018 at 18:50
  • You could use tabular instead of minipage. I edited the answer to include an example. Aug 4, 2018 at 22:37
  • Glad it helped ^^ Aug 5, 2018 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.