emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Changing the font family in HTML export
@ 2011-06-28  7:18 Dror Atariah
  2011-06-28  8:19 ` Manuel Giraud
  2011-06-28  9:58 ` Bastien
  0 siblings, 2 replies; 8+ messages in thread
From: Dror Atariah @ 2011-06-28  7:18 UTC (permalink / raw)
  To: emacs-orgmode

Dear org mode users,

I'm trying to change the font used when exporting .org to .html. At the moment, I get 
"
<style type="text/css">
 <!--/*--><![CDATA[/*><!--*/
  html { font-family: Times, serif; font-size: 12pt; }
"
In the generated .html file. I would like to control this part, namely, I would like to have for example:
"
<style type="text/css">
 <!--/*--><![CDATA[/*><!--*/
  html { font-family: Helvatica, sans-serif; font-size: 12pt; }
"
Instead. I found several hints, but my emacs skill failed me, and I couldn't find a solution.

Can you help me? Thanks in advance,
Dror

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28  7:18 Changing the font family in HTML export Dror Atariah
@ 2011-06-28  8:19 ` Manuel Giraud
       [not found]   ` <508A016C-064F-48B4-9C56-294D980EB4E6@gmail.com>
  2011-06-28  9:58 ` Bastien
  1 sibling, 1 reply; 8+ messages in thread
From: Manuel Giraud @ 2011-06-28  8:19 UTC (permalink / raw)
  To: Dror Atariah; +Cc: emacs-orgmode

Dror Atariah <drorata@gmail.com> writes:

> Can you help me? Thanks in advance,

I think you could use an external css file for that. You can do so by
setting the STYLE property in you org file like that:

--8<---------------cut here---------------start------------->8---
#+TITLE: My page
#+STYLE: <link rel="stylesheet" href="my_own.css" type="text/css"/>

* My first title
--8<---------------cut here---------------end--------------->8---

Best regards,
-- 
Manuel Giraud

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
       [not found]     ` <87r56egxdj.fsf@univ-nantes.fr>
@ 2011-06-28  9:00       ` Dror Atariah
  2011-06-28  9:18         ` Pieter Praet
  2011-06-28 12:10         ` Christian Moe
  0 siblings, 2 replies; 8+ messages in thread
From: Dror Atariah @ 2011-06-28  9:00 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: emacs-orgmode

This solved the problem. However, as you pointed out, in case I want to publish/share this generated html, I have to send as well another file, and it is not longer self contained. In the automatically, generated html, there is a section at the beginning:
--==--
<style type="text/css">
 <!--/*--><![CDATA[/*><!--*/
  html { font-family: Times, serif; font-size: 12pt; }
  .title  { text-align: center; }
  .todo   { color: red; }
  .done   { color: green; }
  .tag    { background-color: #add8e6; font-weight:normal }
...
--==--

Isn't there a way to tell orgmode to change this part, and, for example, use a different font?

On Jun 28, 2011, at 10:42 AM, Manuel Giraud wrote:

> Dror Atariah <drorata@gmail.com> writes:
> 
>> Thanks for the quick answer!
>>> I think you could use an external css file for that. You can do so by
>>> setting the STYLE property in you org file like that:
>>> 
>>> --8<---------------cut here---------------start------------->8---
>>> #+TITLE: My page
>>> #+STYLE: <link rel="stylesheet" href="my_own.css" type="text/css"/>
>>> 
>>> * My first title
>>> --8<---------------cut here---------------end--------------->8---
>> This means that I have to generate and put "my_own.css" file in the
>> right place. 
> 
> Yes. But I don't know how you publish things after having generated the
> html. You may just have to copy this file in the right place once.
> 
> 
>> What should this file contain? 
> 
> It's a css file it could contain many things (see
> http://www.w3schools.com/css/ for good tutorials and test). But in your
> case this will do the trick:
> 
> --8<---------------cut here---------------start------------->8---
> html { font-family: Helvetica, sans-serif; font-size: 12pt; }
> --8<---------------cut here---------------end--------------->8---
> 
> 
>> I'm happy with the formatting of the exported html, I only want to
>> change the font. Is this still the right approach?
> 
> I still think it is the best option because one day you'd like to change
> the color of h1's title and this approach still stand (in fact that's
> what css are for).
> 
> Best regards,
> -- 
> Manuel Giraud

Dror Atariah
---------------------------------------------------------------
Landline:        +49-30-43024501
Mobile:         +49-176-67116376
Mobile (in IL): +972 54 5912389
IM:  		      drorata@gmail.com
		   drorata@hotmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28  9:00       ` Dror Atariah
@ 2011-06-28  9:18         ` Pieter Praet
  2011-06-28  9:59           ` Pieter Praet
  2011-06-28 12:10         ` Christian Moe
  1 sibling, 1 reply; 8+ messages in thread
From: Pieter Praet @ 2011-06-28  9:18 UTC (permalink / raw)
  To: Dror Atariah, Manuel Giraud; +Cc: emacs-orgmode

On Tue, 28 Jun 2011 11:00:43 +0200, Dror Atariah <drorata@gmail.com> wrote:
> This solved the problem. However, as you pointed out, in case I want to publish/share this generated html, I have to send as well another file, and it is not longer self contained. In the automatically, generated html, there is a section at the beginning:
> --==--
> <style type="text/css">
>  <!--/*--><![CDATA[/*><!--*/
>   html { font-family: Times, serif; font-size: 12pt; }
>   .title  { text-align: center; }
>   .todo   { color: red; }
>   .done   { color: green; }
>   .tag    { background-color: #add8e6; font-weight:normal }
> ...
> --==--
> 
> Isn't there a way to tell orgmode to change this part, and, for example, use a different font?

This is hardcoded @ org-html.el:122.

You can change this manually, but keep in mind that in order to make it
stick, you'll need to run "make it stick" (sans the "it stick").

For more info, see http://orgmode.org/worg/org-faq.html#sec-3_3


Also, word of advice: this is a public mailing list, so it might not be
such a fantastic idea to divulge everything apart from your shoe size
and favourite colour in your signature.


> On Jun 28, 2011, at 10:42 AM, Manuel Giraud wrote:
> 
> > Dror Atariah <drorata@gmail.com> writes:
> > 
> >> Thanks for the quick answer!
> >>> I think you could use an external css file for that. You can do so by
> >>> setting the STYLE property in you org file like that:
> >>> 
> >>> --8<---------------cut here---------------start------------->8---
> >>> #+TITLE: My page
> >>> #+STYLE: <link rel="stylesheet" href="my_own.css" type="text/css"/>
> >>> 
> >>> * My first title
> >>> --8<---------------cut here---------------end--------------->8---
> >> This means that I have to generate and put "my_own.css" file in the
> >> right place. 
> > 
> > Yes. But I don't know how you publish things after having generated the
> > html. You may just have to copy this file in the right place once.
> > 
> > 
> >> What should this file contain? 
> > 
> > It's a css file it could contain many things (see
> > http://www.w3schools.com/css/ for good tutorials and test). But in your
> > case this will do the trick:
> > 
> > --8<---------------cut here---------------start------------->8---
> > html { font-family: Helvetica, sans-serif; font-size: 12pt; }
> > --8<---------------cut here---------------end--------------->8---
> > 
> > 
> >> I'm happy with the formatting of the exported html, I only want to
> >> change the font. Is this still the right approach?
> > 
> > I still think it is the best option because one day you'd like to change
> > the color of h1's title and this approach still stand (in fact that's
> > what css are for).
> > 
> > Best regards,
> > -- 
> > Manuel Giraud
> 
> Dror Atariah
> ---------------------------------------------------------------
> Landline:        +49-30-43024501
> Mobile:         +49-176-67116376
> Mobile (in IL): +972 54 5912389
> IM:  		      drorata@gmail.com
> 		   drorata@hotmail.com
> 
> 


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28  7:18 Changing the font family in HTML export Dror Atariah
  2011-06-28  8:19 ` Manuel Giraud
