emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] centering text in html


From: Christian Moe
Subject: Re: [Orgmode] centering text in html
Date: Mon, 11 Oct 2010 19:02:26 +0200
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

Hi,

Of the two non-working examples, one is due to what I think is slightly buggy behavior by Org where =#+HTML:= lines are followed immediately by a line of text. The other should work fine.

* With =<p>= and inline CSS

#+HTML: <p style="text-align: center;">
{ [[file:index.org][Home]] | [[file:files.org][Announcements and Files]] }
#+HTML: </p>

doesn't work because it results in

#+begin_src html
<p style="text-align: center;">
<p>
{ <a href="index.html">Home</a> | <a href="files.html">Announcements and Files</a> }
</p>

</p></div>
#+end_src

A new =<p>...</p>= is added at the line breaks. A =<p>= element isn't supposed to contain another =<p>= element, so it won't work.

I think this is undesirable, perhaps a bug; only text blocks delimited by blank lines should be considered paragraphs and exported as =<p>=.

* With =<div>= and class

#+HTML: <DIV CLASS="centeralign">
{ [[file:index.org][Home]] | [[file:files.org][Announcements and Files]] }
#+HTML: </div>

This should work, supposing you write CSS for it, e.g. by adding this to your header:

: #+STYLE: <style>.centeralign {text-align: center}</style>

There is no =centeralign= class in the default stylesheet, so you
can't expect it to work out of the box.





On 10/11/10 5:21 PM, Vinh Nguyen wrote:
On Mon, Oct 11, 2010 at 12:41 AM, Carsten Dominik
<address@hidden>  wrote:
You give us *very* little to chew on.

Sorry about this.  I meant to elicit on what folks do when they want
to center text I general.  I should've known better to put down what
I've tried.  I just got it working but will also put down what I tried
to let others know what did not work.

How about:

- what have you tried?

#+HTML:<p style="text-align: center;">
{ [[file:index.org][Home]] | [[file:files.org][Announcements and Files]] }
#+HTML:</p>

and

#+HTML:<DIV CLASS="centeralign">
{ [[file:index.org][Home]] | [[file:files.org][Announcements and Files]] }
#+HTML:</div>


- an example HTML code that would do the right thing


THIS WORKED:
#+HTML:<div align=center>
{ [[file:index.org][Home]] | [[file:files.org][Announcements and Files]] }
#+HTML:</div>


etc etc etc.  If you want people to help you solve a problem,
please do your part by giving them *as much as possible* information.

- Carsten

-- Vinh

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



--

Christian Moe
E-mail:  address@hidden
Website: http://christianmoe.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]