2

I have created a custom command as follows:

\newcommand{\projectSubheading}[3]{
%  \vspace{-1pt}
  \item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3}
    \end{tabular*}
    %\vspace{-5pt}
}

I am passing 3 fields to the command

    \projectSubheading
          {Multipurpose Unmanned Autonomous Vehicle \href{https://github.com/}{\faGithub}{Arizona, US}
{Relevant Coursework: Artificial Intelligence, Data Structure and Algorithms, System Programming and Operating Systems, Computer Networks, Soft Computing, Digital Signal Processing}

The output does not fit on the page:

enter image description here

How can I wrap the text inside the command?

1
  • The tabular columns l and r do not break the text into lines. You can use the p column type with a fixed width instead or have a look at the tabularx package.
    – siracusa
    Oct 16 '19 at 4:12
1

There seems to be no need to place the content inside a tabular-like environment. Instead, the following definition of \projectSubheading uses \hfill to spread the first two arguments, and sets the final argument as a separate paragraph.

enter image description here

\documentclass{article}

\usepackage{hyperref,fontawesome}

\newenvironment{projects}
  {\begin{itemize}}
  {\end{itemize}}

% \projectSubheading{<project>}{<location>}{<description>}
\newcommand{\projectSubheading}[3]{%
  \item
    \textbf{#1} \hfill #2 \par
    \itshape\small #3
}

\begin{document}

\begin{projects}

  \projectSubheading
    {Multipurpose Unmanned Autonomous Vehicle \href{https://github.com/}{\faGithub}}% Project
    {Arizona, US}% Location
    {Relevant Coursework: Artificial Intelligence, Data Structure and Algorithms, 
      System Programming and Operating Systems, Computer Networks, Soft Computing, Digital Signal Processing}% Description

\end{projects}

\end{document}
0

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.