Re: [libreoffice-users] styles for plays?

2013-06-26 Thread Fred James

Helen wrote:

I've volunteered to edit a one-time publication of a collection of plays.
The plays came to me
in different styles -- three of the plays came to me with all the
characters's speaking lines
  centered -- the characters's names centered a line above.

Some of the writers seem to have centered the names with a centering code
-- I can
highlight the name and use the left margin code to move the name to left
margin.  Others
seem to have centered by spacing over! (yes)  and I have to backspace until
I get the name
to the left margin.

None used a colon after the speaker, and the publisher wants it.  I've made
some progress with
Search  Replace --  Search for all incidents of TOM and replace with TOM
colon space. But the
most tedious part is moving TOM from center to left and bring his speaking
lines up to begin
on the same line.  Is there any way I can put these plays into a style
sheet and save this work, or
would creating  the style sheet take as long as what I'm doing?  I've never
used styles.  And this is a one-time
job so if I have to do it all by hand, at least it's only once.

Thanks for any advice,

Helen
Not sure this is helpful ... Things are so context dependent ... Let me 
preface my remarks with:
(1) send a sample file to me (off line, if you like) and I could take a 
look at it and see what I might be able to do?

(2) depends on the results of step 1

And so, on to what I have thought of so far ...

First I thought Macro (which I don't do anything with, so no help there)
Second I thought gawk ... and I played with that with some degree of 
success ...


Steps:
(1) save document as (plain) txt (no encoding)
(2) in a terminal window, apply this command to the *.txt file ...
awk '{gsub(/^[ \t]+|[ \t]+$/,)};1' filename.txt newfilename.txt
... this removes all leading (and trailing) white space, and everything 
is left justified.  It takes out spaces, tabs, and centering, and the 
result would look like this ...

Tom
said one
Tom
said two
Tom
said three
... and LibreOffice can open and edit the new *.txt file.

That doesn't get the speaker's line adjoined or insert the necessary : 
either, but depending upon context something might be made to do the job?


Regards
Fred James

PS: credit where credit is due: I found that little one-liner at 
http://www.pement.org/awk/awk1line.txt



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] styles for plays?

2013-06-26 Thread Brian Barker

At 09:46 26/06/2013 -0400, Helen Etters wrote:
I've volunteered to edit a one-time publication of a collection of 
plays.  The plays came to me in different styles -- three of the 
plays came to me with all the characters's speaking lines centered 
-- the characters's names centered a line above.


Some of the writers seem to have centered the names with a centering 
code -- I can highlight the name and use the left margin code to 
move the name to left margin.  Others
seem to have centered by spacing over! (yes)  and I have to 
backspace until I get the name to the left margin.


None used a colon after the speaker, and the publisher wants 
it.  I've made some progress with Search  Replace --  Search for 
all incidents of TOM and replace with TOM
colon space. But the most tedious part is moving TOM from center to 
left and bring his speaking lines up to begin on the same line.  Is 
there any way I can put these plays into a style sheet and save this 
work, or would creating the style sheet take as long as what I'm 
doing?  I've never used styles.  And this is a one-time job so if I 
have to do it all by hand, at least it's only once.


In situations like this, it's very often easiest to lose all the 
existing formatting and insert your own from scratch - rather than 
trying to tinker with what you have.  That's very easy to do: just 
use Edit | Paste Special... (or right-click | Paste Special... or 
Ctrl+Shift+V) instead of ordinary Paste, selecting Unformatted text 
from the options in the Paste Special dialogue, when inserting your 
material.  Since you will already have done some work on the text, 
you can do this from where you currently are by selecting your entire 
document text, copying it, and pasting it Unformatted either back 
over the original or else into a new document.  (I'd suggest a new 
document, as you might well want to go back and look at how the 
original material *was* formatted, in fact.)


Then you need to learn a few tricks to tidy things up.

You don't need to backspace over a number of spaces.  Put the cursor 
at the start of the line (paragraph, in fact).  Press 
Ctrl+Shift+right arrow.  This will select the range of spaces.  Now 
press Delete to remove them.  You can also use Find  Replace to 
replace space-space with space.  Keep repeating that until there are 
no more double spaces and you will be close to what you need.  (It is 
seldom useful to have consecutive spaces in any word-processed 
document.)  Better still, use Find  Replace to replace ^ + (that's 
circumflex-space-plus sign) with nothing, having clicked More Options 
and ticked Regular expressions.  This will remove all spaces from 
the start of any paragraph (which is what your relevant lines will 
presumably be).


Perversely, there appears to be no easy way to merge TOM:  with the 
next paragraph (or if there is, I've managed to forget it): you might 
be left with doing this manually.


Yes, you can create styles to do some of this, but you would still 
have to apply the styles to the relevant parts of the text.  They 
would be more useful if, say, you wanted character names to be a 
different font, size, or style - or perhaps all of these - from the 
surrounding text.  Using a character style to set these would be a 
benefit in various ways: it would be quicker, it would be more 
reliable at ensuring all the text was treated in the same way, and it 
would enable you to change your selected settings later at a 
stroke.  And yes: you could import such styles into any new document 
in the future or put them in an appropriate template.


I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] styles for plays?

2013-06-26 Thread Steve Edmonds


On 2013-06-27 03:13, Fred James wrote:

Helen wrote:
I've volunteered to edit a one-time publication of a collection of 
plays.

The plays came to me
in different styles -- three of the plays came to me with all the
characters's speaking lines
  centered -- the characters's names centered a line above.

Some of the writers seem to have centered the names with a centering 
code

-- I can
highlight the name and use the left margin code to move the name to 
left

margin.  Others
seem to have centered by spacing over! (yes)  and I have to backspace 
until

I get the name
to the left margin.

None used a colon after the speaker, and the publisher wants it.  
I've made

some progress with
Search  Replace --  Search for all incidents of TOM and replace with 
TOM

colon space. But the
most tedious part is moving TOM from center to left and bring his 
speaking

lines up to begin
on the same line.  Is there any way I can put these plays into a style
sheet and save this work, or
would creating  the style sheet take as long as what I'm doing? I've 
never

used styles.  And this is a one-time
job so if I have to do it all by hand, at least it's only once.

Thanks for any advice,

Helen
Not sure this is helpful ... Things are so context dependent ... Let 
me preface my remarks with:
(1) send a sample file to me (off line, if you like) and I could take 
a look at it and see what I might be able to do?

(2) depends on the results of step 1

And so, on to what I have thought of so far ...

First I thought Macro (which I don't do anything with, so no help 
there)
Second I thought gawk ... and I played with that with some degree of 
success ...


Steps:
(1) save document as (plain) txt (no encoding)
(2) in a terminal window, apply this command to the *.txt file ...
awk '{gsub(/^[ \t]+|[ \t]+$/,)};1' filename.txt newfilename.txt
... this removes all leading (and trailing) white space, and 
everything is left justified.  It takes out spaces, tabs, and 
centering, and the result would look like this ...

Tom
said one
Tom
said two
Tom
said three
... and LibreOffice can open and edit the new *.txt file.

That doesn't get the speaker's line adjoined or insert the necessary 
: either, but depending upon context something might be made to do the 
job?


Regards
Fred James

PS: credit where credit is due: I found that little one-liner at 
http://www.pement.org/awk/awk1line.txt

Hi.
I think you are almost there. You just need to do a substitution if you 
have the actors names.

Substitute Tom: for Tom\n
I think you can perform substitution or transliteration on a list but 
can't just locate the syntax

Something like /(Tom\n)(Burt\n)(Joan\n)/(Tom:)(Burt:)(Joan:)/
Steve

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted