[texhax] Questions about flowfram

Peter Davis pfd at pfdstudio.com
Tue Nov 1 13:32:56 CET 2011


Well, a big part of my problem was apparently due to using \finishthispage
instead of \clearpage.  Making that change, plus a few other fixes,
resulting in the working document below.

Thanks,

-pd

Working version:

\documentclass[letterpaper,11pt]{article}

\usepackage[draft]{flowfram}

\setlength{\parindent}{0pt}

\setlength{\parskip}{12bp}

\setlength{\unitlength}{1bp}

\pagestyle{empty}

\usepackage[paperwidth=612.000000bp,paperheight=792.000000bp]{geometry}

\setlength{\oddsidemargin}{-1in}

\setlength{\evensidemargin}{-1in}

\setlength{\topmargin}{-1.5in}

\setlength{\textwidth}{612.000000bp}

\setlength{\textheight}{792.000000bp}


\newstaticframe[1]{85bp}{110bp}{36bp}{680bp}[logo]


\newdynamicframe{72bp}{36bp}{288bp}{36bp}


\newflowframe[1]{432.000000bp}{432.00000bp}{90.000000bp}{144.000000bp}[firstpagetext]


\newflowframe[>1]{432.000000bp}{576.00000bp}{90.000000bp}{72.000000bp}[laterpagetext]



\newcount\nextpage