@ 2011-06-28  9:58 ` Bastien
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2011-06-28  9:58 UTC (permalink / raw)
  To: Dror Atariah; +Cc: emacs-orgmode

Dror Atariah <drorata@gmail.com> writes:

> I'm trying to change the font used when exporting .org to .html. 

(setq org-export-html-style-include-default nil)

(setq org-export-html-style ...)

HTH

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28  9:18         ` Pieter Praet
@ 2011-06-28  9:59           ` Pieter Praet
  0 siblings, 0 replies; 8+ messages in thread
From: Pieter Praet @ 2011-06-28  9:59 UTC (permalink / raw)
  To: Dror Atariah, Manuel Giraud; +Cc: emacs-orgmode

On Tue, 28 Jun 2011 11:18:58 +0200, Pieter Praet <pieter@praet.org> wrote:
> On Tue, 28 Jun 2011 11:00:43 +0200, Dror Atariah <drorata@gmail.com> wrote:
> > This solved the problem. However, as you pointed out, in case I want to publish/share this generated html, I have to send as well another file, and it is not longer self contained. In the automatically, generated html, there is a section at the beginning:
> > --==--
> > <style type="text/css">
> >  <!--/*--><![CDATA[/*><!--*/
> >   html { font-family: Times, serif; font-size: 12pt; }
> >   .title  { text-align: center; }
> >   .todo   { color: red; }
> >   .done   { color: green; }
> >   .tag    { background-color: #add8e6; font-weight:normal }
> > ...
> > --==--
> > 
> > Isn't there a way to tell orgmode to change this part, and, for example, use a different font?
> 
> This is hardcoded @ org-html.el:122.
> 
> You can change this manually, but keep in mind that in order to make it
> stick, you'll need to run "make it stick" (sans the "it stick").
> 
> For more info, see http://orgmode.org/worg/org-faq.html#sec-3_3
> 
> 
> Also, word of advice: this is a public mailing list, so it might not be
> such a fantastic idea to divulge everything apart from your shoe size
> and favourite colour in your signature.
> 
> 
> > On Jun 28, 2011, at 10:42 AM, Manuel Giraud wrote:
> > 
> > > Dror Atariah <drorata@gmail.com> writes:
> > > 
> > >> Thanks for the quick answer!
> > >>> I think you could use an external css file for that. You can do so by
> > >>> setting the STYLE property in you org file like that:
> > >>> 
> > >>> --8<---------------cut here---------------start------------->8---
> > >>> #+TITLE: My page
> > >>> #+STYLE: <link rel="stylesheet" href="my_own.css" type="text/css"/>
> > >>> 
> > >>> * My first title
> > >>> --8<---------------cut here---------------end--------------->8---
> > >> This means that I have to generate and put "my_own.css" file in the
> > >> right place. 
> > > 
> > > Yes. But I don't know how you publish things after having generated the
> > > html. You may just have to copy this file in the right place once.
> > > 
> > > 
> > >> What should this file contain? 
> > > 
> > > It's a css file it could contain many things (see
> > > http://www.w3schools.com/css/ for good tutorials and test). But in your
> > > case this will do the trick:
> > > 
> > > --8<---------------cut here---------------start------------->8---
> > > html { font-family: Helvetica, sans-serif; font-size: 12pt; }
> > > --8<---------------cut here---------------end--------------->8---
> > > 
> > > 
> > >> I'm happy with the formatting of the exported html, I only want to
> > >> change the font. Is this still the right approach?
> > > 
> > > I still think it is the best option because one day you'd like to change
> > > the color of h1's title and this approach still stand (in fact that's
> > > what css are for).
> > > 
> > > Best regards,
> > > -- 
> > > Manuel Giraud
> > 
> > Dror Atariah
> > ---------------------------------------------------------------
> > Landline:        +49-30-43024501
> > Mobile:         +49-176-67116376
> > Mobile (in IL): +972 54 5912389
> > IM:  		      drorata@gmail.com
> > 		   drorata@hotmail.com
> > 
> > 
> 
> 
> Peace
> 
> -- 
> Pieter

For posterity's sake:

The following is part of my response to an off-list
reply from Dror Atariah.

Didn't bother to ask permission for full inclusion,
so I've cut everything but the relevant part.

>> [SNIP]
>>
>>   It appears I've spoken a bit too soon:
>>
>>   Customizing the variables:
>>   - `org-export-html-style'
>>   - `org-export-html-style-extra'
>>   - `org-export-html-style-include-default'
>>   should suffice to do your bidding.
>>
>>   See org-html.el:163-167.
>>
>>   Don't let this keep you from reading the provided link though,
>>   it'll come in handy sooner rather than later.
>>
>> [SNIP]


