Discussion:
[Scribus] How to bold first word in every paragraph
unknown
2006-06-20 05:04:02 UTC
Permalink
Hi.
I'm pretty new to Scribus. I need to make a newspaper with ads and I want every ad start with the first word in bold. Ads will be imported probably from text files (exported from MySql) or/and from OpenOffice file - I know that from OO it 's imported with styles but I wouldn't like to prepare each advertisement manually. So how to do it?
The second problem - much easier I suppose - how to prevent imported objects (pictures) from deviding sections (paragraphs)? In other words - when I put picture field which has width of min. 2 columns I'm able to put it in that way that it is between two paragraphs in the first column but in the second one it divides paragraph into two parts. I'd like the section in second column to move so the picture was also between section. I can do it of course manually but I'd like it done automatically.
Thanks in advance.
tomjas
unknown
2006-06-22 17:21:41 UTC
Permalink
Surprised no-one has replied yet. From my understanding this needs
version 1.3.4 (which doesn't really exist yet!) Until then the official
line is you can't import character formatting, only para formatting.
I was supposed to write a Wiki article on a work around I found - but
ran out of time.

So the short answer is: If you can import into OO as a
database/mailmerge apply the formatting that way. so that you have a OO
document with character formatting. then save it in HTML format. You
can import HTML and it appears to apply bold/italics etc.

Hope that helps? Mail back if you need a more detailed explanation and
I might get round to writing the Wiki...

As for the divisions... No idea?

Calum
Post by unknown
Hi.
I'm pretty new to Scribus. I need to make a newspaper with ads and I want every ad start with the first word in bold. Ads will be imported probably from text files (exported from MySql) or/and from OpenOffice file - I know that from OO it 's imported with styles but I wouldn't like to prepare each advertisement manually. So how to do it?
The second problem - much easier I suppose - how to prevent imported objects (pictures) from deviding sections (paragraphs)? In other words - when I put picture field which has width of min. 2 columns I'm able to put it in that way that it is between two paragraphs in the first column but in the second one it divides paragraph into two parts. I'd like the section in second column to move so the picture was also between section. I can do it of course manually but I'd like it done automatically.
Thanks in advance.
tomjas
_______________________________________________
Scribus mailing list
Scribus at nashi.altmuehlnet.de
http://nashi.altmuehlnet.de/mailman/listinfo/scribus
--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://nashi.altmuehlnet.de/pipermail/scribus/attachments/20060622/64803266/attachment.html
unknown
2006-06-23 00:08:38 UTC
Permalink
Post by unknown
Surprised no-one has replied yet. From my understanding this needs
version 1.3.4 (which doesn't really exist yet!) Until then the
official line is you can't import character formatting, only para
formatting.
I was supposed to write a Wiki article on a work around I found - but
ran out of time.
So the short answer is: If you can import into OO as a
database/mailmerge apply the formatting that way. so that you have a
OO document with character formatting. then save it in HTML format.
You can import HTML and it appears to apply bold/italics etc.
As I try to envision the visual appearance of this, I have to ask
whether this is something one should really want to do, and therefore,
maybe it's not such a good thing to make it easy. After all, you can
double-click the first word of each paragraph, then make it bold in
Properties > Text (in Edit Contents of Frame mode) or Story Editor.

Greg
unknown
2006-06-23 00:14:24 UTC
Permalink
Post by unknown
Post by unknown
Surprised no-one has replied yet. From my understanding this needs
version 1.3.4 (which doesn't really exist yet!) Until then the
official line is you can't import character formatting, only para
formatting.
I was supposed to write a Wiki article on a work around I found - but
ran out of time.
So the short answer is: If you can import into OO as a
database/mailmerge apply the formatting that way. so that you have a
OO document with character formatting. then save it in HTML format.
You can import HTML and it appears to apply bold/italics etc.
As I try to envision the visual appearance of this, I have to ask
whether this is something one should really want to do, and therefore,
maybe it's not such a good thing to make it easy.
I do think it's useful. It's a common style for classified listings for
example. Supporting it would come as part of a wider facility for
"selector" based style application - ie a par style with an associated
char style to apply to the first word, first line, etc

--
Craig Ringer
unknown
2006-06-23 04:42:09 UTC
Permalink
Post by unknown
Post by unknown
Surprised no-one has replied yet. From my understanding this needs
version 1.3.4 (which doesn't really exist yet!) Until then the
official line is you can't import character formatting, only para
formatting.
I was supposed to write a Wiki article on a work around I found - but
ran out of time.
So the short answer is: If you can import into OO as a
database/mailmerge apply the formatting that way. so that you have a
OO document with character formatting. then save it in HTML format.
You can import HTML and it appears to apply bold/italics etc.
As I try to envision the visual appearance of this, I have to ask
whether this is something one should really want to do, and therefore,
maybe it's not such a good thing to make it easy. After all, you can
double-click the first word of each paragraph, then make it bold in
Properties > Text (in Edit Contents of Frame mode) or Story Editor.
Yeah - it's quite easy if you have a few paragraphs in the whole newspaper. As I said I want to make a paper with ads. I suppose it might be about 10 000 ads in a paper - it's quite difficult to click first word in each of them.
TJ
unknown
2006-06-23 07:33:12 UTC
Permalink
Post by unknown
Post by unknown
As I try to envision the visual appearance of this, I have to ask
whether this is something one should really want to do, and therefore,
maybe it's not such a good thing to make it easy. After all, you can
double-click the first word of each paragraph, then make it bold in
Properties > Text (in Edit Contents of Frame mode) or Story Editor.
Yeah - it's quite easy if you have a few paragraphs in the whole newspaper.
As I said I want to make a paper with ads. I suppose it might be about 10
000 ads in a paper - it's quite difficult to click first word in each of
them. TJ
I'm afraid it is not possible in current versions due the paragraph styles
handling limitations. I'm sure it will be easy maybe in 1.3.4.

I've played with some python script with a very little success only

cheers
petr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://nashi.altmuehlnet.de/pipermail/scribus/attachments/20060623/57c4d44d/attachment.pgp
unknown
2006-06-23 04:43:45 UTC
Permalink
Thanks - I hoped there might be solution for doing this job automatically.
tomjas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://nashi.altmuehlnet.de/pipermail/scribus/attachments/20060623/4e38104c/attachment.html
unknown
2006-06-23 18:37:42 UTC
Permalink
Post by unknown
Thanks - I hoped there might be solution for doing this job automatically.
tomjas
--
You can... (Everyone says you can't because I don't think it was ever
planned to work and I still don't understand how it works!) I haven't
made my description clear enough though because I forgot a step. It is
possible to automate this, but you need to do a little work...

Link your database into OO.o (I assume you know how - again ask if
stuck). Your database will need some way to identify the first word
(i.e. the first word [would it always be just ONE word?] needs a
different field). Some classifieds use first few words depending on the
add in which case you'd need to structure your data entry screen to
identify the relevant words... However, that's immaterial

Set up a mail merge using the database so that the layout is something
like this:
<<First Word>> <<Rest of advert>> <next ad>
Then apply bold to the <<First Word>> bit like this:
<<First Word>> <<Rest of advert>> <next ad>
(Sorry haven't actually used OO.o mailmerge but I know this can be done
- so this may be a bit wooley - but ask if not clear)

Now run the merge and save the finsihed output as HTML, NOW COMPLETELY
CLOSE OO.o and re-open it (no idea why but you have to!) and open the
HTML file. Now export the HTML file as an SXW file (possibly ODT will
work haven't tried, will when I write the wiki). (Before you go to lots
of effort try it with a three line example typed by hand...

Alternative (possibly better!) - if you struggle with OO.o doing it
would be to write some PHP to do it from the SQL database? and then
save the output webpage as an html file? Then open that in OO.o and
export it as SXW.
But the crucial thing (no mater how you create the html) will be to get
the first word into a seperate field. this bit of PHP should 'roughly'
work (untested): [there may be slicker ways]


<?php
// Connect to the MqSQL Database - insert your connection details here

// Read the next advert into a text string - substitute for your own selection code!!
$query = "SELECT AdvertText FROM AdvertTable WHERE AdvertID = '1' "; //replace table / field etc as appropriate, you'll also need to create a loop for each advert entry.
$text= mysql_query ($query);

// Spilt the text string into an array with each word as a separate array
$words = explode( " ", $text ); //this creates the 'advert' as an array with each word as a new 'sub-array' (there is a space in the quotes)

// Identify the first word
$firstword =$words(1) ; //if that produces second word use $words(0)

// Identify the other words
// First delete the first word
$words(1) = "";
$otherwords = implode (" ", $words);

//print the advert on screen with the first word in bold
echo "<b>".$firstword."</b>".$otherwords."<br />";

// you could also save these into a new SQL table if you wanted?
?>

If you set up the select above to come from a form that queries the data
for say 'current' adverts in some way then you should be able to use
this to create the html in a fairly 'automated way' and then all you
need to do is import it... I'm confident this will work!

Summary steps:
============
Create HTML File
Open HTML file in OO.o
Export HTML file to SXW
'Get Text' from SXW file in scribus


Calum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://nashi.altmuehlnet.de/pipermail/scribus/attachments/20060623/493c84d4/attachment.html
Continue reading on narkive:
Loading...