Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Transferring Word headings to CD

I'm using CD articles as containers to be filled with content written in MS Word, using each tool for what it does best. The Word document has headings (H1-H6) of different styles to facilitate organizing. When copy/pasting to CD these heading styles stay nicely intact.

However, in CD I want headings H1-H6 to have the same style. Since in CD pages are short, they will only have 2 or 3 headings per page, which could be H2 as well as H6 depending how deep in the structure the page sits. So I feel they should all have the same style on a CD page.

I thought the solution would be a simple .css statement: H1, H2, H3, H4, H5, H6 {font-size=12pt; font-weight=bold}.
However, it doesn't work, although the style sheet is properly linked (e.g. changing color does happen).

Probably I missed something. What am I doing wrong? Has anyone a solution? Thanks.

Paul Iliano
Wednesday, January 29, 2003

H1, H2, H3, H4, H5, H6
{
  font-size: 12pt;
  font-weight: bold;
}

You need to use ":" not "=". BTW, point sizes aren't recommended for non-print (or projection) media. Better to use exact pixels or "small", "medium", "large", etc.

I just used some stuff from ALA to update my site so that (most) of it prints nicely by having a separate stylesheet for printed media.

-austin

Austin Ziegler
Wednesday, January 29, 2003

Austin: I tried your tip but same result.
I suppose the html in CD after pasting from Word gives away the problem:
<H2 style="MARGIN: 0in 0in 12pt"><FONT face=Verdana size=6>Heading 2</FONT></H2>
<P class=MsoNormal style="MARGIN: 0in 0in 12pt"><FONT size=2><FONT face=Verdana>Test.<o:p></o:p></FONT></FONT></P>
<H3 style="MARGIN: 0in 0in 12pt"><FONT face=Verdana size=5>Heading 3</FONT></H3>

In H2 there is a size=6 statement, in H3 size=5, and that's what they become in the finished pages, whatever the stylesheet says.

Paul Iliano
Wednesday, January 29, 2003

Austin Ziegler wrote:  "point sizes aren't recommended for non-print (or projection) media. Better to use exact pixels or 'small', 'medium', 'large', etc."

Hmmm, I always thought that "em" units were the best.  At least, that's the way I always encode font sizes.  Is that not a good practice?

Alex Chernavsky
Wednesday, January 29, 2003

When I past directly from "Word" I always get boatloads of inline style tags like this:

<span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family: &quot;Times New Roman&quot;;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA">

These may be taking priority over your style tages.  It drives me nuts.  I ususally wash my Word pasting through Notepad to get rid of all that junk.  That's not a great help with what you are trying to do.

I've tried "Microsoft Office HTML Filter 2.0" but it either does too much or too little filtering for what I'm trying to accomplish.

tk
Wednesday, January 29, 2003

I think there is another word filter that isn't from microsoft that takes out all except vanilla html.

Alternatively, you can use Tidy which will strip lots of things and has lots of options.  I think it takes a bit of time to figure it out.

Tidy has been mentioned here before, so there may be some references at TK's tips site.

When you strip your code down, put your css markup in your template -- or in a file that is referenced from your template.

Joel Goldstick
Wednesday, January 29, 2003

http://songhaysystem.com/document.php?cmd=getDocCode&get=WD2KHTMLConversion

Here is the app I was referring to above

Joel Goldstick
Wednesday, January 29, 2003

[Alex: Hmmm, I always thought that "em" units were the best.  At least, that's the way I always encode font sizes.  Is that not a good practice?]

Well, it's actually kinda funny to use "em" units for font sizes, since it's based on the size of an "m" in the current font ...

I used to use point sizes, but after reading stuff from Eric Meyer, Zeldman, and others, I switched to using named sizes for fonts in CSS. The problem with point sizes is that 72 points in print (and on the Mac) is one inch whereas 96 points (pixels) in most screens is one inch.

-austin

Austin Ziegler
Wednesday, January 29, 2003

check out http://discuss.fogcreek.com/citydesk/default.asp?cmd=show&ixPost=4202&ixReplies=6 for a few additional suggestions

Adriaan van den Brand
Sunday, February 02, 2003

www.orbit.org

Download BK ReplacEm.

It's a regular expression tool that does search & replace. The good thing about it is that you can set up any number of search/replace strings & keep them for later use.

I used to use it all the time at work to "wash" documents we got for web use.

www.marktaw.com
Sunday, February 02, 2003

*  Recent Topics

*  Fog Creek Home