This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > September 2005 > stylesheet for bibliography





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author stylesheet for bibliography
raykyoto@gmail.com

2005-09-16, 7:45 pm

Hi all,

I must be re-inventing the wheel, but I can't seem to find a stylesheet
for bibliographies. I'm probably inputting the wrong keywords into
Google... Well, I gave up searching and since I needed an excuse to
try to learn CSS anyway, I gave it a try. But, I'm stuck with one
thing.

With the book and the help pages I've read so far, all of the examples
have to do with making text within a set of tags colored, italics, etc.
Is it possible to use a stylesheet to ADD text? For example:

<atitle>This is some title</atitle>

to become

"This is some title".

Or is the only way to do this is to explicitly put punctuation marks
inside. As in:

<atitle>"This is some title".</atitle>

I would like a style sheet to do it because every title will be
enclosed in quotation marks and end in a period. Is this considered a
"style"?

Thank you in advance!

Ray

Rincewind

2005-09-16, 7:45 pm

On 16 Sep 2005 08:08:13 -0700, raykyoto@XXXXXXXXXX wrote:

> Hi all,
>
> I must be re-inventing the wheel, but I can't seem to find a stylesheet
> for bibliographies. I'm probably inputting the wrong keywords into
> Google... Well, I gave up searching and since I needed an excuse to
> try to learn CSS anyway, I gave it a try. But, I'm stuck with one
> thing.
>
> With the book and the help pages I've read so far, all of the examples
> have to do with making text within a set of tags colored, italics, etc.
> Is it possible to use a stylesheet to ADD text? For example:
>
> <atitle>This is some title</atitle>
>
> to become
>
> "This is some title".
>
> Or is the only way to do this is to explicitly put punctuation marks
> inside. As in:
>
> <atitle>"This is some title".</atitle>
>
> I would like a style sheet to do it because every title will be
> enclosed in quotation marks and end in a period. Is this considered a
> "style"?
>
> Thank you in advance!
>
> Ray


I don't think you can do this with CSS, it seems more the sort of thing to
be done via a scripting language like PHP where it would be very easy.

Or as you say "explicitly put punctuation marks inside". Easy but time
consuming if you have a lot of records.
Martin Geisler

2005-09-17, 11:26 pm

Robi

2005-09-17, 11:26 pm


"Martin Geisler" <mgeisler@mgeisler.net> wrote in message news:87psr8gek4.fsf@futtelifut.dyndns.org...
> On 16 Sep 2005 08:08:13 -0700, raykyoto@XXXXXXXXXX wrote:
>
> You cannot invent new elements like that --- you have to stick with
> the elements defined by (X)HTML.


well, actually you can, but they won't be necessarily rendered by agents ;-)
http://www.cs.tut.fi/~jkorpela/html/own-dtd.html

> But you can write
>
> <p class="title">This is some title</p>
>
> to mark a paragraph as being a title with regard to the CSS rules you
> write. To have quotation marks added automatically use the :before
> and :after pseudo-classes together with the content property:
>
> http://www.w3.org/TR/CSS21/generate.html#content
>
> A stylesheet like this would work in your case:
>
> p.title:before {
> content: "“";

^^^ que???
> }
>
> p.title:after {
> content: ".”";

^^^ huh???
> }
>
> It works in some modern browsers, such as Firefox.


what's that in the before/after content? (after the period)

raykyoto@gmail.com

2005-09-19, 7:29 pm

Hi,

Lauri Raittila wrote:
> in comp.infosystems.www.authoring.stylesheets, raykyoto@XXXXXXXXXX wrote:
> Unless I am mistaken, it shoudl not work, you need to escape " or use
> curly one in right encoding. If you did escape those quotes, then it
> should work on Opera 6+ as well, but not in IE. (URL would be much more
> useful than code here...)


Ah! Sorry, but I'm just playing around locally on my home computer. I
haven't gotten as far as actually putting it on-line. I probably won't
go that far...feels like PHP is the right way to go.

> Yes, you could also change your own XML to (x)html in process.


Another reason to go the PHP route... Thank you all for your help! :)

Ray

Martin Geisler

2005-09-21, 7:34 pm

raykyoto@gmail.com

2005-09-21, 7:34 pm

Hi all,

Thank you for your replies! Adding that to the p tag wasn't what I had
in mind, but I did give it a try and it seemed to work. I then played
around and tried this:

atitle:before {
content: """;
}

atitle:after {
content: "."";
}

This worked...in Firefox...but I presume it isn't supported by other
browsers? I was trying to replicate something like what LaTeX's bibtex
does (or even Endnote). But, perhaps Rincewind has a better
idea...that is to use php. Perhaps keeping my bibliography entries in
a flat file and letting PHP loop through it might be a better idea...

Thank you for your help!

Ray

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews