0

I previously posted around an hour ago, but this is an updated, better explained, simpler question. I have the following repeated a few different times. I just need to know how to make the Box 1, Box 2, etc. bigger as the only way I could figure out how to do it was using \Huge which only makes it so big. I know OCG is not a well supported or popular package, but it's the only thing that will work right now for what I am trying to do. Any help would be great, thanks.

\documentclass[50pt]{report}
\usepackage{ocgx}
\usepackage{tikz}

\addtolength{\topmargin}{-.875in}
\addtolength{\textheight}{1.75in}

\newcommand{\myarrow}{\tikz \draw[->, line width=2mm] (0,0)--++(0,-2);}

\begin{document}
\switchocg{ocg1}{\fcolorbox{black}{white}{\bfseries \Huge Box1}}\begin{ocg}{OCG 1}{ocg1}{0}
  \colorbox{white}{ \parbox{10cm}{\colorbox{green}{\LARGE Item 1}\\\colorbox{red}{\LARGE \color{white}{Item 2}}\\\colorbox{green}{\LARGE Item 3}\\\colorbox{green}{\LARGE Item 4}\\\colorbox{red}{\LARGE \color{white}{Item 5}}}}
\end{ocg}
\indent \indent \indent \myarrow

\switchocg{ocg2}{\fcolorbox{black}{white}{\bfseries \Huge Box2}}\begin{ocg}{OCG 2}{ocg2}{0}
   \colorbox{white}{ \parbox{10cm}{\colorbox{green}{\LARGE Item 1}\\\colorbox{red}{\LARGE \color{white}{Item 2}}\\\colorbox{green}{\LARGE Item 3}\\\colorbox{red}{\LARGE \color{white}{Item 4}}}}
\end{ocg} 
\end{document}

enter image description here

  • 1
    Same as before for me : ! LaTeX Error: Environment omg undefined. :( – Christoph Frings Jun 23 '16 at 18:59
  • just out of curiosity, what is it you are trying to make? – Runar Jun 23 '16 at 19:03
  • @ChristophFrings That's weird, it's working fine for me – D. Dal Jun 23 '16 at 19:09
  • @runartrollet Sort of like a diagram where you click on the Box (there needs to 4-5 boxes), and then different items show, but some of the items will be marked one way while the others are marked another way. (Right now I have red and green which is for completed (green) or not completed (red)). While I tried \hyperref and \ChoiceMenu I couldn't differentiate the option choices, so it did not work. – D. Dal Jun 23 '16 at 19:11
  • so I've gathered. What I meant was, what will this be used for? Also, the reason it is not working is because you wrote omg instead of osg – Runar Jun 23 '16 at 19:13
2

Scaling of text can be done in various wasy. One of them is the \resizebox.

Output

enter image description here

Code

\documentclass[60pt]{report}
\usepackage{ocgx}
\usepackage{tikz}

\addtolength{\topmargin}{-.875in}
\addtolength{\textheight}{1.75in}

\newcommand{\myarrow}{\tikz \draw[->, line width=2mm] (0,0)--++(0,-2);}

\begin{document}
\switchocg{ocg1}{\fcolorbox{black}{white}{\bfseries \resizebox{5cm}{!}{Box1}}}\begin{ocg}{OCG 1}{ocg1}{0}
  \colorbox{white}{ \parbox{10cm}{\colorbox{green}{\LARGE Item 1}\\\colorbox{red}{\LARGE \color{white}{Item 2}}\\\colorbox{green}{\LARGE Item 3}\\\colorbox{green}{\LARGE Item 4}\\\colorbox{red}{\LARGE \color{white}{Item 5}}}}
\end{ocg}
\indent \indent \indent \myarrow

\switchocg{ocg2}{\fcolorbox{black}{white}{\bfseries \Huge \resizebox{5cm}{!}{Box2}}}\begin{ocg}{OCG 2}{ocg2}{0}
   \colorbox{white}{ \parbox{10cm}{\colorbox{green}{\LARGE Item 1}\\\colorbox{red}{\LARGE \color{white}{Item 2}}\\\colorbox{green}{\LARGE Item 3}\\\colorbox{red}{\LARGE \color{white}{Item 4}}}}
\end{ocg} 
\end{document}

Suggestions

  • Have a look at the documentation for the package. There are lots of examples there.
  • Use tikz. It is much better at creating fancy stuff. The package seems to suggest it also.

Think it through

If you are going to be simply updating other people on a project, by simply sending them a .pdf, I think you are better of with just a regular non-interactive document without all these buttons. Here are some of the reasons for not using this approach.

  • Compatability This only works on Acrobat Reader and a few other pdf-viewers, and none(I think) of the viewers shipped with OS's or browsers. Are you sure every person in your current and future projectgroup will be able to open it, on all their devices?
  • Old, nonmaintained code This code is no longer maintained, and could introduce unforeseen problems, that probably will be very difficult to fix.
  • Information Most people are more comfortable with a non-interactive '.pdf'. They are used to 'pdf' as being simply something visual, and will maybe not understand without being excplicidly told that certain items are interactive. This is perhaps especially true when the layout of buttons and switches are not the same as what they are seeing elsewhere in the OS.
  • Printing Some people like to have their documents on print, and will just print it at work and bring it home. They will possible be a bit annoyed when they realise you gave them a document, which had almost no information, not realizing that it was burried under the buttons.
  • Great, thanks for the help! Just one other question, do you know how to make the Items appear under the boxes or is it only possible for them to appear to the right? – D. Dal Jun 23 '16 at 19:41
  • @D.Dal Have a look at LaTeX package to use OCG (Optional Content Groups) within a PDF document I suggest switching to this syntax. If you want to use your current code, and have the arrows below, insert \` before \begin{ocg}`. Maybe put it inside a tabular. – Runar Jun 23 '16 at 19:49

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.