2

I have a tabular* object that starts from the leftmost margin. I require the method to do \begin{itemize}[leftmargin=32pt]} but with the tabular* object which makes it start after a horizontal spacing of 32pts from the left margin.

Code

\documentclass[letterpaper]{article}    % Paper Size
\usepackage[margin=0.25in]{geometry}
\raggedbottom
\raggedright

\newcommand{\resumeProjectSubheading}[3]{
    \begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} r}
        \textbf{#1 -} \textsc{#2 $\sim$} & \textit{\small #3} \\
    \end{tabular*}\vspace{-7pt}
}
\begin{document}
\resumeProjectSubheading
{TITLE}{Subtitle}{Start \emph{|} End}
\end{document}

Rendered

The first line is the result of actual execution of the code. I require the one underneath which is a shifted version of the table. I have tried multiple ways to achieve this but I have not been able to.

Rendeder

1
  • tabular is ordinarily affected by the paragraph indentation, so setting \parindent to 32pt, within a local group, should have the desired effect. (Not tested.) Dec 27, 2020 at 15:52

2 Answers 2

0

You can include the 32pt space as before-the-first-column intercolumn space, like this:

\begin{tabular*}{\textwidth}{@{\hspace{32pt}} l @{\extracolsep{\fill}} r}
    ...
\end{tabular*}
\documentclass[letterpaper]{article}
\usepackage[margin=0.25in]{geometry}

\newcommand{\resumeProjectSubheading}[3]{% <---- Better use this
  \noindent
  \begin{tabular*}{\textwidth}{@{\hspace{32pt}} l @{\extracolsep{\fill}} r}
      \textbf{#1 ---} \textsc{#2 $\sim$} & \textit{\small #3} \\
  \end{tabular*}\par\vspace{-7pt}% cleaner to use \par before \vspace
}

\begin{document}

\raggedbottom
\raggedright

\resumeProjectSubheading{TITLE}{Subtitle}{Start \slash\ End}

\end{document}

enter image description here

2
  • Thank you very much for your answer :)
    – S P Sharan
    Dec 27, 2020 at 15:47
  • Glad to help, you're welcome... to TeX.SE too! :-)
    – frougon
    Dec 27, 2020 at 15:47
0

With the help of a newlength you can easily set, adjust and change the required indentation somewhere your document and the table's alignment and width automatically adjust to the specified indentation:

enter image description here

\documentclass[letterpaper]{article}    % Paper Size
\usepackage[margin=0.25in]{geometry}
\raggedbottom
\raggedright

\newlength{\mytabintent}

\newcommand{\resumeProjectSubheading}[3]{
    \hspace*{\mytabintent}\begin{tabular*}{\dimexpr\textwidth-\mytabintent}{l @{\extracolsep{\fill}} r}
        \textbf{#1 -} \textsc{#2 $\sim$} & \textit{\small #3} \\
    \end{tabular*}\vspace{-7pt}
}

\begin{document}
\setlength{\mytabintent}{32pt}
\resumeProjectSubheading
{TITLE}{Subtitle}{Start \emph{|} End}

\setlength{\mytabintent}{0pt}
\resumeProjectSubheading
{TITLE}{Subtitle}{Start \emph{|} End}

\setlength{\mytabintent}{50pt}
\resumeProjectSubheading
{TITLE}{Subtitle}{Start \emph{|} End}

\end{document}
1
  • Thank you very much. This is a super interesting solution that taught me a lot. I preferred the other answer though as it was more straightforward.
    – S P Sharan
    Dec 27, 2020 at 15:46

You must log in to answer this question.

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