Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-23 Thread Herbert Voss

Helge Hafting wrote:

Herbert Voss wrote:


Helge Hafting wrote:


Latex does not seem to offer a proper way of aligning boxes by the
box top, but there is a simple workaround.




TeX offers everything ...
A minipage is nothing else than a box and it is aligned in
the same way as two characters are aligned.



That offer isn't enough. Lining boxes up by baselines is ok when they 
actually

contain text - but there is also the need for lining up illustrations.
Lining boxes up by the box top is then useful, but latex then need a
workaround in the form of providing a zero-height line so there
is a "baseline" at the top of the box.


sure, as I said, a box is a box. It doesn't matter what's inside
the box!


(La)TeX is nice.  But neither perfect nor complete.


who is it? :-)

Hebrert



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-23 Thread Helge Hafting

Herbert Voss wrote:


Helge Hafting wrote:


Latex does not seem to offer a proper way of aligning boxes by the
box top, but there is a simple workaround.



TeX offers everything ...
A minipage is nothing else than a box and it is aligned in
the same way as two characters are aligned.


That offer isn't enough. Lining boxes up by baselines is ok when they 
actually

contain text - but there is also the need for lining up illustrations.
Lining boxes up by the box top is then useful, but latex then need a
workaround in the form of providing a zero-height line so there
is a "baseline" at the top of the box.

(La)TeX is nice.  But neither perfect nor complete.

Helge Hafting


Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-21 Thread Andre Poenitz
On Fri, Jan 20, 2006 at 03:49:44PM +0100, Herbert Voss wrote:
> Helge Hafting wrote:
> 
> >Latex does not seem to offer a proper way of aligning boxes by the
> >box top, but there is a simple workaround.
> 
> TeX offers everything ...

Except undoing paragraph breaks.

SCNR.

Andre'


Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-20 Thread Herbert Voss

Kevin Pfeiffer wrote:

Herbert Voss writes:


Helge Hafting wrote:


Latex does not seem to offer a proper way of aligning boxes by the
box top, but there is a simple workaround.


TeX offers everything ...



Look-ahead beyond the paragraph?

Okay one can explicitly add an additional latex run to determine where a 
page will break and then change the page layout for the following page 
and go back and run it again, but it didn't seem too easy to implement. 
Of course, that could also be due to the implementer (speaking only if 
myself here). :-\


See prev. discussion  -- no, wait, _this_ discussion (before it was 
hijacked for a new thread) -- about automatically changing page layout 
for all pages > 1 in a business letter.


with the afterpage package something may be possible, otherwise
--> conTeXt

Herbert



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-20 Thread Kevin Pfeiffer
Herbert Voss writes:
> Helge Hafting wrote:
> > Latex does not seem to offer a proper way of aligning boxes by the
> > box top, but there is a simple workaround.
>
> TeX offers everything ...

Look-ahead beyond the paragraph?

Okay one can explicitly add an additional latex run to determine where a 
page will break and then change the page layout for the following page 
and go back and run it again, but it didn't seem too easy to implement. 
Of course, that could also be due to the implementer (speaking only if 
myself here). :-\

See prev. discussion  -- no, wait, _this_ discussion (before it was 
hijacked for a new thread) -- about automatically changing page layout 
for all pages > 1 in a business letter.

-Kevin


-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-20 Thread Herbert Voss

Helge Hafting wrote:


Latex does not seem to offer a proper way of aligning boxes by the
box top, but there is a simple workaround.


TeX offers everything ...
A minipage is nothing else than a box and it is aligned in
the same way as two characters are aligned.

Herbert



Minipage idea for Lyx 1.5 Was Re: Business letter (on letterhead) template for LyX

2006-01-20 Thread Helge Hafting

john wrote:


Another suggestion from Ross Moore works brilliantly.

Instead of a protected blank in the 1st line of each minipage, instead
put a TeX \null.

\null is a macro for \hbox{} which creates an empty box of zero
dimensions. This effectively forces the minipages to top align with the
very top of the minipage (rather than the baseline of a space with a
physical size.

I had never heard of this, but found it in Knuth's TeXbook (Appendix A,
12.6).
 


Testing \null


I tried this.  A \null followed by a forced line break doesn't
work, because TeX says "no line here to end".

A \null followed by a paragraph break works though.
But there is no difference from the protected space case.
It seems that a protected space have zero height, so the
effect is the same as \null, with the advantage that the space
is supported by LyX where \null need a bulky ERT box.

Technically, there is the difference that a protected space
has _length_, but in this case (and in most cases, I expect)
the minipage was wider than the width of a single spave anyway.

Try different characters instead of the protected space, and you'll
see that tex uses the height of the character itself for computing the
minipage height.  An "f" is taller than an "a" which is taller than a "."
which is taller than the zero-height protected space.


Idea for LyX 1.5
==
Ability to line minipages up by the real top of the minipage
(rather than the topmost baseline) is very useful.  So how
about adding support for it?

The current "Top" remains, maybe it should be renamed to
"Top baseline" for clarity.  Or maybe not, for user compatibility.

Then a new "Top of box" alignment is added.  When this is used,
LyX produce a latex minipage with the usual top alignment,
and puts "\null\par{}" as the first thing inside the minipage
environment.  This goes before any user specified contents
The sequence should work for all cases.  No matter what comes
next (picture, text, ...) the minipage/box will line up by the very top.

I don't know if a similiar trick is needed for aligning by
the bottom of the box.  Bottom alignment seems to align by the
real bottom - using letters like "j" that extends beyond the
baseline still aligns the boxes by the bottom (and the texts
are _not_ aligned)

I believe this is something I could implement myself, once 1.5
starts up.

Helge Hafting



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-19 Thread john
Another suggestion from Ross Moore works brilliantly.

Instead of a protected blank in the 1st line of each minipage, instead
put a TeX \null.

\null is a macro for \hbox{} which creates an empty box of zero
dimensions. This effectively forces the minipages to top align with the
very top of the minipage (rather than the baseline of a space with a
physical size.

I had never heard of this, but found it in Knuth's TeXbook (Appendix A,
12.6).

regards
John O'Gorman



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-18 Thread Ross Moore

Hi John,

On 19/01/2006, at 5:14 PM, john wrote:


Aha!

I've got it working - Helge minipages + Ross Moore \html stuff:

Here's the solution:
1. Put \htmlonly latex tabular statement before the 1st minipage
2. replace the LyX hfill with a conditional \latexhtml{\hfill}{&}
3. Follow the 2nd minipage with an \htmlonly \end{tabular}

Of course you have to put a protected space in the top line of each  
minipage.


Cannot you just put LaTeX's  \null  in there ?
That's worked for me to get top-alignment in .dvi , .ps , and .pdf .


(LyX: ctrl-space ctrl-enter ) to get visual top-alignment.


Or is this needed for the LyX viewer, with it being ignored by
usual TeX engines ?




The LyX sequence:
0. In the preamble:
   \usepackage{html}
1. ERT:
\begin{htmlonly}\begin{tabular}{tt}\end{htmlonly}

  2. \null

2a. LyX Insert->Minipage:
3. \latexhtml{\hfill}{&}

  4. \null

4a. LyX Insert->Minipage
5. ERT:
\begin{htmlonly}\end{tabular}\end{htmlonly}


Hope this helps,

Ross


Effectively this builds a latex file with the minipages in a latex
tabular when you ask latex2html to process it. When latex or pdflatex
process the file the html bits are ignored (so there is no tabular
statement).

regards
John O'Gorman



Ross Moore [EMAIL PROTECTED]
Mathematics Department office: E7A-419
Macquarie University   tel: +61 +2 9850 8955
Sydney, Australia  2109fax: +61 +2 9850 8114





Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-18 Thread john
Aha! 

I've got it working - Helge minipages + Ross Moore \html stuff:

Here's the solution:
1. Put \htmlonly latex tabular statement before the 1st minipage
2. replace the LyX hfill with a conditional \latexhtml{\hfill}{&}
3. Follow the 2nd minipage with an \htmlonly \end{tabular}

Of course you have to put a protected space in the top line of each minipage.
(LyX: ctrl-space ctrl-enter ) to get visual top-alignment.

