Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am very happy to know that we have a community who answers/gives hints to questions.

Here I want to post a question for you. I'm designing a brochure for our CS department. I want to have around 20–25 computer science buzzwords (I have with me) scattered around the A4 page randomly in different directions. Upon that I want to have a gradient color/image. Have anyone ever tried this.

share|improve this question
1  
Related question? Wordle-like word clouds. –  Alan Munn Aug 25 '11 at 18:43

2 Answers 2

You could use TikZ for this.

By supplying the overlay, remember picture options to the tikzpicture, you can access the current page node to position objects relative to the whole page.

The words can be supplied to a foreach loop, separated by commas. The current position in the list is available as \count. To achieve relatively even distribution across the page, I've used xshift and yshift that depend on mod(\count,<value>), which positions the words in a grid. Randomness can be introduced using another set of xshift and yshift, using rand*<length>. The random seed is usually set depending on the system time in minutes, but in order to get reproducible results you should use \pgfmathsetseed{<integer>} at the start of your picture.

Here's an example:

\documentclass{article}
\usepackage{tikz}
\begin{document}

\pagestyle{empty}

\begin{tikzpicture}[overlay,remember picture,shift=(current page.center)]
\pgfmathsetseed{3}

\fill [yellow!20] (current page.south west) rectangle (current page.north east);

\foreach [count=\count] \word in {Environmental Management,Corporate Social Responsibility,Greening,Industrial Ecology,Stakeholder Management,Life-Cycle Management,Pollution Prevention,Sustainable Development,Design for Environment,Green Design,Urban Reinvestment,Brownfield Redevelopment,ISO 14001,Waste Reduction,Closed Loops,Resource Productivity,Sustainable Technology,Radical Transactiveness,Systems Thinking,Corporate Governance} {
\node [
    xshift={(mod(\count,3)-1)*(\paperwidth/4)},
    yshift={(mod(\count,7)-3)*(\paperwidth/6)},
    xshift=rand*4cm,
    yshift=rand*2cm,
    rotate=rand*35,
    opacity=rnd*0.5+0.125,
    font=\bfseries\sffamily\large] {\word};
}

\node at (current page.north) [yshift=-8cm,scale=6,font=\sffamily\bfseries,text=orange] {BUZZWORDS!};
\node at (current page.center) [minimum width=7cm, minimum height=5cm,shade,top color=cyan!50!yellow,bottom color=green!50!red] {};
\end{tikzpicture}
\end{document}
share|improve this answer

Though for production I would recommend to use Jake's answer, but reading the question I was wondering whether similar effect may be produced in "plain" LaTeX.

For gradient filling it is better to use specialized package. However, the scattered words are easily produced with the following code:

\documentclass{article}
\usepackage{graphicx}               % to rotate 
\usepackage{picture}                % allow units in picture environment
\usepackage{eso-pic}                % allows to set up background
\usepackage[first=1,last=1000]{lcg} % pseudorandom number generator
\usepackage{calc}                   % to easily recalculate random integer to position

\begin{document}

\def\wordlist{Environmental Management,Corporate Social Responsibility,Greening,Industrial Ecology,Stakeholder Management,Life-Cycle Management,Pollution Prevention,Sustainable Development,Design for Environment,Green Design,Urban Reinvestment,Brownfield Redevelopment,ISO 14001,Waste Reduction,Closed Loops,Resource Productivity,Sustainable Technology,Radical Transactiveness,Systems Thinking,Corporate Governance}

\makeatletter                         % We need \@for construction
\newlength{\randx} \newlength{\randy} % Coordinates of the next word should be saved as random generator produces one number 
\AddToShipoutPictureBG*{
  \@for\TempVar:=\wordlist\do{%
    \rand \setlength{\randx}{\paperwidth*\ratio{\value{rand}mm}{1000mm}}  % Set random x position
    \rand \setlength{\randy}{\paperheight*\ratio{\value{rand}mm}{1000mm}} % Set random y position
    \rand  % Generate new random to use as angle
    \put(\randx,\randy){\makebox(0,0)[c]{\rotatebox{\value{rand}}{\TempVar}}}% Show next word
  }
}

\hrule \vfill {\hfill \Huge{Title} \hfill} \vfill \hrule

\end{document}

It could be better in some cases: it needs one latex run (TikZ needs two runs to correctly place graphics on page) and significantly faster.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.