Peace

-- 
Pieter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28  9:00       ` Dror Atariah
  2011-06-28  9:18         ` Pieter Praet
@ 2011-06-28 12:10         ` Christian Moe
  2011-06-28 13:01           ` Dror Atariah
  1 sibling, 1 reply; 8+ messages in thread
From: Christian Moe @ 2011-06-28 12:10 UTC (permalink / raw)
  To: Dror Atariah; +Cc: emacs-orgmode, Manuel Giraud

Hi,

The tips you have received from others about customizing various 
variables are likely to be what you want (will work for all your 
documents). But for completeness' sake: to change things on a 
file-by-file basis, you can do it Manuel's way, but without an 
external stylesheet, like this:

#+STYLE:<style>html { font-family: Helvetica, sans-serif; font-size: 
12pt; }</style>

Your custom CSS is included in the HEAD of the generated document, 
after the default CSS, which it overrides.

Yours,
Christian

On 6/28/11 11:00 AM, Dror Atariah wrote:
> This solved the problem. However, as you pointed out, in case I want to publish/share this generated html, I have to send as well another file, and it is not longer self contained. In the automatically, generated html, there is a section at the beginning:
> --==--
> <style type="text/css">
>   <!--/*--><![CDATA[/*><!--*/
>    html { font-family: Times, serif; font-size: 12pt; }
>    .title  { text-align: center; }
>    .todo   { color: red; }
>    .done   { color: green; }
>    .tag    { background-color: #add8e6; font-weight:normal }
> ...
> --==--
>
> Isn't there a way to tell orgmode to change this part, and, for example, use a different font?
>
> On Jun 28, 2011, at 10:42 AM, Manuel Giraud wrote:
>
>> Dror Atariah<drorata@gmail.com>  writes:
>>
>>> Thanks for the quick answer!
>>>> I think you could use an external css file for that. You can do so by
>>>> setting the STYLE property in you org file like that:
>>>>
>>>> --8<---------------cut here---------------start------------->8---
>>>> #+TITLE: My page
>>>> #+STYLE:<link rel="stylesheet" href="my_own.css" type="text/css"/>
>>>>
>>>> * My first title
>>>> --8<---------------cut here---------------end--------------->8---
>>> This means that I have to generate and put "my_own.css" file in the
>>> right place.
>>
>> Yes. But I don't know how you publish things after having generated the
>> html. You may just have to copy this file in the right place once.
>>
>>
>>> What should this file contain?
>>
>> It's a css file it could contain many things (see
>> http://www.w3schools.com/css/ for good tutorials and test). But in your
>> case this will do the trick:
>>
>> --8<---------------cut here---------------start------------->8---
>> html { font-family: Helvetica, sans-serif; font-size: 12pt; }
>> --8<---------------cut here---------------end--------------->8---
>>
>>
>>> I'm happy with the formatting of the exported html, I only want to
>>> change the font. Is this still the right approach?
>>
>> I still think it is the best option because one day you'd like to change
>> the color of h1's title and this approach still stand (in fact that's
>> what css are for).
>>
>> Best regards,
>> --
>> Manuel Giraud
>
> Dror Atariah
> ---------------------------------------------------------------
> Landline:        +49-30-43024501
> Mobile:         +49-176-67116376
> Mobile (in IL): +972 54 5912389
> IM:  		      drorata@gmail.com
> 		   drorata@hotmail.com
>
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Changing the font family in HTML export
  2011-06-28 12:10         ` Christian Moe
@ 2011-06-28 13:01           ` Dror Atariah
  0 siblings, 0 replies; 8+ messages in thread