The LyX sequence:
0. In the preamble:
   \usepackage{html}
1. ERT:
\begin{htmlonly}\begin{tabular}{tt}\end{htmlonly}
2. LyX Insert->Minipage:
3. \latexhtml{\hfill}{&}
4. LyX Insert->Minipage
5. ERT:
\begin{htmlonly}\end{tabular}\end{htmlonly}

The LaTeX html package defines (among other things) environments:
htmlonly{ ... } % for latex commands which will be ignored by latex or
pdflatex but honoured by latex2html
latexhtml{latex code}{html code}
the first argument will be processed by latex only
the second argument will be processed by latex2html only.

Effectively this builds a latex file with the minipages in a latex
tabular when you ask latex2html to process it. When latex or pdflatex
process the file the html bits are ignored (so there is no tabular
statement).

regards
John O'Gorman





miniog2.lyx
Description: application/lyx


Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-18 Thread john
Latex2html will not place 2 minipages side-by-side.

I got the official response from Ross Moore on the latex2html list.
He said that he did not bother to program a lookahead to see how to
stack minipages. In effect you have to write htmlonly code to force a
tabular environment around the minipages when using latex2html.

He kindly supplied sample LaTeX code for me to try. I will see if I can
plug this into my LyX doc as ERT.

I'll keep you posted

regards
John O'Gorman



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-18 Thread john
On Wed, 2006-01-18 at 10:50 +0100, Helge Hafting wrote:
> john wrote:
> 
> >On Tue, 2006-01-17 at 12:18 -0800, Rich Shepard wrote:
> >  
> >
> >>On Wed, 18 Jan 2006, John O'Gorman wrote:
> >>
> >>
> >>
> >>>I have 6 books on Tex/LaTeX but not that one! Can you give us a brief
> >>>pointer to how to fix it (or is it not fixable)?
> >>>  
> >>>

> >Just a comment though. 
> >Helge was talking about using 2 minipages side-by-side (Which Kevin and
> >I have found to not top-align properly).Your excerpt features 2 parbox
> >structures side-by-side. Is the principle the same?
> >  
> >
> Sorry about my faulty example.  I tried with text in the minipages,
> now I have a solution that also works with graphichs (and still no
> latex code.)  I used lyx-1.4, but I only used minipages so it should
> work with lyx 1.3 as well.
> 

Yes Helge. Exactly so.
I have tried putting the protected blank in the 1st line of each
minipage - and it works perfectly for DVI and PDF. Thank you!

Alas. I still cannot persuade latex2html to place the minipages
alongside each other. I expect that this is a quirk of latex2html.
I will place a query on their list.

I prefer the minipage solution, and will persist until it works or I am
persuaded that it does not.

Many thanks for your effort
John O'Gorman



Re: Business letter (on letterhead) template for LyX - simple _working_ minipage solution

2006-01-18 Thread Helge Hafting

john wrote:


On Tue, 2006-01-17 at 12:18 -0800, Rich Shepard wrote:
 


On Wed, 18 Jan 2006, John O'Gorman wrote:

   


I have 6 books on Tex/LaTeX but not that one! Can you give us a brief
pointer to how to fix it (or is it not fixable)?
 


John,

  Yes, it's fixable. Let me paraphrase from the book.
   


Thanks Rich. You have gone well beyond the call of duty!

I will study this and see where we get.

Just a comment though. 
Helge was talking about using 2 minipages side-by-side (Which Kevin and

I have found to not top-align properly).Your excerpt features 2 parbox
structures side-by-side. Is the principle the same?
 


Sorry about my faulty example.  I tried with text in the minipages,
now I have a solution that also works with graphichs (and still no
latex code.)  I used lyx-1.4, but I only used minipages so it should
work with lyx 1.3 as well.

The problem is that latex seems to offer alignment of boxes
byt top/bottom/middle, but only the middle is true.  Top and
bottom alignment does not refer to top and bottom of the
minipage/parbox, but the topmost and lowermost line contained within!

If there is only one line within, that line is both top and bottom.
This is the case when the minipage contains a logo only, the picture
is effectively "one big letter" with the baseline underneath it.
So "top" alignment effectively becomes bottom alignment in this case.

Latex does not seem to offer a proper way of aligning boxes by the
box top, but there is a simple workaround.

In the first minipage, the one with the logo, add a blank line first.
I.e. place cursor before your graphic, press ctrl space to add a
protected space, then ctrl+enter to force a line break. The
protected space is there so latex won't discard the "empty" line.

In the second box, the one with your name, do the same thing.
But take care. The font height for the two blank lines (i.e. the
protected space and the linebreak itself) must be the same
for the two minipages or they won't line up.  Incidentally,
you can use this font height as a simple way to fine-tune the
alignment if necessary.  (Could be useful as text does not have
a well defined "top" to line up by, text only have a baseline.
Individual letters have varying height, so good-looking alignment
depends on the spelling of your name.)

The blank line will of course push your logo and your name
a little down.  If this is a problem, but the two
minipages one line further up.  Or use the smallest font
possible for the blank line.

I tried this with a real picture this time, and also a large font
for the name.  It works well, two minipages, two blank lines
with only a protected space, and the contents.
No latex code, no outer boxes or anything else needed. :-)

If the "blank line" solution isn't satisfactory, consider using
latex commands to force the minipages to line up. You can
probably do it by tweaking the \raisebox command. My
simple way is nice in that one minipage does not need to
know the height of the other, so there is no need for
measurements.  Therefore, future changes in font height
or logo size won't be a problem.

Helge Hafting



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Rich Shepard

On Wed, 18 Jan 2006, john wrote:


Just a comment though. Helge was talking about using 2 minipages
side-by-side (Which Kevin and I have found to not top-align properly).Your
excerpt features 2 parbox structures side-by-side. Is the principle the
same?


  If I read the book correctly, yes.

  I've not had to deal with this so I've no personal experience to offer.

Hope it works as you want, John,

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread john
On Tue, 2006-01-17 at 12:18 -0800, Rich Shepard wrote:
> On Wed, 18 Jan 2006, John O'Gorman wrote:
> 
> > I have 6 books on Tex/LaTeX but not that one! Can you give us a brief
> > pointer to how to fix it (or is it not fixable)?
> 
> John,
> 
>Yes, it's fixable. Let me paraphrase from the book.
Thanks Rich. You have gone well beyond the call of duty!

I will study this and see where we get.

Just a comment though. 
Helge was talking about using 2 minipages side-by-side (Which Kevin and
I have found to not top-align properly).Your excerpt features 2 parbox
structures side-by-side. Is the principle the same?

regards
John O'Gorman
> 
>You want to place two parboxes of different heights side by side. Their
> first lines are to be aligned. Both (collectively) have their bottoms on the
> current line. What most of us do "intuitively" is,
> 
>\begin{minipage}[b]{..}
>  \parbox[t]{..}{..} \hfill \parbox[t]{..}{..}
>\end{minipage}
> 
>This puts the boxes below the current line of text. "The reason for this is
> that each parbox or minipage is treated externally as a single character with
> its own height and depth above and below the baseline. As far as the outer
> minipage is concerned, it contains only two 'characters' on the same line,
> and that line is both the top and bottom one."
> 
>The solution is to add a dummy second line to the outer box; to wit:
> 
>\begin{minipage}[b]{..}
>  \parbox[t]{..}{..} \hfill \parbox[t]{..}{..} \\ \mbox{}
>\end{minipage}
> 
>Now, if you want to align two boxes on their bottom lines with the pair
> aligned at the top of the current text line, add the dummy box as the first
> line:
> 
>\begin{minipage}[b]{..}
>  \mbox{} \\ \parbox[t]{..}{..} \hfill \parbox[t]{..}{..}
>\end{minipage}
> 
>This can be tweaked to align the boxes by their center, too.
> 
>For the longest time I got by with Beatrix Sachs Lipkin's "LaTeX for
> Linux." Now I no longer use that, but I do use Guide to LaTeX, 4th edition,
> The LaTeX Companion, 2nd edition, and The LaTeX Graphics Companion, 1st
> edition (eagerly awaiting the 2nd edition). If it ain't in those (or I cannot
> find it there), I ask on the list.
Yes I have both of those along with Lamport's LaTeX book and Knuth's
TeXbook plus a couple of O'Reilly books.
> 
> HTH,
> 
> Rich
> 



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Rich Shepard

