Re: [NTG-context] Ugly hack for multiple MSWord docs.

2006-06-15 Thread Bob Kerstetter

On Jun 13, 2006, at 5:29 PM, John R. Culleton wrote:

 Frequently I find myself in the position of needing to combine
 several MSWord and/or rtf documents into a single file for either
 pdftex or Context. I have settled on this strategy.



 snip

 Someday there will be an elegant solution to the MSWord to
 Context problem. For now there is my ugly hack as described here.


MEMORY DISCLAIMER: In these examples none of the function names are  
really what they are in Word or VB for Word. The functions are  
available in VB for Word, but it's been some time since I've done  
this, i don't have the macros these days and don't really know the  
real names anymore. So they are just representative of the functions  
available.

STYLE COMMENT: These methods should work even if styles are not being  
used. For example the primary heading may be Arial, 18pt, bold and  
not the Heading 1 style. That's okay because you can search for font  
attributes in Word. If the document is not consistent, well, convert  
to text and markup manually. :)



MORE OR LESS CURRENT EXAMPLE

It's not particularly elegant, but I used to convert from MSWord to  
whatever by writing VB find/replace macros based on styles and  
formatting. In newer versions of Word (at least on OS X), Replace has  
a function that includes what you found, plus you can add other text.

Example:

Find: Heading 1%find stuff formatted with heading 1 style

Replace: \subject{WhatItFound}   %replaces what it found and  
wraps \subject{} around it.


Because Word stores its formatting in the line feed/carriage return,  
for paragraph styles you end up with something like this:

\subject{Some TeX
}

So my last VB find/replace removes the carriage returns globally:

Find: ^p}
Replace: }


When done with all find/replace functions, save as text.

That's it.


Not being much of a script writer, I record the first find/replace,  
then edit the macro and duplicate the find/replace as needed.

The VB find/replace function has options for starting at the top of  
the file, replacing globally, continuing if nothing is found and that  
sort of thing.

The macro looks something like this:

Find: Heading 1%find stuff formatted with heading 1 style
Replace: \subject{WhatItFound}   %replaces what it found and  
wraps \subject{} around it.

Find: Heading 2%find stuff formatted with heading 2 style
Replace: \subsubject{WhatItFound}   %replaces what it found and  
wraps \subsubject{} around it.

Find: Heading 3%find stuff formatted with heading 3 style
Replace: \subsubject{WhatItFound}   %replaces what it found and  
wraps \subsubsubject{} around it.


The above method uses global replacement and it's pretty zippy, for  
Word.



ANOTHER OLDER METHOD

Another method I used before Find/Replace had the WhatItFound  
function was to put the found string into a variable, then use that  
variable for the replacement text, plus any TeX control sequences  
wrapped around it.

In summary:

1. Put your finds and replaces in an array:
ArrayFind(0) Heading 1; ArrayReplace(0) \subject{
ArrayFind(1) Heading 2; ArrayReplace(1) \subsubject{
ArrayFind(2) Heading 3; ArrayReplace(2) \subsubsubject{
Note the closing } is missing. It is hardcoded in the replacement code.

2. Find the first array item starting from the top of the document.  
This highlights the text in Word:
Find = $ArrayFind(n)

3. Put the highlighted text into a variable. Maybe you can even strip  
the CR's from formatted pagagraphs:
stripCarriageReturns($FoundThisStuff) = CurrentSelection


4. Put the variable and the first replace item in the Word Replace  
function. Note the hard coded closing bracket. And the CR assuming  
you stripped the CR in step 3:
Replace = $ArrayReplace(n)+$FoundThisStuff+}+CR

5. Repeatedly use Replace and Find Next until nothing else is found.
Replace and Find Next
.
.
.

6. Repeatedly find the next array item to the end of the array.
n = n + 1
Find = $ArrayFind(n)
.
.
.

7. Save the file as text.
FilesSaveAs using the text option


Hum. After thinking about this and typing it in, maybe I should still  
use the OLD method. It appears to be a little easier to manage. Maybe  
a lot easier.
Oh well, not a real programmer.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] framed texts for boxing stuff

2006-01-11 Thread Bob Kerstetter


On Jan 9, 2006, at 5:01 PM, Hans Hagen wrote:

hm, i prefer to start from user demands and personal needs; we used  
latex for a very short time and i don't remember mini pages -)



a minipage is a box, but i think it's in paragraph mode.


 \begin{minipage}[position]{width}
  text
 \end{minipage}


Put two together

 \begin{minipage}[t]{.30\linewidth}
  text and images
 \end{minipage}\hfill
%
 \begin{minipage}[t]{.60\linewidth}
  text and images
 \end{minipage}

and you get two boxes horizontally across the page with the hfill  
space between them


Put three together:

 \begin{minipage}[t]{.30\linewidth}
  text and images
 \end{minipage}\hfill
%
 \begin{minipage}[t]{.30\linewidth}
  text and images
 \end{minipage}\hfill
%
 \begin{minipage}[t]{.30\linewidth}
  text and images
 \end{minipage}

and you get three boxes horizontally across the page with the hfill  
space between them


Their vertical dimensions depend on the amount of content. They don't  
cross page breaks.



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] PDF Forms

2005-03-24 Thread Bob Kerstetter
Hi,
Is there some way to create PDF docs (as forms maybe?) so end users can 
add their own contact information and logos just by using Adobe Reader, 
not Acrobat? These are one to four page documents. Right now I can do 
this by supplying them with Word docs.

Thanks.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] ConTeXt and Aleph

2004-08-17 Thread Bob Kerstetter
On Aug 17, 2004, at 11:24 AM, Idris Samawi Hamid wrote:
aleph
aleph is the omega snip-off?
for fun, lookup aleph on google.  lots of alephs running around.
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: ConTeXt Switcher?

2003-12-11 Thread Bob Kerstetter
Hi Christopher,

On Dec 11, 2003, at 11:16 AM, Christopher G. D. Tipper wrote:

Date: Wed, 10 Dec 2003 01:27:34 +0100
From: Giuseppe Bilotta [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re[2]: [NTG-context] ConTeXt Switcher?
Reply-To: [EMAIL PROTECTED]
Not that I see the purpose of using Word in the frist place.
Any decent editor has enough macro power to do the same.
--
Giuseppe Oblomov Bilotta
You missed the point. You markup and style your document using Word
styles, and then XML is a matter of search and replace. I am not 
interested
in Word per se, but I find using emacs to insert markup during document
creation gets in the way of my thought processes. This way I can push 
markup
worries to the editorial stage.

People are fond of pointing out Words vices, and I wouldn't quibble 
with
arguments about its stability, but it is about time OpenOffice and its 
ilk
stopped resting on their laurels and started implementing some macro
capability. I notice that AbiWord has a DocBook output format, but how 
well
integrated this is I don't know.

On Micro$oft's part if they had some real competition a real market in
third-party templates might arrive. As it stands I have a 50% solution 
that
handles footnotes and lists, but re-distribution is hampered by the 
way Word
handles its templates and virus worries. Theoretically I could do 
tables and
limited image markup using the same techniques. Leveraging the visual 
layout
tools of a word-processor makes so much sense I wonder at the 
mentality of
people still struggling with text-editors. I have emacs set up on my
machine, but it really looks like back to the future from my point of 
view.
I use WinEdt when I'm booted into Windows.

btw you can use the same technique to generate native Context markup. 
It
needs hand-editting, but as a rough draft, this works fine for me, and 
I
don't have to re-invent the wheel every time I have a new document.

You're point is well taken. I once wrote a complete Windows Help system 
generator using Word Basic macros and nothing else. If fed correctly 
structured documents, the macros would mark up all topics for display, 
page browsing, cross references, context sensitivity and indexes. It 
would then call the compiler. It took about 40 minutes to markup and 
compile a help system equivalent to 400 pages of text, graphics and 
all, on 1993-era Windows machines. The macros could also clean the 
files and start over if major changes were needed in the text. It was a 
freebie and efficient alternative to RoboHelp.

I have just lost too much work to Word-corrupt files and Word-crashed 
systems to continue with MS. TeXShop (Mac OS X) has never crashed or 
hung in 15 months of use. The files have never become corrupt. I am 
looking at Nisus, or perhaps the OS X native TextEdit, as visual 
editors for the reasons you applaud Word. They both write rtf natively. 
I'm also looking at TeX4ht with ConTeXt. For now, TeXShop, LaTeX and 
TeX4ht are more flexible and stable than Word. We'll see. :)

Take care.

BK



___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] context2html converter (was: ConTeXt Switcher? )