From: Dror Atariah @ 2011-06-28 13:01 UTC (permalink / raw)
  To: mail; +Cc: emacs-orgmode, Manuel Giraud


On Jun 28, 2011, at 14:10 PM, Christian Moe wrote:

> Hi,
> 
> The tips you have received from others about customizing various variables are likely to be what you want (will work for all your documents). But for completeness' sake: to change things on a file-by-file basis, you can do it Manuel's way, but without an external stylesheet, like this:
> 
> #+STYLE:<style>html { font-family: Helvetica, sans-serif; font-size: 12pt; }</style>
> 
> Your custom CSS is included in the HEAD of the generated document, after the default CSS, which it overrides.
This was most helpful actually! Thanks!
> 
> Yours,
> Christian
> 
> On 6/28/11 11:00 AM, Dror Atariah wrote:
>> This solved the problem. However, as you pointed out, in case I want to publish/share this generated html, I have to send as well another file, and it is not longer self contained. In the automatically, generated html, there is a section at the beginning:
>> --==--
>> <style type="text/css">
>>  <!--/*--><![CDATA[/*><!--*/
>>   html { font-family: Times, serif; font-size: 12pt; }
>>   .title  { text-align: center; }
>>   .todo   { color: red; }
>>   .done   { color: green; }
>>   .tag    { background-color: #add8e6; font-weight:normal }
>> ...
>> --==--
>> 
>> Isn't there a way to tell orgmode to change this part, and, for example, use a different font?
>> 
>> On Jun 28, 2011, at 10:42 AM, Manuel Giraud wrote:
>> 
>>> Dror Atariah<drorata@gmail.com>  writes:
>>> 
>>>> Thanks for the quick answer!
>>>>> I think you could use an external css file for that. You can do so by
>>>>> setting the STYLE property in you org file like that:
>>>>> 
>>>>> --8<---------------cut here---------------start------------->8---
>>>>> #+TITLE: My page
>>>>> #+STYLE:<link rel="stylesheet" href="my_own.css" type="text/css"/>
>>>>> 
>>>>> * My first title
>>>>> --8<---------------cut here---------------end--------------->8---
>>>> This means that I have to generate and put "my_own.css" file in the
>>>> right place.
>>> 
>>> Yes. But I don't know how you publish things after having generated the
>>> html. You may just have to copy this file in the right place once.
>>> 
>>> 
>>>> What should this file contain?
>>> 
>>> It's a css file it could contain many things (see
>>> http://www.w3schools.com/css/ for good tutorials and test). But in your
>>> case this will do the trick:
>>> 
>>> --8<---------------cut here---------------start------------->8---
>>> html { font-family: Helvetica, sans-serif; font-size: 12pt; }
>>> --8<---------------cut here---------------end--------------->8---
>>> 
>>> 
>>>> I'm happy with the formatting of the exported html, I only want to
>>>> change the font. Is this still the right approach?
>>> 
>>> I still think it is the best option because one day you'd like to change
>>> the color of h1's title and this approach still stand (in fact that's
>>> what css are for).
>>> 
>>> Best regards,
>>> --
>>> Manuel Giraud

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-28 13:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28  7:18 Changing the font family in HTML export Dror Atariah
2011-06-28  8:19 ` Manuel Giraud
     [not found]   ` <508A016C-064F-48B4-9C56-294D980EB4E6@gmail.com>
     [not found]     ` <87r56egxdj.fsf@univ-nantes.fr>
2011-06-28  9:00       ` Dror Atariah
2011-06-28  9:18         ` Pieter Praet
2011-06-28  9:59           ` Pieter Praet
2011-06-28 12:10         ` Christian Moe
2011-06-28 13:01           ` Dror Atariah
2011-06-28  9:58 ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).