On Wed, 18 Jan 2006, John O'Gorman wrote:


I have 6 books on Tex/LaTeX but not that one! Can you give us a brief
pointer to how to fix it (or is it not fixable)?


John,

  Yes, it's fixable. Let me paraphrase from the book.

  You want to place two parboxes of different heights side by side. Their
first lines are to be aligned. Both (collectively) have their bottoms on the
current line. What most of us do "intuitively" is,

  \begin{minipage}[b]{..}
\parbox[t]{..}{..} \hfill \parbox[t]{..}{..}
  \end{minipage}

  This puts the boxes below the current line of text. "The reason for this is
that each parbox or minipage is treated externally as a single character with
its own height and depth above and below the baseline. As far as the outer
minipage is concerned, it contains only two 'characters' on the same line,
and that line is both the top and bottom one."

  The solution is to add a dummy second line to the outer box; to wit:

  \begin{minipage}[b]{..}
\parbox[t]{..}{..} \hfill \parbox[t]{..}{..} \\ \mbox{}
  \end{minipage}

  Now, if you want to align two boxes on their bottom lines with the pair
aligned at the top of the current text line, add the dummy box as the first
line:

  \begin{minipage}[b]{..}
\mbox{} \\ \parbox[t]{..}{..} \hfill \parbox[t]{..}{..}
  \end{minipage}

  This can be tweaked to align the boxes by their center, too.

  For the longest time I got by with Beatrix Sachs Lipkin's "LaTeX for
Linux." Now I no longer use that, but I do use Guide to LaTeX, 4th edition,
The LaTeX Companion, 2nd edition, and The LaTeX Graphics Companion, 1st
edition (eagerly awaiting the 2nd edition). If it ain't in those (or I cannot
find it there), I ask on the list.

HTH,

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Enrico Forestieri
Enrico Forestieri <[EMAIL PROTECTED]> writes:

