How to: Position text on the line to make multi-line patterns?

How to: Position text on the line to make multi-line patterns?

Post by Julian I-D » Tue, 01 Dec 2009 22:58:24


I am trying to create shapes with multiple lines of (centered) text
like the illustration below in which words in all caps are to appear,
and words in lower case are not; obviously the alignment doesn't work
properly here as the case changes, but you get the idea I hope.

THIS IS a contrived example of how i want my text TO APPEAR
this is A CONTRIVED example of how i WANT MY TEXT to appear
this is a contrived EXAMPLE of HOW I want my text to appear
this is a contrived example OF how i want my text to appear

(My own attempt have failed owing to horizontal spacing being stripped
from ends of lines - I think.)

Thank you.
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Franis Pat » Tue, 01 Dec 2009 23:16:50

Le 30/11/2009 14:58, Julian I-Do-Stuff a rit :
THIS IS \phantom{a contrived example of how i want my text }TO APPEAR

\phantom{this is} A CONTRIVED \phantom{example of how i }WANT MY TEXT
\phantom{to appear}

\phantom{this is a contrived }EXAMPLE \phantom{of} HOW \phantom{I want
my text to appear}

\phantom{this is a contrived example }OF \phantom{how i want my text to
appear}

But I maybe did not understand what you want.

--
Franis Patte
UniversitParis Descartes

 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Jori » Tue, 01 Dec 2009 23:21:44

On Nov 30, 9:16m, Franis Patte


I suspect what he wants involves capitalizing everything within the
phantom brackets.
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Julian I-D » Tue, 01 Dec 2009 23:54:57

On 30 Nov, 15:16, Franis Patte < XXXX@XXXXX.COM >


You understood perfectly. \phantom was my 1st guess, then \hphantom...
but they don't work - leading and trailing space is disappearing

e.g. on line 2 the space that \phantom{this is} should have procuded
doesn't appear. Although I am using XeLaTeX the same effect occurs
with LaTeX, and although I am using Memoir, it's the same with e.g.
Article and the minimal document class. NB I am using MiKTeK 2.7

This is one I actually "compiled"

\documentclass{minimal} %
\begin{document}
this is \phantom{a contrived example of how i want my text } to
appear

\phantom{this is} a contrived \phantom{example of how i } want my text
\phantom{to appear}

\phantom{this is a contrived }example \phantom{of} how \phantom{I want
my text to appear}

\phantom{this is a contrived example }of \phantom{how i want my text
to appear}
\end{document}

I'm no expert at this and I'm utterly baffled....
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Enrico Gre » Tue, 01 Dec 2009 23:58:12


As I told you in the other thread, you have to put \leavevmode
in front of \phantom when this is at the beginning of a paragraph.

Ciao
Enrico
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Julian I-D » Wed, 02 Dec 2009 00:01:42


As I was about to acknowledge for the benefit of others, the answer
due to Enrico Gregorio is here
http://www.yqcomputer.com/ #b2a85be9a1f92a7d
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Scott Paki » Wed, 02 Dec 2009 12:05:07


My first thought would be to use a tabbing environment. You can put
it within a minipage if you want to center it:

\documentclass{article}
\begin{document}
\newlength{\contrivedwidth}
\settowidth{\contrivedwidth}{This is a contrived example of how I want my text to appear}
\begin{center}
\begin{minipage}{\contrivedwidth}
\begin{tabbing}
This is \= a contrived \= example \= of \= how I \= want my text \= to appear \kill
This is \> \> \> \> \> \> to appear \\
\> a contrived \> \> \> \> want my text \\
\> \> example \> \> how I \\
\> \> \> of \\
\end{tabbing}
\end{minipage}
\end{center}
\end{document}

-- Scott
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Julian I-D » Wed, 02 Dec 2009 18:44:20


> \documentclass{article}> > \begin{documen>}
> \newlength{\contrivedwi>th}
> \settowidth{\contrivedwidth}{This is a contrived example of how I want my text to a>pear}
> \begin>center}
> \begin{minipage}{\contr>vedwidth}
> \be>in{tabbing}
> This is \= a contrived \= example \= of \= how I \= want my text \= t> appear \kil>
> > gt;\>>a >ontrived \> \> \> >> wa>t >y text \\ >> > \> \> ex>mple>\>>\>>how I \\> > \> \> \> of>\\
> \end{tabb>ng}
> \end{m>nipage}
> \end>ce>ter}
> \end{document}
>
> -- Scott

Thank you Scott - that's an interesting idea that could be useful for
another odd placement task.
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Peter Flyn » Thu, 03 Dec 2009 08:27:31


[snip]

Even better would be to use a tabular environment, and set the portions
to be left unprinted to white or transparent, so that they would still
be picked up by a search...

///Peter
 
 
 

How to: Position text on the line to make multi-line patterns?

Post by Scott Paki » Fri, 04 Dec 2009 08:05:07


If searching is an issue, then the following may be worth considering:

\documentclass{article}

\begin{document}

\begin{center}
This is
\raisebox{-1\baselineskip}{a contrived}
\raisebox{-2\baselineskip}{example}
\raisebox{-3\baselineskip}{of}
\raisebox{-2\baselineskip}{how I}
\raisebox{-1\baselineskip}{want my text}
to appear
\end{center}

\end{document}

I built this with pdflatex, and Acrobat Reader's search function
correctly located the string "a contrived example of", even though it
spans vertical lines.

-- Scott