2003-12-09 Thread Bob Kerstetter
On Dec 9, 2003, at 6:52 AM, Maurice Diamantini wrote:

A context2html solution is a big miss for ConTeXt
tex4ht could be that solution.
(if only a tex4ht power user would switch from LaTeX to ConTeXt :-)
I have contacted a friend who is a tex4ht power user and asked if he 
could help with making tex4ht work with ConTeXt. He said his 
uneducated guess is that tex4ht can be made to work with ConTeXt, but 
he would need help installing ConTeXt on his Sun Solaris account. He 
does not have root access. The help would consistent of:

Where to put things, setting up configuration files if such are 
needed, and similar issues that a user like me with no root access 
might encounter to get the system to run. In short, someone who can 
lead me in small steps through the installation process.

Do such instructions already exist? Or, if someone can provide that 
type of help, please contact me offlist and I'll put y'all together.





___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] ConTeXt Switcher?

2003-12-09 Thread Bob Kerstetter
On Dec 9, 2003, at 5:39 PM, Christopher G D Tipper wrote:

On Dec 8, 2003, at 2:33 PM, Henning Hraban Ramm wrote:

Am Montag, 08.12.03, um 18:20 Uhr (Europe/Zurich) schrieb Bob
Kerstetter:
ConTeXt is very attractive because of its detailed control, layers,
colors, few or no packages(!), magical developers, and on and 
on.
It can obvious produce PDF. Can it also produce HTML and Word from
the same document?
The normal way to get both PDF and HTML is using a XML source.
You know of ConTeXts native XML mode?
AFAIK you can import XML or HTML into MS Office, too, so you need no
real Word DOC output.
Or perhaps there's an other XML to RTF/DOC Konverter...
I know XML source should work, but at least for me, creating XML 
source
is unproductive.  I work with a text editor and find writing this:

``Hello world,'' says HAL.

much more productive than writing this:

p#8220;Hello world#8221;/p, says HAL.

Maybe I'm missing something, but for writing, XML's markup 
requirements
-- which are invisible to field-based data entry screen -- are way 
too 
intense for hand-editing. TeX source is much less verbose. It is 
easier
to create, proof (both visually and audibly),  spell check
troubleshoot, etc. I have not seen an editor capable of doing XML
source in a productive manner, like (La)TeX with text editor.
This is probably taboo, but surely the smart thing to do is start from 
Word, generate some XML with macros, and produce some HTML with 
stylesheets, some PDF with ConTeXt. BTW you can generate some simple 
Context with VB macros and hand-edit -- saves a whole load of mundane 
stuff. I can go from a web page to PDF in under 15 minutes using the 
Word macros I have for Context.
Thanks for the suggestion.

I don't really have a problem with Word for writing letters and the 
like. For large docs, however, it's just too unpredictable. Images move 
around. Numbered lists break. Cross references change. Formatting blows 
up if you even look at an end-paragraph mark (where all the paragraph 
info is stored). Styles revert to their defaults. Word crashes, often. 
My main source documents would be in a proprietary file format known 
for its tendencies toward corruption. I used Word for 15 years and it's 
just too much pain. My schedules are too tight to trust it.