> Put these lines in the preamble:
> 
> \leftskip=1in
> \newcommand{\newmargin}[1]{\hangindent=1in\hangafter=-#1\break\leftskip=0in}
> 
> and run latex a first time. Take note of where the pagebreak occurs.
> Then insert there (in ERT) the command \newmargin{N} where N is equal
> to the number of lines in the paragraph so far.
> Example pasted at the bottom.

Actually, the \break can be omitted. My new recipe is:

Put these lines in the preamble:

\leftskip=1in
\newcommand{\newmarginafter}[1]{\hangindent=1in\hangafter=-#1\leftskip=0in}

run latex a first time and take note of the paragraph that will be broken
between pages. Then insert at its start the command \newmarginafter{N}
where N is equal to the number of lines before the page break.
New example at the bottom.

--
Enrico


#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass scrlttr2
\begin_preamble
%
%% Here you can modify the layout of your letter
%% Have a look at the KOMA script documentation
%% for details. Most commands are commented out
%% here (i.e. we use default settings)
%

%% Load an *.lco style file (see KOMA documentation)
\LoadLetterOption{DIN}%  

%% THE CLASS OPTIONS
%% Remove preceeding '%' to uncomment an item
\KOMAoptions{%
%,headsepline=true%separate the header with a line on page >1
%,footsepline=true% separate the footer with a line on page >1
%pagenumber=botcenter%   position of the page number (see docu)
%,parskip=false%  Use indent instead of skip (more options cf. docu)
,fromalign=center%alignment of the address
,fromrule=aftername%separate the address with a line?
,fromphone=true% print sender phone number
%,fromfax=true%  print sender fax number
,fromemail=true%   print sender e-mail address
,fromurl=true%   print sender URL
%,fromlogo=true% print a logo (position depends on fromalign)
%,addrfield=false%print an address field?
%,backaddress=false%  print the back address?
%,subject=afteropening,titled% alternative subject layout and position
%,locfield=narrow%  width of the (extra) location field
%,foldmarks=false%  print foldmarks?
%,numericaldate=true%  date layout
%,refline=wide% layout of the refline
}

%% Customize Separators
%\setkomavar{placeseparator}{ -- }
\setkomavar{backaddressseparator}{ $\cdot$ }
%\setkomavar{emailseparator}{ --> }
%\setkomavar{enclseparator}{ > }
%\setkomavar{faxseparator}{ --> }
%\setkomavar{phoneseparator}{ --> }
%\setkomavar{subjectseparator}{ >>> }

%% Customize fonts
%% Use LaTeX's standard font commands
%% Modify with \setkomafont or \addtokomafont
%% (see KOMA documentation)
\setkomafont{backaddress}{\rmfamily}
%\setkomafont{descriptionlabel}{}
\setkomafont{fromaddress}{\small}
\setkomafont{fromname}{\scshape}
%\setkomafont{pagefoot}{}
%\setkomafont{pagehead}{}
%\setkomafont{pagenumber}{}
%\setkomafont{subject}{}
%\setkomafont{title}{}


% Advance the left margin by 1in

\leftskip=1in
%%
% Run latex a first time and take note of where the pagebreak occurs.
% Then insert at the start of the paragraph that will be broken between
% pages the command \newmarginafter{N} where N is equal
% to the number of lines in the paragraph before the page break.
%%
\newcommand{\newmarginafter}[1]{\hangindent=1in\hangafter=-#1\leftskip=0in}
\end_preamble
\language english
\inputencoding auto
\fontscheme palatino
\graphics default
\paperfontsize 11
\spacing other 1.15 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language danish
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Name

The LyX Developers Team
\layout SenderAddress

140 Map Road
\newline 
CVS City
\layout Telephone

0011/222
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
,
\end_inset 

333
\layout E-Mail

lyx-users@lists.lyx.org
\layout URL

www.lyx.org
\layout Backaddress

The LyX Developers Team
\newline 
140 Map Road
\newline 
CVS City
\layout Signature

The LyX Team
\layout Subject

New KOMA letter layout 
\layout Place

The Internet
\layout Date


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
today
\end_inset 


\layout Address

Mr X.
 Ample
\newline 
666 Sesame Street
\newline 
12345 Nowhere
\layout Opening

Dear Mr.
 Ample,
\layout Standard

This template illustrates the use of the new scrlttr2 class (introduced
 with KOMA-script v.
 2.9).
 This letter class is very flexible.
 Have a look at 
\family sans 
Layout\SpecialChar \menuseparator
Document\SpecialChar \menuseparator
Preamble
\family default 
 for

Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread John O'Gorman
On Wed, 2006-01-18 at 03:12, Rich Shepard wrote:
> On Tue, 17 Jan 2006, Kevin Pfeiffer wrote:
> 
> > This sounds good, but when I try it I get:
> >
> > XX
> > XX
> > XX
> > XX
> > John Hancock
> > 1234 Broadway Blvd.
> >
> > Both are set to TOP alignment; they are side-by-side, with suitable width
> > (100pt and 25%colwidth).
> 
> Kevin,
> 
>This is explained in Section 5.1.4, Problems With Vertical Placement (pp.
> 89-90) in Kopka and Daly, Guide to LaTeX, 4th Ed.
Rich
I have 6 books on Tex/LaTeX but not that one!
Can you give us a brief pointer to how to fix it (or is it not fixable)?

regards
John O'Gorman
> 
> Rich



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Enrico Forestieri
Paul A. Rubin <[EMAIL PROTECTED]> writes:

> 
> Hi all,
> 
> I'm trying to concoct a LyX template to let me write letters on school 
> letterhead, the last task for which I still rely on WordPerfect.  Having 
> looked at akletter, newlfm and komascript, I think komascript gives me 
> my best shot, and I have a template that just falls short of what I 
> need, in three ways.  I'm hoping for suggestions (including pointers to 
> other classes, if komascript is not the best choice).
> 
> 1. (This is the only major issue.)  Our letterhead includes logos on 
> both the left side of the paper and along the top.  Dealing with the top 
> is not a problem, but for the life of me I cannot find a way in 
> komascript to make the left margin two inches on the first page (which 
> will be letterhead) and one inch on every other page (plain bond).

Hi Paul.

This can be done in latex, even if in a non automatic way.
Put these lines in the preamble:

\leftskip=1in
\newcommand{\newmargin}[1]{\hangindent=1in\hangafter=-#1\break\leftskip=0in}

and run latex a first time. Take note of where the pagebreak occurs.
Then insert there (in ERT) the command \newmargin{N} where N is equal
to the number of lines in the paragraph so far.
Example pasted at the bottom.

> 2. (Minor annoyance.) Komascript right justifies the date; I would like 
> to left justify it.  (I leave the other elements of that line, such as 
> location, blank.)
> 
> 3. (Minor annoyance.) I would like to shrink the vertical distance 
> between the end of the recipient's address and the date line.

These are harder (for me). I didn't study the scrlttr2.cls but at a first
look it does strange things. Even with a \stretch{3} I was not able to left
justify the date.

--
Enrico


#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass scrlttr2
\begin_preamble
%
%% Here you can modify the layout of your letter
%% Have a look at the KOMA script documentation
%% for details. Most commands are commented out
%% here (i.e. we use default settings)
%

%% Load an *.lco style file (see KOMA documentation)
\LoadLetterOption{DIN}%  

%% THE CLASS OPTIONS
%% Remove preceeding '%' to uncomment an item
\KOMAoptions{%
%,headsepline=true%separate the header with a line on page >1
%,footsepline=true% separate the footer with a line on page >1
%pagenumber=botcenter%   position of the page number (see docu)
%,parskip=false%  Use indent instead of skip (more options cf. docu)
,fromalign=center%alignment of the address
,fromrule=aftername%separate the address with a line?
,fromphone=true% print sender phone number
%,fromfax=true%  print sender fax number
,fromemail=true%   print sender e-mail address
,fromurl=true%   print sender URL
%,fromlogo=true% print a logo (position depends on fromalign)
%,addrfield=false%print an address field?
%,backaddress=false%  print the back address?
%,subject=afteropening,titled% alternative subject layout and position
%,locfield=narrow%  width of the (extra) location field
%,foldmarks=false%  print foldmarks?
%,numericaldate=true%  date layout
%,refline=wide% layout of the refline
}

%% Customize Separators
%\setkomavar{placeseparator}{ -- }
\setkomavar{backaddressseparator}{ $\cdot$ }
%\setkomavar{emailseparator}{ --> }
%\setkomavar{enclseparator}{ > }
%\setkomavar{faxseparator}{ --> }
%\setkomavar{phoneseparator}{ --> }
%\setkomavar{subjectseparator}{ >>> }

%% Customize fonts
%% Use LaTeX's standard font commands
%% Modify with \setkomafont or \addtokomafont
%% (see KOMA documentation)
\setkomafont{backaddress}{\rmfamily}
%\setkomafont{descriptionlabel}{}
\setkomafont{fromaddress}{\small}
\setkomafont{fromname}{\scshape}
%\setkomafont{pagefoot}{}
%\setkomafont{pagehead}{}
%\setkomafont{pagenumber}{}
%\setkomafont{subject}{}
%\setkomafont{title}{}


% Advance the left margin by 1in

\leftskip=1in
%%
% Run latex a first time and take note of where the pagebreak occurs.
% Then insert there the command \newmargin{N} where N is equal
% to the number of lines in the paragraph so far.
%%
\newcommand{\newmargin}[1]{\hangindent=1in\hangafter=-#1\break\leftskip=0in}
\end_preamble
\language english
\inputencoding auto
\fontscheme palatino
\graphics default
\paperfontsize 11
\spacing other 1.15 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language danish
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Name

The LyX Developers Team
\layout SenderAddress

140 Map Road
\newline 
CVS City
\layout Telephone

0011/222
\begin_i

Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Stephen Harris


- Original Message - 
From: "Herbert Voss" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, January 17, 2006 8:47 AM
Subject: Re: Business letter (on letterhead) template for LyX



Stephen Harris wrote:


I've read about widows and orphans:


http://tug.org/TeXnik/mainFAQ.cgi?file=layouts/widows

Herbert



Hmmm, that contained additional information. I kept looking
and found a long, pretty clear explanation.
http://www.economics.utoronto.ca/osborne/latex/PMAKEUP.HTM

Thanks for the reference,
Stephen 



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Herbert Voss

Stephen Harris wrote:


I've read about widows and orphans:


http://tug.org/TeXnik/mainFAQ.cgi?file=layouts/widows

Herbert



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Stephen Harris


- Original Message - 
From: "Paul A. Rubin" <[EMAIL PROTECTED]>

To: 
Sent: Monday, January 16, 2006 8:56 AM
Subject: Re: Business letter (on letterhead) template for LyX



Kevin Pfeiffer wrote:

Paul A. Rubin writes:



1. (This is the only major issue.)  Our letterhead includes logos on
both the left side of the paper and along the top.  Dealing with the
top is not a problem, but for the life of me I cannot find a way in
komascript to make the left margin two inches on the first page
(which will be letterhead) and one inch on every other page (plain
bond).



The answer that I got is that this is not easily possible, "because the 
size of the print area can only be changed between pages, i.e. when a 
\newpage command can be used. That is because there is no possibility to 
recalculate an already split paragraph, and exactly that would be 
necessary when the print area on the next page is supposed to change." If 
I understand that correctly, TeX splits a paragraph into lines before it 
begins to print it. On the next page, these lines may then be too short 
or too long. (Or so I interpreted this -- corrections welcome.)


Why not use the same wide margin on all pages (no one was ever punished 
for using too much white space -- well, unless maybe it was for a 
dissertation)?  Or do as my wife does at her Uni -- she uses letterhead 
that has only the logo pre-printed and prints the "right margin 
letterhead stuff" herself (its all in her template).


Sorry I couldn't help more. (The other two items I think you can find in 
the manual.)


-Kevin





Kevin,

Thanks for all the research on this!  I'll see if I can adapt your 
\ifthenelse hack to the komascript letter class.  At least its comforting 
to know this is not trivial (and I'm not missing something obvious).


/Paul



I've read about widows and orphans:
http://xpt.sourceforge.net/techdocs/Latex/OrphanSpaceControl/Latex11.001.html

"An orphan is the first line of a paragraph on the last line of a page.
The last line of the paragraph on a new page is a widow.

To get rid of an orphan, precede the paragraph with \clearpage.

To get rid of a widow is harder. If the paragraph is long, try following
the last word with \looseness=-1. If not, run the page a little shorter
with \enlargethispage{-\baselineskip}. In fact you can run the page longer
too, and make a two-line widow which some publishers will accept.

To do it automatically is harder still because a machine cannot make
sensible aesthetic judgments. You can fiddle with the penalties between
paragraphs, but usually pagebreaks are best done manually on the few
occasions when they are needed."
--

http://www.math.upenn.edu/tex_docs/latex/koma-script/scrguien.pdf

--
| enlargefirstpage |
--
"As described later in this chapter, the first page of a letter always uses 
a

different page layout. The scrlttr2 class provides a mechanism to calculate
height and vertical alignment of head and foot of the first page 
independently
of the following pages. If, as a result, the foot of the first page would 
reach

into the text area, this text area would automatically be made smaller using
the \enlargethispage macro. On the other hand, if the text area should 
become larger, supposed the foot on the first page allows that, you could 
use this option. At best, some more text would fit on the first page. See 
also the description of pseudo length firstfootvpos at section 6.4.2. This 
option can take the standard values for simple switches, as listed in Table 
6.1. Default is false."

---

SH: I surmised that if the first page of a letter always used a different
page layout, that there would be a procedure to redefine the page layout
for subsequent pages. I've done things like change the size of type from
12 to 11 or vice versa, increase the marigins by .25 on both sides and
increase or decrease the bottom margin which is not noticeable if the
letter is only two pages and doesn't continue to the bottom of the page.

Sometimes a long paragraph could be reworded and broken up into two 
paragraphs, and maybe \clearpage would work. Or the paragraph can be

padded by a sentence or stated a bit more concisely and shortened.
Maybe a bit of tinkering will get the first page to end with a paragraph
so that new margins can be defined for the rest of the letter, if I kenned
the objection. Of course Paul you are clever and maybe you have thought
of these suggestions and they plumb won't work.

Regards,
Stephen





Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Rich Shepard

On Tue, 17 Jan 2006, Kevin Pfeiffer wrote:


What is explained??


Kevin,

  The two minipages not being aligned at their top edges.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Kevin Pfeiffer
Rich Shepard writes:
> On Tue, 17 Jan 2006, Kevin Pfeiffer wrote:
[...]
>This is explained in Section 5.1.4, Problems With Vertical
> Placement (pp. 89-90) in Kopka and Daly, Guide to LaTeX, 4th Ed.

What is explained?? I was simply trying out Helge's "easy" solution. Is 
there something in her instructions that I missed?

-Kevin

-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Rich Shepard

On Tue, 17 Jan 2006, Kevin Pfeiffer wrote:


This sounds good, but when I try it I get:

XX
XX
XX
XX
John Hancock
1234 Broadway Blvd.

Both are set to TOP alignment; they are side-by-side, with suitable width
(100pt and 25%colwidth).


Kevin,

  This is explained in Section 5.1.4, Problems With Vertical Placement (pp.
89-90) in Kopka and Daly, Guide to LaTeX, 4th Ed.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread john
On Tue, 2006-01-17 at 09:43 +0100, Helge Hafting wrote:
> >
> It is easy enough. :-)
> Insert two minipages, reduce the size from 100% of line to something smaller
> so they fit beside each other on the same line.  Make sure they both use
> "top" alignment (default).
> 
> In the first minipage, insert your logo graphichs.
> In the second minipage, write your name. Set the font to Huge using
> the appropriate menu.
> 
> Fine-tune the width of the minipage containing the logo, so you get a
> useful distance between the logo and the name.  They should already
> line up perfectly thanks to "top" alignment of the minipages and
> their contents.

Yes I tried that and with the hfill. 
Despite setting "top" alignment on both, it did not take effect in the
right hand minipage (it centred vertically). I checked the tex export to
see if the "top" had carried through --- it had!

When I created the HTML version, the minipages were displayed one above
the other.
My version is LyX 1.3.5 which comes with SuSE 9.3.

On reflection, the root cause may have been the same problem: the
failure by latex2html to scale the graphic logo to the right size when
given just the width and asked to preserve aspect ratio..
I will experiment further with the minipage solution. If I can make it
work with all 3 formats, it will be a more elegant solution. 

regards
John O'Gorman


> That's it!  Minipages is the answer, when you need to position blocks
> of text/pictures relative to each other. Sometimes you may want lots of
> space between such minipages, in such cases insert hfill between them.
> 
> Helge Hafting
> 



Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Kevin Pfeiffer
Helge Hafting writes:
> It is easy enough. :-)
> Insert two minipages, reduce the size from 100% of line to something
> smaller so they fit beside each other on the same line.  Make sure
> they both use "top" alignment (default).

This sounds good, but when I try it I get:

XX
XX
XX
XX
 John Hancock
 1234 Broadway Blvd.

Both are set to TOP alignment; they are side-by-side, with suitable 
width (100pt and 25%colwidth).

-Kevin



-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


Re: Business letter (on letterhead) template for LyX

2006-01-17 Thread Helge Hafting

john wrote:


On Mon, 2006-01-16 at 15:16 -0800, Rich Shepard wrote:
 


On Tue, 17 Jan 2006, John O'Gorman wrote:

   


I am trying to put a logo at the top left of the page. Alongside the logo,
I want my business name in \Huge letters. (This is mainly for the purpose
of building web pages.)
 


John,

  Something like the attached?
   


Yes exactly!
 


  I did this in OO.o, trimmed the page size as small as possible, then saved
it as a .pdf file.
   


Shrug. I had hoped it would be easy in LyX (because that's what I tell
everyone!)
 


It is easy enough. :-)
Insert two minipages, reduce the size from 100% of line to something smaller
so they fit beside each other on the same line.  Make sure they both use
"top" alignment (default).

In the first minipage, insert your logo graphichs.
In the second minipage, write your name. Set the font to Huge using
the appropriate menu.

Fine-tune the width of the minipage containing the logo, so you get a
useful distance between the logo and the name.  They should already
line up perfectly thanks to "top" alignment of the minipages and
their contents.

That's it!  Minipages is the answer, when you need to position blocks
of text/pictures relative to each other. Sometimes you may want lots of
space between such minipages, in such cases insert hfill between them.

Helge Hafting


Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread john
Aha!

I've done it!

The secret was rather silly. It was in the includegraphics dialogue box.
I had been supplying a width and checking the maintain aspect ratio box.
Regardless of what size I set, latex2htnl was creating an  tag
with WIDTH=470 HEIGHT=471.
Looking at Kevin's code, I noticed that he supplied both height and
width. So I did the same and unchecked the aspect ratio box --- and
voila! It came good!

The winning approach was to 
1. Create a table with 1 row, 2 columns.
2. Into the 1st column insert a table with 2 rows, 1 column
Why? God knows! I found that I had to effectively lower the graphic by
putting it in the 2nd row (leaving the 1st row empty)
3. For the Address, I put a 4 row, 1 column table in the 2nd col of the
outermost table. Into this I entered the Name and address stuff.

This all now produces essentially the same output for DVI, PDF, and
HTML.

Many thanks to Kevin and Rich. You input helped.

I can now happily continue to tell all my clients how easy LyX is to
use!

It reminds me of a maths lecture I attended in my student days. The
lecturer was detailing a proof on the blackboard. He started to say:
"From the above it is obvious that "
Then he stepped back and thought deeply for a while. Then he left the
room. We waited. 5 minutes later he returned smiling and said:
"Yes it is obvious." and contiunued to outline the proof.

regards
John O'Gorman








Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread john
On Tue, 2006-01-17 at 04:19 +0100, Kevin Pfeiffer wrote:

> Attached is one rough suggestion (just cribbed together with some 
> hard-wired values and not tried in a letter template.

Thanks for that.  A different approach.
Unfortunately, latex2html could not render it properly.
The -ve vspace command defeated it. So the logo appeared above the name.
Sigh! Back to the drawing board.

John O'Gorman
> 
> -Kevin
> 
> 



Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Rich Shepard

On Tue, 17 Jan 2006, Kevin Pfeiffer wrote:


Attached is one rough suggestion (just cribbed together with some
hard-wired values and not tried in a letter template.


Kevin,

  Very nicely done!

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Kevin Pfeiffer
john writes:
> In fact I have a little progress. With a bit of bodging tables within
> tables I have got it how I like for DVI and PDF output.
> Unfortunately latex2html now stuffs up the logo (making it too big).

Attached is one rough suggestion (just cribbed together with some 
hard-wired values and not tried in a letter template.

-Kevin


-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


logo.pdf
Description: Adobe PDF document
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
\usepackage{graphicx}
\end_preamble
\language ngerman
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Standard


\begin_inset ERT
status Open

\layout Standard

\backslash 
newcommand{
\backslash 
addr}{
\backslash 
huge{John Manchester}
\backslash 

\backslash 

\backslash 
normalsize{123 Broadway Boulevard
\backslash 

\backslash 
New York, NY 1}}
\layout Standard

\backslash 
parbox[t]{0.10
\backslash 
textwidth}{
\backslash 
includegraphics[height=50pt,width=40pt]{/home/pfeiffer/Documents/misc/sempe.eps}}
\layout Standard

\backslash 
vspace{-48pt}
\layout Standard

\backslash 
hspace{45pt}
\backslash 
parbox[t]{0.5
\backslash 
textwidth}{
\backslash 
addr}
\layout Standard

\end_inset 


\the_end


Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread john
On Mon, 2006-01-16 at 16:23 -0800, Rich Shepard wrote:

>It probably _is_ easy when you know exactly how to do it. :-) I found this
> approach took me less time.

Yes. 
In fact I have a little progress. With a bit of bodging tables within
tables I have got it how I like for DVI and PDF output. 
Unfortunately latex2html now stuffs up the logo (making it too big).
But I am getting there. 
Sheer dogged doctrinaire persistence will, I hope, reap its just reward!

regards
John O'Gorman
> 
> Rich
> 



Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Rich Shepard

On Tue, 17 Jan 2006, john wrote:


Shrug. I had hoped it would be easy in LyX (because that's what I tell
everyone!)


John,

  It probably _is_ easy when you know exactly how to do it. :-) I found this
approach took me less time.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread john
On Mon, 2006-01-16 at 15:16 -0800, Rich Shepard wrote:
> On Tue, 17 Jan 2006, John O'Gorman wrote:
> 
> > I am trying to put a logo at the top left of the page. Alongside the logo,
> > I want my business name in \Huge letters. (This is mainly for the purpose
> > of building web pages.)
> 
> John,
> 
>Something like the attached?
Yes exactly!
> 
>I did this in OO.o, trimmed the page size as small as possible, then saved
> it as a .pdf file.
Shrug. I had hoped it would be easy in LyX (because that's what I tell
everyone!)

Thanks Rich
John O'Gorman
> 
> Rich
> 
> -- 
> Richard B. Shepard, Ph.D.   |   Author of "Quantifying 
> Environmental
> Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy 
> Logic"
>  Voice: 503-667-4517 Fax: 503-667-8863



Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Rich Shepard

On Tue, 17 Jan 2006, John O'Gorman wrote:


I am trying to put a logo at the top left of the page. Alongside the logo,
I want my business name in \Huge letters. (This is mainly for the purpose
of building web pages.)


John,

  Something like the attached?

  I did this in OO.o, trimmed the page size as small as possible, then saved
it as a .pdf file.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863

latex-with-logo.pdf
Description: Adobe PDF document


Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread John O'Gorman
I have a similar problem but not with a letter class.

I am trying to put a logo at the top left of the page.
Alongside the logo, I want my business name in \Huge letters.
(This is mainly for the purpose of building web pages.)

The problem is that the Name is vertically centred alongside the logo.
I want it to be aligned with the top of the Logo.

Among other things that I have tried are
1. A table with 2 columns: logo in left column, a nested table in right
column with the Name in the top row of the table. No good.

2. 2 minipages with an hfill between them (as suggested in the LyX
documentation). 

In all cases, despite setting top alignment, I get cetre alignment
vertically. 
I have tried putting a vfill beneath the elements. 

Any ideas?

regards
John O'Gorman



Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Andre Poenitz
On Mon, Jan 16, 2006 at 11:11:39AM +0100, Kevin Pfeiffer wrote:
> Paul A. Rubin writes:
> 
> > 1. (This is the only major issue.)  Our letterhead includes logos on
> > both the left side of the paper and along the top.  Dealing with the
> > top is not a problem, but for the life of me I cannot find a way in
> > komascript to make the left margin two inches on the first page
> > (which will be letterhead) and one inch on every other page (plain
> > bond).
> 
> The answer that I got is that this is not easily possible, "because the 
> size of the print area can only be changed between pages, i.e. when a 
> \newpage command can be used. That is because there is no possibility 
> to recalculate an already split paragraph, and exactly that would be 
> necessary when the print area on the next page is supposed to change." 
> If I understand that correctly, TeX splits a paragraph into lines 
> before it begins to print it. On the next page, these lines may then be 
> too short or too long. (Or so I interpreted this -- corrections 
> welcome.)

That's essentially correct.

TeX works on a per-paragraph base and decideds from time to time to
'ship' a full page. In this case, part of the last paragraph maybe left
over for the next page. But any linebreaks TeX already inserted in this
part are 'permanent'.

Note that the lines on a page do not have to have the same length, but
you have to know _before_ anything happens how many lines you want in a
given width. It's sort of a trap door function...

So, in theory, there is a way to work around: Run TeX twice, in the first
run record the place where the page break is inserted and in the second
run ogbble up only so many lines from that paragraph that fit on the
first page. Fake a page break there and start over with a different
\textwidth on the second page.

In practice, I never managed to implement that.

Andre'



Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Paul A. Rubin

Kevin Pfeiffer wrote:

Paul A. Rubin writes:



1. (This is the only major issue.)  Our letterhead includes logos on
both the left side of the paper and along the top.  Dealing with the
top is not a problem, but for the life of me I cannot find a way in
komascript to make the left margin two inches on the first page
(which will be letterhead) and one inch on every other page (plain
bond).



The answer that I got is that this is not easily possible, "because the 
size of the print area can only be changed between pages, i.e. when a 
\newpage command can be used. That is because there is no possibility 
to recalculate an already split paragraph, and exactly that would be 
necessary when the print area on the next page is supposed to change." 
If I understand that correctly, TeX splits a paragraph into lines 
before it begins to print it. On the next page, these lines may then be 
too short or too long. (Or so I interpreted this -- corrections 
welcome.)


Why not use the same wide margin on all pages (no one was ever punished 
for using too much white space -- well, unless maybe it was for a 
dissertation)?  Or do as my wife does at her Uni -- she uses letterhead 
that has only the logo pre-printed and prints the "right margin 
letterhead stuff" herself (its all in her template).


Sorry I couldn't help more. (The other two items I think you can find in 
the manual.)


-Kevin





Kevin,

Thanks for all the research on this!  I'll see if I can adapt your 
\ifthenelse hack to the komascript letter class.  At least its 
comforting to know this is not trivial (and I'm not missing something 
obvious).


/Paul




Re: Business letter (on letterhead) template for LyX

2006-01-16 Thread Kevin Pfeiffer
Paul A. Rubin writes:

> 1. (This is the only major issue.)  Our letterhead includes logos on
> both the left side of the paper and along the top.  Dealing with the
> top is not a problem, but for the life of me I cannot find a way in
> komascript to make the left margin two inches on the first page
> (which will be letterhead) and one inch on every other page (plain
> bond).

The answer that I got is that this is not easily possible, "because the 
size of the print area can only be changed between pages, i.e. when a 
\newpage command can be used. That is because there is no possibility 
to recalculate an already split paragraph, and exactly that would be 
necessary when the print area on the next page is supposed to change." 
If I understand that correctly, TeX splits a paragraph into lines 
before it begins to print it. On the next page, these lines may then be 
too short or too long. (Or so I interpreted this -- corrections 
welcome.)

Why not use the same wide margin on all pages (no one was ever punished 
for using too much white space -- well, unless maybe it was for a 
dissertation)?  Or do as my wife does at her Uni -- she uses letterhead 
that has only the logo pre-printed and prints the "right margin 
letterhead stuff" herself (its all in her template).

Sorry I couldn't help more. (The other two items I think you can find in 
the manual.)

