19

Is there a way to fold/unfold certain sections in a pdf. Only when the user clicks on the section or plus sign the items show up.

Example: user clicks on the plus sign and the items appear as drop down list.

10
  • 4
    You can create things like drop-down menus etc. However, if this is a CV, I strongly recommend not to do this.
    – cfr
    Commented Apr 16, 2014 at 20:39
  • 4
    Do you know which PDF viewer potential employers will view your CV in? Because many of these features work only in certain viewers. Typically, they work in (certain versions of) Adobe Reader and you take your chances with anything else. Also, what if somebody wants to print your CV? You wouldn't be able to use it in any situation where your application might be circulated on paper. (So that rules out all actual job applications.) At best you could post it online with a note that it requires Adobe Reader version n. That is bound to annoy somebody.
    – cfr
    Commented Apr 16, 2014 at 20:47
  • 1
    Accepted. I drop this idea. Commented Apr 16, 2014 at 20:51
  • 3
    Still it is a good question, with other applications too.
    – alfC
    Commented Apr 16, 2014 at 20:58
  • 1
    Yes, "unfortunately" the OP mentioned CV in a comment. The question is well posed still (and it doesn't mention CV).
    – alfC
    Commented Apr 16, 2014 at 21:16

1 Answer 1

14

"Folding" is a typical application for PDF layers (OCG). This works in most recent viewers, but problems might arise with crippled poppler based so called PDF viewers on Linux

\documentclass[a4paper]{minimal}
\usepackage{ocgx}
\begin{document}
Max Mustermann \switchocg{ocg1}{\fcolorbox{blue}{red}{\bfseries +}}\begin{ocg}{OCG 1}{ocg1}{0}
  \colorbox{yellow}{ \parbox{5cm}{Max Mustermann\\Musterweg 1\\12345 Musterstadt}}
\end{ocg}

Erika Mustermann
\end{document}

folded unfolded

Add a note: Best viewed with Adobe Reader! ;-)

11
  • 3
    Even works in evince (Poppler based ;).
    – AlexG
    Commented Apr 17, 2014 at 12:48
  • 2
    Referring to poppler-based PDF viewers as 'crippled' is offensive, frankly. Unlike Adobe's Reader, my poppler-based viewer is, in fact, not crippled by design. Reader is.
    – cfr
    Commented Jul 4, 2015 at 2:02
  • 2
    @AlexG Doesn't work in Okular which is also Poppler based.
    – cfr
    Commented Jul 4, 2015 at 2:02
  • 2
    @AlexG Just saw your earlier comment. No, of course I wasn't referring to your comment there. I was referring to the OP's description in the answer. The answer describes poppler-based PDF viewers as 'crippled poppler based so called PDF viewers on Linux' which strikes me as a bit rich considering Adobe distributes deliberately crippled viewers and no longer supports Linux at all.
    – cfr
    Commented Jul 4, 2015 at 12:47
  • 1
    How would you insert a \switchocg inside of an \eqnarray or \align. This is related to this question: tex.stackexchange.com/questions/431853/…
    – ranlot
    Commented May 16, 2018 at 13:28

You must log in to answer this question.

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