But least I sound like an MS basher, Word TOCs and Tables are 
excellent. Mail merge to email using MAPI it cool. And I did once write 
a complete Windows help system generator using only Word Basic. This 
was before VBA, before you had to be an OO programmer to write Word 
macros. :)

These days I keep Word for Windows safety contained in a Mac OS X 
Remote Desktop Connection window. ;-)

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] ConTeXt Switcher?

2003-12-08 Thread Bob Kerstetter
On Dec 8, 2003, at 12:55 PM, Peter Münster wrote:

On Mon, 8 Dec 2003, Bob Kerstetter wrote:

It can obvious produce PDF. Can it also produce HTML and Word from the
same document?
Hello,
I like TeX4ht for LaTeX. It would be great, if TeX4ht and ConTeXt work
together. It seems, that it works well with plain-TeX, so why not with
ConTeXt?
TeX4ht is excellent. It's what I use for LaTeX to HTML and Word (via 
HTML convertion). It would require writing a custom configuration file 
to make it work with ConTeXt. I could be done, I just don't know how to 
do it. I have tried repeated to understand TeX4ht's conversion, but 
have never succeeded.

___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] ConTeXt Switcher?

2003-12-08 Thread Bob Kerstetter
On Dec 8, 2003, at 2:33 PM, Henning Hraban Ramm wrote:

Am Montag, 08.12.03, um 18:20 Uhr (Europe/Zurich) schrieb Bob 
Kerstetter:
ConTeXt is very attractive because of its detailed control, layers, 
colors, few or no packages(!), magical developers, and on and on. 
It can obvious produce PDF. Can it also produce HTML and Word from 
the same document?
The normal way to get both PDF and HTML is using a XML source.
You know of ConTeXts native XML mode?
AFAIK you can import XML or HTML into MS Office, too, so you need no 
real Word DOC output.
Or perhaps there's an other XML to RTF/DOC Konverter...
I know XML source should work, but at least for me, creating XML source 
is unproductive.  I work with a text editor and find writing this:

``Hello world,'' says HAL.

much more productive than writing this:

p#8220;Hello world#8221;/p, says HAL.

Maybe I'm missing something, but for writing, XML's markup requirements 
-- which are invisible to field-based data entry screen -- are way too 
intense for hand-editing. TeX source is much less verbose. It is easier 
to create, proof (both visually and audibly),  spell check 
troubleshoot, etc. I have not seen an editor capable of doing XML 
source in a productive manner, like (La)TeX with text editor. 
OmniOutliner for OS X is close to being close, but too far from the 
goal to use. Is there some special thing I don't know? ???

Thanks.

Bob Kerstetter
http://homepage.mac.com/bkerstetter/
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] `Standard' vs `Beta'?

2003-11-27 Thread Bob Kerstetter
Thanks, Hans.

On Nov 27, 2003, at 3:26 AM, Hans Hagen wrote:

At 03:14 27/11/2003, you wrote:

what is the difference between the distributed and the beta 
versions of context? How current is my version? Does it have all of 
the cool stuff for doing column sets?
in most cases recent versions of distributions have the latest 
context, however, you can download the version from our site, put it 
in your texmf local tree, run mktexlsr and texexec --make --alone and 
it should work; i'm working on a tree on our server so that one can 
rsync

columnsets are available in older versions, but not always with all 
tricks

type this in the terminal

context -version

prints this on the screen:

pdfeTeX (Web2C 7.5.2) 3.141592-1.11a-2.1
kpathsea version 3.5.2
Copyright (C) 1997-2003 The NTS Team (eTeX)/Han The Thanh (pdfTeX).
Kpathsea is copyright (C) 1997-2003 Free Software Foundation, Inc.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfeTeX copyright and
the GNU General Public License.
For more information about these matters, see the files
named COPYING and the pdfeTeX source.
Primary author of pdfeTeX: The NTS Team (eTeX)/Han The Thanh (pdfTeX).
Kpathsea written by Karl Berry and others.
there is a new pdfetex on the tex live dvd/cd, but for the moment 
1.11a is pl

Hans
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context