-Kevin



-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Kevin Pfeiffer
From comp.text.tex (1996):
Eric Fruits ([EMAIL PROTECTED]) (comp.text.tex <[EMAIL PROTECTED]>) 
wrote:  
: I have letterhead with all the important info (logo, etc.) on the left 
: margin, instead of the top or bottom of the page.  Consequently, I'd 
: like to hack the letter class in some way so that it has a 2 inch left 
: margin on the first page and a normal margin on subsequent pages. 
 
David Carlisle answers:
> TeX breaks paragraphs into lines *before* trying to break pages there 
is 
>  no interaction between these two processes (which is probably the 
>  biggest weakness in TeX's design). So the lines in a paragraph that 
>  spans between the first and second pages will be set to
>  the conditions  of the first page (or the second, but not both). 
>  
> If you know for some class of documents that the page break will 
>  happen between paragraphs then you are in much better shape. 
>  
> If you really need the paragraph shape to change depending on the 
>  page break you have to do a multi-pass system, where the pagebreak 
>  determined on one run is saved (somehow) in the aux file and then a 
>  suitable \parshape is used on the second run that changes the line 
>  width in the paragraph after the number of lines specified on the 
>  first run. If you only want to do this for the first page, it might 
>  even work.

So, food for thought (but no answer, yet, to your question). I also 
posted your question at www.koma-script.de...

-Kevin



-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations


Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Helge Hafting
On Sun, Jan 15, 2006 at 07:13:53PM +0100, Kevin Pfeiffer wrote:
> 
> (I also think that one probably does not need the ifthenelse package for 
> this; LaTex/TeX must have some basic logic controls built in, I think.)

Tex have it.  The ifthenelse package isn't magic - like every other package
it consist of tex commands only.  So all you can do with packages you can do 
without too - the packages are only for convenience. :-)