\newcommand{\activateff}[1]{

\nextpage=\thepage

\advance\nextpage by 1

\edef\ffpages{\csname @ff at pages@\romannumeral#1\endcsname}

\setflowframe{#1}{pages={\ffpages,\the\nextpage}}

}


\newcommand{\newletter}{%

\activateff{1}

\clearpage %\finishthispage %

\setflowframe*{laterpagetext}{pages=>\thepage} %

\setstaticframe*{logo}{pages=\thepage} %

}


\setstaticcontents{1}{\begin{center}\LARGE\sffamily\bfseries LOGO
HERE\end{center}}


\setdynamiccontents{1}{\begin{center}\LARGE\thepage\end{center}}


\newcommand{\lorem}{%

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc aliquam dui
ut ipsum posuere pellentesque convallis non tellus. Integer non lorem id
neque aliquet interdum. Suspendisse arcu justo, ultrices sit amet lacinia
ac, sagittis ac libero. Sed condimentum ultrices tellus quis fermentum. Sed
sodales, lectus sed aliquet facilisis, diam mi pharetra libero, sit amet
porttitor justo dolor non diam. Suspendisse lacinia, lorem ac ultricies
congue, ipsum purus eleifend urna, nec imperdiet erat metus rhoncus augue.
Vivamus quis nisi felis, eu gravida mauris. Nunc aliquet nisl vitae augue
dapibus sed auctor ipsum aliquet. Suspendisse potenti. Ut imperdiet
porttitor tellus eleifend vehicula. Aliquam enim ipsum, posuere eu sagittis
eget, consequat sed mi. Phasellus ut lobortis tortor. Mauris nisi lorem,
vulputate ac tempus sed, pharetra non justo.


Curabitur nec nulla ac purus molestie convallis. Maecenas interdum leo
vitae turpis sagittis dictum vehicula nibh faucibus. Suspendisse venenatis
quam id justo iaculis viverra. Donec auctor velit sed lectus bibendum
pretium. Pellentesque adipiscing tempus arcu sed molestie. Curabitur
accumsan mollis ipsum, sit amet condimentum libero convallis quis. Sed
aliquam congue nunc a faucibus. Duis feugiat vestibulum congue.


Donec luctus condimentum nisi ac vehicula. Fusce fringilla, lorem eget
bibendum egestas, nibh est tristique quam, non fringilla ipsum mi in velit.
Maecenas ultrices, tellus eu viverra condimentum, turpis est euismod nisi,
vitae elementum neque sapien et eros. Nam et tortor ut justo fringilla
pulvinar. In hac habitasse platea dictumst. Curabitur ut scelerisque
libero. Aliquam erat volutpat. Curabitur ligula nisi, sagittis vel cursus
mollis, vulputate et odio. Nullam neque diam, tincidunt sed feugiat eget,
sagittis et est. Donec ut orci metus. Morbi sagittis condimentum nulla vel
molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam
vel elit mollis nibh venenatis pellentesque id sit amet nunc. Sed consequat
volutpat mi quis cursus.

}


\begin{document}


%\newletter


Dear Whoosiwhatsis:


\lorem{}


Sincerely,


Whatchamacallit


\newletter


Dear Whoosiwhatsis:


\lorem{}


\lorem{}


Sincerely,


Whatchamacallit


\newletter


Dear Whoosiwhatsis:


\lorem{}


\lorem{}


\lorem{}


\lorem{}


Sincerely,


Whatchamacallit


\end{document}


On Fri, Oct 21, 2011 at 3:06 PM, Peter Davis <pfd at pfdstudio.com> wrote:

> Ok, let me try one more idea here.  What I've been trying to do is
> basically 'activate' various flowframes on various pages by setting the
> page list of to the new page, by something like:
>
>     \setflowframe*{firstpage}{pages=\thepage}
>
> I *think* the problem I'm having is that if I do this before the
> \finishthepage (setting the page list to the following page), it
> effectively deactivates the frame on the current page.  But if I wait until
> after the \finishthepage, the text for the new page has already started
> being composed, so it's too late to assign new frames.
>
> So I think the solution is to modify the 'pages' attribute before
> \finishthepage, but to *add* the next page to the list, instead of
> replacing the list.  In that case, the question becomes: "How can I query
> the 'pages' attribute of a flowframe?""
>
> Anyone? I can just about understand the package code in flowfram.sty to
> gather that it's stored in ff at pages, but I don't know how to access that
> for a specific frame, or how to add a page to that list.
>
> Thanks!
> -pd
>
>
> On Thu, Oct 20, 2011 at 2:48 PM, Peter Davis <pfd at pfdstudio.com> wrote:
>
>> Ok, there are two problems with my example (attached again).  If you
>> comment out the last paragraph or two of the "Lorem ipsum ..." text, the
>> problems are:
>>
>> 1) The first letter has a second (blank) page, even though there's no
>> overflowing text to go on it, and
>> 2) The first page of each letter after the first is blank.
>>
>> I would appreciate any ideas or suggestions on how to overcome these
>> problems.
>>
>> Thank you!
>>
>>  -pd
>>
>>
>> On Thu, Oct 20, 2011 at 12:51 PM, Peter Davis <pfd at pfdstudio.com> wrote:
>>
>>> Mine was a very simplified example, just to illustrate the problem of
>>> reusing page layouts.  In real life, each "letter" would be like an
>>> InDesign document, with multiple frames on a page, with text flowing from
>>> frame to frame on a page, and from page to page.  I'm trying to imitate the
>>> flexibility of InDesign layouts.  I'm pretty sure flowfram is the only
>>> package that provides that flexibility.
>>>
>>> But the problem here is one of turning frames on and off, in effect, so
>>> that the start of each letter has one set of frames, and pages 2-n have a
>>> different set.
>>>
>>> Thanks,
>>> -pd
>>>
>>>
>>> On Thu, Oct 20, 2011 at 12:46 PM, Uwe Ziegenhagen <ziegenhagen at gmail.com
>>> > wrote:
>>>
>>>>
>>>> From the template you gave I cannot see anything which couldn't be done
>>>> with scrlttr2.
>>>>
>>>>
>>>
>>>
>>>> Here a multi-page template, in German:
>>>>
>>>>
>>>> \documentclass[DIN,pagenumber=false,parskip=full,fontsize=12pt,fromalign=center,fromrule=aftername,fromfax=true,fromemail=true,fromphone=true,fromurl=true,numericaldate=true]{scrlttr2}
>>>> %pagenumber=false, bot, botright, botleft
>>>> %parskip=full,
>>>> %fontsize=12pt,10pt
>>>> %fromrule=aftername,afteraddress
>>>> \usepackage[german]{babel}
>>>> \usepackage[]{blindtext}
>>>> \usepackage[latin1]{inputenc}
>>>> \setkomavar{customer}[Kunden-ID]{uz2002-2384757}
>>>> %\setkomavar{date}{04.09.2002}
>>>> \setkomavar{fromurl}{www.mustermann.de}
>>>> \setkomavar{fromemail}{hans at mustermann.de}
>>>> \setkomavar{fromfax}{030-123-4567}
>>>> \setkomavar{fromphone}{030-123-4568}
>>>> \setkomavar{fromname}{Hans Mustermann}
>>>> \setkomavar{fromaddress}{Musterweg 1 12345 Musterstadt}
>>>> \setkomavar{invoice}{HM-2002-123}
>>>> \setkomavar{myref}{HM020902/3}
>>>> \setkomavar{subject}{Rückerstattung Lohnsteuer}
>>>> \setkomavar{title}{Mahnung}
>>>> \setkomavar{yourmail}{02.09.2002}
>>>> \setkomavar{yourref}{müller2002}
>>>> \setkomavar{frombank}{Konto 12\,345\,678\\
>>>> bei der HansWurstBank\\
>>>> BLZ 876\,543\,21}
>>>>
>>>> \firstfoot{%
>>>> \parbox[t]{\textwidth}{\footnotesize
>>>> \begin{tabular}[t]{l@{}}%
>>>> \multicolumn{1}{@{}l@{}}{Gesellschafter:}\\
>>>> Hugo Mayer\\
>>>> Bernd Müller
>>>> \end{tabular}%
>>>> \hfill
>>>> \begin{tabular}[t]{l@{}}%
>>>> \multicolumn{1}{@{}l@{}}{Geschäftsführerin:}\\
>>>> Liselotte Mayer\\[1ex]
>>>> \multicolumn{1}{@{}l@{}}{Gerichtsstand:}\\
>>>> Hinterdupfeldingen
>>>> \end{tabular}%
>>>> \ifkomavarempty{frombank}{}{%
>>>> \hfill
>>>> \begin{tabular}[t]{l@{}}%
>>>> \multicolumn{1}{@{}l@{}}{\usekomavar*{frombank}:}\\
>>>> \usekomavar{frombank}
>>>> \end{tabular}%
>>>> }%
>>>> }%
>>>> }
>>>>
>>>> \begin{document}
>>>> \begin{letter}{Finanzamt Musterstadt \\ Musterweg 2\\12345 Musterstadt}
>>>> \opening{Sehr geehrte Damen und Herren,}
>>>>
>>>> hiermit bitte ich Sie letztmalig um Rückerstattung meiner gezahlten
>>>> Lohnsteuer für die Jahre 1995-2001.
>>>> \blindtext[10]
>>>>
>>>>
>>>> \vspace{1cm}
>>>> \encl{Anlage 1 \\ Anlage 2}
>>>> \closing{Mit freundlichen Grüßen}
>>>> \end{letter}
>>>> \end{document}
>>>>
>>>> 2011/10/20 Peter Davis <pfd at pfdstudio.com>
>>>>
>>>>>  I have an *almost* working version of this.  I'm attaching a short
>>>>> (though not minimal) example that outputs three letters of different
>>>>> lengths.  Each has a first page style which includes a logo in the upper
>>>>> left, and a later page style which has no logo and a larger text flowframe.
>>>>>
>>>>> The problem is that after the first letter, the other letters get a
>>>>> first page with a logo, but no text.  Then subsequent pages of the 2nd and
>>>>> 3rd letters look ok.  Any clues about how to fix this would be much
>>>>> appreciated.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> -pd
>>>>>
>>>>>
>>>>> On Thu, Oct 20, 2011 at 10:04 AM, Peter Davis <pfd at pfdstudio.com>wrote:
>>>>>
>>>>>> Ok, I think I'm close to solving this problem.  I think the approach
>>>>>> is to define a macro like:
>>>>>>
>>>>>> \newcommand{\newletter}{%
>>>>>> \finishthispage%
>>>>>> \setallflowframes{pages=none}%
>>>>>> \setflowframes*{logo,address,firpagetext}{pages=\thepage}%
>>>>>> \setflowframes*{laterpagetext}{pages={>\thepage}}}
>>>>>>
>>>>>> Then I just output that at the start of each letter.  I haven't
>>>>>> tested this yet, but it seems about right based on my other experiments.
>>>>>>  NOTE: I changed the staticframes for logo and address to flowframes here
>>>>>> for simplicity.
>>>>>>
>>>>>> Thanks,
>>>>>> -pd
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 20, 2011 at 6:35 AM, Peter Davis <pfd at pfdstudio.com>wrote:
>>>>>>
>>>>>>> Thanks, Uwe.  No, the pages will all print on the same paper.  Only
>>>>>>> the layout will vary between the first page and subsequent pages.  But
>>>>>>> 1) I need the flexibility of flowfram, and
>>>>>>> 2) all the letters will be in one document, so it may go something
>>>>>>> like:
>>>>>>>
>>>>>>> page 1: letter 1, first page
>>>>>>> page 2: letter 1, second page
>>>>>>> page 3: letter 2, first page
>>>>>>> page 4: letter 3, first page
>>>>>>> page 5: letter 3, second page
>>>>>>> page 6: letter 3, third page
>>>>>>> page 7: letter 4, first page
>>>>>>> etc.
>>>>>>>
>>>>>>> So pages 1, 3, 4 and 7 will use one layout, and the remaining pages
>>>>>>> will use another.  The difficulty with using flowfram with this is that I
>>>>>>> don't know in advance how many pages each letter will require.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> -pd
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 20, 2011 at 2:57 AM, Uwe Ziegenhagen <
>>>>>>> ziegenhagen at gmail.com> wrote:
>>>>>>>
>>>>>>>> So the paper itself is different for the different pages? If not
>>>>>>>> the scrlttr2 class from the KOMA bundle has settings which differentiate
>>>>>>>> between different page layout for the first and subsequent pages.
>>>>>>>>
>>>>>>>> Uwe
>>>>>>>>
>>>>>>>> Von meinem iPad gesendet
>>>>>>>>
>>>>>>>> Am 20.10.2011 um 01:14 schrieb Peter Davis <pfd at pfdstudio.com>:
>>>>>>>>
>>>>>>>>
>>>>>>>> Ok, let me try this another way.  Suppose I'm creating a document
>>>>>>>> which is really a bunch of letters that will get mailed out.  The first
>>>>>>>> page of each letter should appear to be on letterhead stationery ... with
>>>>>>>> logos, return address, etc.  The second an subsequent pages will be just
>>>>>>>> plain.
>>>>>>>>
>>>>>>>> So when I define frames, I might do something like:
>>>>>>>>
>>>>>>>> \newstaticframe[1]{width}{height}{x}{y}{logo}
>>>>>>>> \newstaticframe[1]{width}{height}{x}{y}{address}
>>>>>>>> \newflowframe[1]{width}{height}{x}{y}{firstpagetext}
>>>>>>>> \newflowframe[>1]{width}{height}{x}{y}{laterpagetext}
>>>>>>>>
>>>>>>>> Ok, that's all well and good for one single letter.  But what if I
>>>>>>>> want to do multiple letters of different lengths, one after another in one
>>>>>>>> document?  Some are 1 page, some 2 and some 3.
>>>>>>>>
>>>>>>>> Is there any way to set the pages keyword for these frames to get
>>>>>>>> them in the rightplaces?
>>>>>>>>
>>>>>>>> Thanks for any suggestions, pointers, etc.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> -pd
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> ----
>>>>>>> The Tech Curmudgeon
>>>>>>> http://www.techcurmudgeon.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ----
>>>>>> The Tech Curmudgeon
>>>>>> http://www.techcurmudgeon.com
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ----
>>>>> The Tech Curmudgeon
>>>>> http://www.techcurmudgeon.com
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> TeX FAQ: http://www.tex.ac.uk/faq
>>>>> Mailing list archives: http://tug.org/pipermail/texhax/
>>>>> More links: http://tug.org/begin.html
>>>>>
>>>>> Automated subscription management:
>>>>> http://tug.org/mailman/listinfo/texhax
>>>>> Human mailing list managers: postmaster at tug.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Uwe Ziegenhagen
>>>> <http://www.uweziegenhagen.de>
>>>>
>>>
>>>
>>>
>>> --
>>> ----
>>> The Tech Curmudgeon
>>> http://www.techcurmudgeon.com
>>>
>>>
>>>
>>
>>
>> --
>> ----
>> The Tech Curmudgeon
>> http://www.techcurmudgeon.com
>>
>>
>>
>
>
> --
> ----
> The Tech Curmudgeon
> http://www.techcurmudgeon.com
>
>
>


-- 
----
The Tech Curmudgeon
http://www.techcurmudgeon.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20111101/260a8771/attachment-0001.html>


More information about the texhax mailing list