0

I was trying to get a hanging indentation, so an indentation from second line. There are multiple answers for how to achieve this in general texts or lists. But I could not transfer them to the curve package in a rubric environment.

MWE:

% doc.tex
\documentclass[a4paper,11pt]{curve}

\begin{document}
\makerubric{history}
\end{document}

% history.tex
\begin{rubric}{History}
\entry*[2018]%
    \textbf{That's now}.
\entry*[2016 -- \rlap{$\:\:\dots$}\phantom{2016}]
    \textbf{Last two years}. Great times.
\entry*[2012 -- 2016]%
    \textbf{A few years before}. If there is a long entry like this one
    I would like to have a hanging indentation (i.\,e. indentation from second line).
\end{rubric}

MWE looks like this

I was trying to look into curve.cls, but this is way beyond my understanding of tex. I think it has to do with the \entry command from there:

\newcommand\@entry[2][]{%
  \gdef\@nextentry{}\@key{#1}%
  \egroup% end of \noalign opened in \entry.
  \@@key&\@prefix&#2\\\par}

\newcommand\@sentry[1][]{%
  \gdef\@nextentry{\\\par}\@key{#1}%
  \egroup% end of \noalign opened in \entry.
  \@@key&\@prefix&}

\newcommand\entry{%
  \@nextentry
  \noalign\bgroup\gdef\@beforespace{\subrubricbeforespace}%
  \@ifstar{\@sentry}{\@entry}}

It looks like there is just one paragraph with the bullet point on the left. I tried the hanging package, the built-in commands (see e.g. https://stackoverflow.com/questions/3254054/), but I'm a bit lost now.

  • 1
    @carlisle - I seem to be having a problem loading ltxtable.sty. The manual is still there, but neither MikTeX nor the package manager can find it. BTW, one can probably fix the above using \parbox{\linewidth}{\hangindent=.5in ...} – John Kormylo Jun 2 '18 at 15:43
  • @JohnKormylo Thanks for this easy idea - works! :D – nox Jun 14 '18 at 9:40
  • The \parbox has a smaller spacing to the next entry though... – nox Jun 14 '18 at 10:02
  • @JohnKormylo Alright, I have a fully working solution now, using a parbox, redefining \@entry[2][]. Do you want to post an answer, or would it be ok if I answer my working solution with corrected spaces now? – nox Jun 14 '18 at 11:23
  • I've lost my working file and never got curve to run. Answering you own question if fine. – John Kormylo Jun 15 '18 at 17:16
0

Thanks to John Kormylo (see comments above) I found the solution below for my problem. I had to use the \entry{} command rather than \entry* to make it work.

There was an issue with too small spaces after the parbox, corrected by the \strut usage, taken from here: Vertical space after minipage (EDIT : in an environment).

I added a second long line to show the corrected spacing. Note the [t] in \parbox[t]. This is neccessary to have the bullet point on the first line rather than the center of the parbox. In the questionable case of having more than one paragraph in the parbox, there are curly brackets after \hangindent. This will make it work for all paragraphs instead of just the first one.

% doc.tex
\documentclass[a4paper,11pt]{curve}

\makeatletter
\renewcommand\@entry[2][]{%
    \gdef\@nextentry{}\@key{#1}%
    \egroup% end of \noalign opened in \entry.
    \@@key&\@prefix&\parbox[t]{\linewidth}{\hangindent=2em {\strut#2\strut}}\\\par}
\makeatother

\begin{document}
\makerubric{history}
\end{document}

% history.tex
\begin{rubric}{History}
\entry*[2018]%
    \textbf{That's now}.
\entry*[2016 -- \rlap{$\:\:\dots$}\phantom{2016}]
    \textbf{Last two years}. Great times.
\entry[2012 -- 2016]%
    {\textbf{A few years before}. If there is a long entry like this one
    I would like to have a hanging indentation (i.\,e. indentation from second line).}
\entry[2010]%
    {If there is a long entry like this one
    I would like to have a hanging indentation (i.\,e. indentation from second line).}
\end{rubric}

MWE

  • There seems to be an error with the current texlive version in arch linux (texlive-core-2018.47471-1-any.pkg.tar.xz). It moves the first entry up, very close to the rubric title and if it is just one line, the second line will still have the same position as without moving the first line, so there's a gap between first and second line. – nox Jun 16 '18 at 15:40

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.