Tex conditionals are documented in the texbook.  If you don't want
to buy it you can download texbook.tex, just be aware that
printing it is illegal.  So you have to pay, or read the tex source.

Helge Hafting


Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Kevin Pfeiffer
Paul A. Rubin writes:
> Alas, that would force me to write the letter, finalize the content,
> see where the first page ended and manually adjust the remaining text
> to the second "letter".

That would be about the same as using a hand calculator every time the 
computer needs to solve a math equation.

Attached is my "proof of concept" (the best I could do for now). It 
defines a command that changes the oddsidemargin if the page nbr is 
greater than 1. In this file the command needs to be manually called 
everytime you end a paragraph (until safely beyond page one).

I imagine that it could be / should be automatically triggered by 
watching a section counter (but no time to look at that just now).

Suggestions for improvement welcome (hah, and needed). But it shows how 
easy this should be.

-Kevin

(I also think that one probably does not need the ifthenelse package for 
this; LaTex/TeX must have some basic logic controls built in, I think.)

-- 
Kevin Pfeiffer <[EMAIL PROTECTED]>
Tiros-Translations
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
% command that checks page nbr. if > 1
% then changes margin
\usepackage{ifthen}
\newcommand\checkPageMarg{%
 \ifthenelse{\value{page} > 1}{\setlength\oddsidemargin{0pt}}{}}

   
\end_preamble
\language ngerman
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
setlength
\backslash 
oddsidemargin{72pt}
\end_inset 


\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
checkPageMarg
\layout Standard

\end_inset 


\layout Standard

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 In vehicula nunc in ligula commodo tincidunt.
 Aenean non orci.
 Donec ac risus lobortis ligula vulputate viverra.
 Nunc aliquet mauris ut neque.
 Pellentesque sollicitudin quam a sem.
 Vivamus varius nibh eu urna placerat condimentum.
 Sed luctus, dui sed scelerisque tincidunt, diam massa congue magna, in
 eleifend ipsum nibh vitae tortor.
 Phasellus porta tincidunt magna.
 Aenean posuere.
 Donec in est id mauris tempor dictum.
 Nulla condimentum.
 Sed euismod.
 Nullam imperdiet molestie dolor.
 Nunc pretium tellus sed tellus.
 Donec nec mi.
 Mauris massa.
 
\layout Standard

Nullam blandit.
 Maecenas rhoncus hendrerit lacus.
 Integer commodo dolor.
 Suspendisse potenti.
 Nulla sit amet risus vel neque faucibus vehicula.
 Curabitur eu velit.
 Ut pretium.
 Aenean laoreet.
 Maecenas id neque.
 Pellentesque habitant morbi tristique senectus et netus et malesuada fames
 ac turpis egestas.
 Donec nunc odio, lobortis id, viverra quis, mattis in, ligula.
 Aenean varius augue vel velit.
 Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
 inceptos hymenaeos.
 Aliquam condimentum vestibulum lectus.
 Quisque at odio.
 Praesent in enim.
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 In hac habitasse platea dictumst.
 Quisque leo tortor, fringilla eu, luctus a, ornare nec, neque.
 Morbi hendrerit feugiat mi.
 Curabitur pulvinar, nunc at imperdiet porttitor, nibh erat cursus magna,
 sed sollicitudin justo arcu nec mi.
 Vivamus consectetuer leo sit amet ligula.
 Vivamus aliquam, mauris ut scelerisque euismod, ipsum arcu elementum tortor,
 at eleifend dolor nibh sit amet libero.
 Integer in ligula.
 Morbi pretium.
 Morbi convallis.
 Cras velit nisl, adipiscing id, dictum sit amet, suscipit sit amet, erat.
 Aliquam volutpat quam vitae tellus.
 Vestibulum placerat urna.
 Aliquam nec orci id ante pharetra ullamcorper.
 Suspendisse potenti.
 
\layout Standard

Aliquam erat volutpat.
 Mauris venenatis consectetuer orci.
 Quisque nisi lorem, congue vel, aliquet bibendum, auctor quis, nibh.
 Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
 cubilia Curae; Quisque mi.
 Mauris euismod convallis enim.
 Cras arcu.
 Nam scelerisque.
 Donec non quam in nisl fermentum tempus.
 Nulla facilisi.
 Fusce ornare, lorem ut imperdiet vulputate, nisi libero vehicula elit,
 et dictum turpis eros eu est.
 Praesent metus dolor, vestibulum a, mattis in, volutpat a, nisi.
 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
checkPageMarg
\layout Standard

\end_inset 


\layout Standard

Phasellus ut lectus.
 Etiam ligula neque, dapibus non, tristique a, semper in, lectus.
 Aliquam in mauris.
 Aliquam erat volutpat.
 Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
 inceptos hymenaeos.
 Etiam massa nisi, auctor at, pellentesque vel, hendrerit sit amet, nibh.
 Donec dictum, nisi non euismod volutpat, 

Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Rich Shepard

On Sun, 15 Jan 2006, Paul A. Rubin wrote:


I noticed the reference to fuzzy logic in your sig.  I take it you do a lot
of work for the government? :-) As I recall, fuzzy logic is built on fuzzy
truth: true; false; sort of true; true enough to fool the voters; ...


/Paul,

  The last part of your message refers to politics as usual. There's a
historical reason why the names are "fuzzy sets" and "fuzzy logic", just as
there's a historical reason why the OS was named UNIX instead of something
else.

  Think "fuzzy" as in "vague," "inherently imprecise," "multi-valued."
Multi-valued logic was conceived by Bertrand Russell in the 1920s but never
got traction on the muddy slopes of academia. In 1965, Lotfi Zadeh at Cal
Berkeley, defined the mathematics of multi-valued sets and called them "fuzzy
sets" to distinguish them from "crisp sets" where membership is all or
nothing. No longer a need to exclude the middle. Similarly, with fuzzy logic,
AND does not need to be inclusive and OR does not need to be exclusive.

  Practical applications were developed first by the Japanese: autofocus
cameras, image stabilization, auto-pilots for airplanes, trains that run
without human drivers (e.g., Atlanta airport). More quietly, it's used to
solve otherwise intractable business problems. We use it to address
environmental impact assessments, measure sustainability, quantify natural
resource damage assessments, and similar concerns. Most of our work is with
the natural resource industries. We'll work for government agencies on
quantifying subjectivity in the environmental regulatory contexts, but not
advocating against industrial development. More information is on our web
site (URL below).

  Other applications of fuzzy logic are in game theory (economics), optimal
scheduling, multi-criteria/multi-objective decision-making, and other domains
dominated by values, beliefs, and opinions; in other words, subjectivity.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Paul A. Rubin

Martin A. Hansen wrote:

it is possible to tweak some of the distances between the blocks in a .lco
file for komascript letter v2.

pay attention to page 155 ff of srcguien.

martin


Thanks, Martin.  The same tweaks can be done in the document preamble, 
and they do let me adjust the position of the sender and recipient 
addresses.  Alas, none of the adjustments listed in the manual seem to 
let me alter the horizontal position of the date or the vertical skip 
before/after it, and scanning the sample .lco files did not help.


/Paul



Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Paul A. Rubin

Stephen Harris wrote:



I was reading in Extended.lyx and Juergen mentions scrlttr2 as quite
configurable for writing letters with Koma-script. I see "logo" 
mentioned in Chapter 6 of the document below (in English).

http://www.math.upenn.edu/tex_docs/latex/koma-script/scrguien.pdf


The scrlttr2 class is good at handling logos at the top of the first 
page (left, center or right aligned), but I don't think it handles logos 
in the left margin.  At least I can't find any reference to it.


I see you can have different letters in the same document; perhaps one
could have different segments of one letter written as multiple/two letters
with some options turned off.


Alas, that would force me to write the letter, finalize the content, see 
where the first page ended and manually adjust the remaining text to the 
second "letter".


Thanks for the response.

/Paul



Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Paul A. Rubin

Rich Shepard wrote:



  Letters are about the only writing I do with OO.o; everything else is on
LyX. I, too, would like a business letter template (full block mode) 
with my logo/letterhead on the first page and the recipient's name, the date, and

current page number on subsequent pages.


If your logo goes at the top of the page, you can do it with 
komascript's scrlttr2.  The info for the subsequent pages can be handled 
by fancyhdr.  (I think ... still playing with komascript.)  If your logo 
is in the left margin, and only on the first page, then you have the 
same problem I face.



1. (This is the only major issue.)  Our letterhead includes logos on both
the left side of the paper and along the top. Dealing with the top is 
not a problem, but for the life of me I cannot find a way in komascript to make
the left margin two inches on the first page (which will be 
letterhead) and one inch on every other page (plain bond).



  Two minipages? The left for the sidebar and the right for text?


I didn't try minipages, but I tried putting a parbox with fixed height 
on the left where the logo would be.  It just pushed what would have 
been page 1 off to page 2, still flush to the normal left margin.


Komascript treats addresses, greetings and closings, signatures, dates 
etc. separately from the text body.  Putting a parbox (or, presumably, a 
minipage) in the text body didn't work, and neither did using 
\AtBeginDocument or \AtBeginLetter to try to place one at the start of 
the letter.  There may be a good place to insert one, but I haven't 
found it.  I may take a shot with a minipage; perhaps it will work 
better than the parbox did.


2. (Minor annoyance.) Komascript right justifies the date; I would 
like to left justify it. (I leave the other elements of that line, such as

location, blank.)



3. (Minor annoyance.) I would like to shrink the vertical distance 
between the end of the recipient's address and the date line.



  These two should be adjustable in the preamble code of the template.


One would think so.  The excellent (if rather lengthy) komascript 
documentation lists a number of pseudolengths you can set, but these two 
are not among them.  I tried to read the scrlttr2 class file (not being 
particularly proficient in tex/latex coding), but I couldn't find an 
adjustable pseudolength relating to either of these, and I was not about 
to hack the class file.


  I wonder if something like the invoice template in SQL-Ledger might be a
good starting point? I added my logo to that and it's used to print 
invoices from the A/R module of the software.


I may take a look at this.  I might end up taking some basic class like 
letter and trying to wedge in a logo.  Mass mailings are not an issue; I 
just need something that looks right for an individual letter.


  If I had time to spend on this I'd like to dig in to the komascript 
letter code and see about modifying it. My experience with the OMR form (thanks to
Herbert's patient guidance) has been valuable. Unfortunately, until I 
get my fuzzy system model completely re-written I have no spare time.


I noticed the reference to fuzzy logic in your sig.  I take it you do a 
lot of work for the government?  :-)  As I recall, fuzzy logic is built 
on fuzzy truth:  true; false; sort of true; true enough to fool the 
voters; ...


/Paul



Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Martin A. Hansen
it is possible to tweak some of the distances between the blocks in a .lco
file for komascript letter v2.

pay attention to page 155 ff of srcguien.

martin

On 15/01/06, Stephen Harris <[EMAIL PROTECTED]> wrote:
>
>
> - Original Message -
> From: "Paul A. Rubin" <[EMAIL PROTECTED]>
> To: 
> Sent: Saturday, January 14, 2006 4:23 PM
> Subject: Business letter (on letterhead) template for LyX
>
>
> > Hi all,
> >
> > I'm trying to concoct a LyX template to let me write letters on school
> > letterhead, the last task for which I still rely on WordPerfect.  Having
> > looked at akletter, newlfm and komascript, I think komascript gives me
> > my best shot, and I have a template that just falls short of what I
> > need, in three ways.  I'm hoping for suggestions (including pointers to
> > other classes, if komascript is not the best choice).
> >
>
> I was reading in Extended.lyx and Juergen mentions scrlttr2 as quite
> configurable for writing letters with Koma-script. I see "logo" mentioned
> in Chapter 6 of the document below (in English).
> http://www.math.upenn.edu/tex_docs/latex/koma-script/scrguien.pdf
>
> I see you can have different letters in the same document; perhaps one
> could have different segments of one letter written as multiple/two
> letters
> with some options turned off.
>
> Maybe this will be helpful until Herbert offers his guidance.
>
> Regards,
> Stephen
>
>


Re: Business letter (on letterhead) template for LyX

2006-01-15 Thread Stephen Harris


- Original Message - 
From: "Paul A. Rubin" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, January 14, 2006 4:23 PM
Subject: Business letter (on letterhead) template for LyX



Hi all,

I'm trying to concoct a LyX template to let me write letters on school 
letterhead, the last task for which I still rely on WordPerfect.  Having 
looked at akletter, newlfm and komascript, I think komascript gives me 
my best shot, and I have a template that just falls short of what I 
need, in three ways.  I'm hoping for suggestions (including pointers to 
other classes, if komascript is not the best choice).




I was reading in Extended.lyx and Juergen mentions scrlttr2 as quite
configurable for writing letters with Koma-script. I see "logo" mentioned 
in Chapter 6 of the document below (in English).

http://www.math.upenn.edu/tex_docs/latex/koma-script/scrguien.pdf

I see you can have different letters in the same document; perhaps one
could have different segments of one letter written as multiple/two letters
with some options turned off.

Maybe this will be helpful until Herbert offers his guidance. 


Regards,
Stephen



Re: Business letter (on letterhead) template for LyX

2006-01-14 Thread Rich Shepard

On Sat, 14 Jan 2006, Paul A. Rubin wrote:


I'm trying to concoct a LyX template to let me write letters on school
letterhead, the last task for which I still rely on WordPerfect. Having
looked at akletter, newlfm and komascript, I think komascript gives me my
best shot, and I have a template that just falls short of what I need, in
three ways. I'm hoping for suggestions (including pointers to other
classes, if komascript is not the best choice).


Paul,

  Letters are about the only writing I do with OO.o; everything else is on
LyX. I, too, would like a business letter template (full block mode) with my
logo/letterhead on the first page and the recipient's name, the date, and
current page number on subsequent pages.


1. (This is the only major issue.)  Our letterhead includes logos on both
the left side of the paper and along the top. Dealing with the top is not a
problem, but for the life of me I cannot find a way in komascript to make
the left margin two inches on the first page (which will be letterhead) and
one inch on every other page (plain bond).


  Two minipages? The left for the sidebar and the right for text?


2. (Minor annoyance.) Komascript right justifies the date; I would like to
left justify it. (I leave the other elements of that line, such as
location, blank.)


3. (Minor annoyance.) I would like to shrink the vertical distance between 
the end of the recipient's address and the date line.


  These two should be adjustable in the preamble code of the template.

  I wonder if something like the invoice template in SQL-Ledger might be a
good starting point? I added my logo to that and it's used to print invoices
from the A/R module of the software.

  If I had time to spend on this I'd like to dig in to the komascript letter
code and see about modifying it. My experience with the OMR form (thanks to
Herbert's patient guidance) has been valuable. Unfortunately, until I get my
fuzzy system model completely re-written I have no spare time.

Rich

--
Richard B. Shepard, Ph.D.   |   Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM)   |  Impact Assessments Using Fuzzy Logic"
 Voice: 503-667-4517 Fax: 503-667-8863


Business letter (on letterhead) template for LyX

2006-01-14 Thread Paul A. Rubin

Hi all,

I'm trying to concoct a LyX template to let me write letters on school 
letterhead, the last task for which I still rely on WordPerfect.  Having 
looked at akletter, newlfm and komascript, I think komascript gives me 
my best shot, and I have a template that just falls short of what I 
need, in three ways.  I'm hoping for suggestions (including pointers to 
other classes, if komascript is not the best choice).


1. (This is the only major issue.)  Our letterhead includes logos on 
both the left side of the paper and along the top.  Dealing with the top 
is not a problem, but for the life of me I cannot find a way in 
komascript to make the left margin two inches on the first page (which 
will be letterhead) and one inch on every other page (plain bond).


2. (Minor annoyance.) Komascript right justifies the date; I would like 
to left justify it.  (I leave the other elements of that line, such as 
location, blank.)


3. (Minor annoyance.) I would like to shrink the vertical distance 
between the end of the recipient's address and the date line.


Any suggestions will be greatly appreciated.

TIA,
/Paul