emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
@ 2009-09-26 11:36 Tim Burt
  2009-09-28 20:10 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Tim Burt @ 2009-09-26 11:36 UTC (permalink / raw)
  To: emacs-orgmode


In another thread there was a discussion about replacing the
use of fullpage.sty with its functionality.
 NickD> Looks like the culprit is fullpage.sty - seems to be required
 NickD> by the LaTeX code that org-preview-latex-fragment generates.

 CarstenD> I believe the reason that this is used it to make sure that
 CarstenD> wide formulas can still be formatted reasonably well,
 CarstenD> without additional line breaks.  I guess we could inline
 CarstenD> the content of this small package.
 CarstenD> 
 CarstenD> Would somebody like to try to replace this with just the
 CarstenD> margin setting commands of fullpage.sty?
With continued thanks to Patrick Daly, the author of fullpage.sty and
my favorite LaTeX book "A Guide to LaTeX2e", I put the margin and text
size settings accomplished by fullpage.sty in org-format-latex-header
of org.el.
  Org-mode version 6.30trans (release_6.30d.882.gdbd63.dirty)
The diff below is offered as a step towards inlining the
functionality.  

The caveats:
 1. This is untested
    - When I execute org-export-as-pdf some other header appears in
      the .tex file, and I have not yet discovered the source of this
      other header.   
 2. This is the first time I've done a git diff.

If there are troubles in testing I will be happy to help resolve.  

Good morning,
Tim

Output of git diff org.el:
diff --git a/lisp/org.el b/lisp/org.el
index 89d3bc8..8772968 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2678,13 +2678,24 @@ This is a property list with the following properties:
   :type 'plist)
 
 (defcustom org-format-latex-header "\\documentclass{article}
-\\usepackage{fullpage}         % do not remove
 \\usepackage{amssymb}
 \\usepackage[usenames]{color}
 \\usepackage{amsmath}
 \\usepackage{latexsym}
 \\usepackage[mathscr]{eucal}
-\\pagestyle{empty}             % do not remove"
+\\pagestyle{empty}             % do not remove
+\\setlength{\\textwidth}{\\paperwidth}
+\\addtolength{\\textwidth}{-3cm}
+\\setlength{\\oddsidemargin}{1.5cm}
+\\addtolength{\\oddsidemargin}{-2.54cm}
+\\setlength{\\evensidemargin}{\\oddsidemargin}
+\\setlength{\\textheight}{\\paperheight}
+\\addtolength{\\textheight}{-\\headheight}
+\\addtolength{\\textheight}{-\\headsep}
+\\addtolength{\\textheight}{-\\footskip}
+\\addtolength{\\textheight}{-3cm}
+\\setlength{\\topmargin}{1.5cm}
+\\addtolength{\\topmargin}{-2.54cm}"
   "The document header used for processing LaTeX fragments."
   :group 'org-latex
   :type 'string)

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-26 11:36 fullpage.sty replacement [WAS: Problem with LaTeX snippets preview] Tim Burt
@ 2009-09-28 20:10 ` Carsten Dominik
  2009-09-28 23:46   ` Tim Burt
  2009-09-29  6:48   ` Nick Dokos
  0 siblings, 2 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-09-28 20:10 UTC (permalink / raw)
  To: tcburt; +Cc: emacs-orgmode

Hi Tim,

I have applied your patch, thanks.

The header for the LaTeX files used to produce PDF export independent
from this.  The stuff here is only used to create small images that
will be displayed in Emacs or used in HTML export.

- Carsten

On Sep 26, 2009, at 12:36 PM, Tim Burt wrote:

>
> In another thread there was a discussion about replacing the
> use of fullpage.sty with its functionality.
> NickD> Looks like the culprit is fullpage.sty - seems to be required
> NickD> by the LaTeX code that org-preview-latex-fragment generates.
>
> CarstenD> I believe the reason that this is used it to make sure that
> CarstenD> wide formulas can still be formatted reasonably well,
> CarstenD> without additional line breaks.  I guess we could inline
> CarstenD> the content of this small package.
> CarstenD>
> CarstenD> Would somebody like to try to replace this with just the
> CarstenD> margin setting commands of fullpage.sty?
> With continued thanks to Patrick Daly, the author of fullpage.sty and
> my favorite LaTeX book "A Guide to LaTeX2e", I put the margin and text
> size settings accomplished by fullpage.sty in org-format-latex-header
> of org.el.
> Org-mode version 6.30trans (release_6.30d.882.gdbd63.dirty)
> The diff below is offered as a step towards inlining the
> functionality.
>
> The caveats:
> 1. This is untested
>   - When I execute org-export-as-pdf some other header appears in
>     the .tex file, and I have not yet discovered the source of this
>     other header.
> 2. This is the first time I've done a git diff.
>
> If there are troubles in testing I will be happy to help resolve.
>
> Good morning,
> Tim
>
> Output of git diff org.el:
> diff --git a/lisp/org.el b/lisp/org.el
> index 89d3bc8..8772968 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -2678,13 +2678,24 @@ This is a property list with the following  
> properties:
>  :type 'plist)
>
> (defcustom org-format-latex-header "\\documentclass{article}
> -\\usepackage{fullpage}         % do not remove
> \\usepackage{amssymb}
> \\usepackage[usenames]{color}
> \\usepackage{amsmath}
> \\usepackage{latexsym}
> \\usepackage[mathscr]{eucal}
> -\\pagestyle{empty}             % do not remove"
> +\\pagestyle{empty}             % do not remove
> +\\setlength{\\textwidth}{\\paperwidth}
> +\\addtolength{\\textwidth}{-3cm}
> +\\setlength{\\oddsidemargin}{1.5cm}
> +\\addtolength{\\oddsidemargin}{-2.54cm}
> +\\setlength{\\evensidemargin}{\\oddsidemargin}
> +\\setlength{\\textheight}{\\paperheight}
> +\\addtolength{\\textheight}{-\\headheight}
> +\\addtolength{\\textheight}{-\\headsep}
> +\\addtolength{\\textheight}{-\\footskip}
> +\\addtolength{\\textheight}{-3cm}
> +\\setlength{\\topmargin}{1.5cm}
> +\\addtolength{\\topmargin}{-2.54cm}"
>  "The document header used for processing LaTeX fragments."
>  :group 'org-latex
>  :type 'string)
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-28 20:10 ` Carsten Dominik
@ 2009-09-28 23:46   ` Tim Burt
  2009-09-29  6:48   ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: Tim Burt @ 2009-09-28 23:46 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten ---

Ah, I see.  I had not become one with the thread to see that this was
not used for documents.  Now I get to learn something new.  It's a
good day.

Good evening,
Tim

Carsten Dominik writes:
 > Hi Tim,
 > 
 > I have applied your patch, thanks.
 > 
 > The header for the LaTeX files used to produce PDF export independent
 > from this.  The stuff here is only used to create small images that
 > will be displayed in Emacs or used in HTML export.
 > 
 > - Carsten
 > 
 > On Sep 26, 2009, at 12:36 PM, Tim Burt wrote:
 > 
 > >
 > > In another thread there was a discussion about replacing the
 > > use of fullpage.sty with its functionality.
 > > NickD> Looks like the culprit is fullpage.sty - seems to be required
 > > NickD> by the LaTeX code that org-preview-latex-fragment generates.
 > >
 > > CarstenD> I believe the reason that this is used it to make sure that
 > > CarstenD> wide formulas can still be formatted reasonably well,
 > > CarstenD> without additional line breaks.  I guess we could inline
 > > CarstenD> the content of this small package.
 > > CarstenD>
 > > CarstenD> Would somebody like to try to replace this with just the
 > > CarstenD> margin setting commands of fullpage.sty?
 > > With continued thanks to Patrick Daly, the author of fullpage.sty and
 > > my favorite LaTeX book "A Guide to LaTeX2e", I put the margin and text
 > > size settings accomplished by fullpage.sty in org-format-latex-header
 > > of org.el.
 > > Org-mode version 6.30trans (release_6.30d.882.gdbd63.dirty)
 > > The diff below is offered as a step towards inlining the
 > > functionality.
 > >
 > > The caveats:
 > > 1. This is untested
 > >   - When I execute org-export-as-pdf some other header appears in
 > >     the .tex file, and I have not yet discovered the source of this
 > >     other header.
 > > 2. This is the first time I've done a git diff.
 > >
 > > If there are troubles in testing I will be happy to help resolve.
 > >
 > > Good morning,
 > > Tim
 > >
 > > Output of git diff org.el:
 > > diff --git a/lisp/org.el b/lisp/org.el
 > > index 89d3bc8..8772968 100644
 > > --- a/lisp/org.el
 > > +++ b/lisp/org.el
 > > @@ -2678,13 +2678,24 @@ This is a property list with the following  
 > > properties:
 > >  :type 'plist)
 > >
 > > (defcustom org-format-latex-header "\\documentclass{article}
 > > -\\usepackage{fullpage}         % do not remove
 > > \\usepackage{amssymb}
 > > \\usepackage[usenames]{color}
 > > \\usepackage{amsmath}
 > > \\usepackage{latexsym}
 > > \\usepackage[mathscr]{eucal}
 > > -\\pagestyle{empty}             % do not remove"
 > > +\\pagestyle{empty}             % do not remove
 > > +\\setlength{\\textwidth}{\\paperwidth}
 > > +\\addtolength{\\textwidth}{-3cm}
 > > +\\setlength{\\oddsidemargin}{1.5cm}
 > > +\\addtolength{\\oddsidemargin}{-2.54cm}
 > > +\\setlength{\\evensidemargin}{\\oddsidemargin}
 > > +\\setlength{\\textheight}{\\paperheight}
 > > +\\addtolength{\\textheight}{-\\headheight}
 > > +\\addtolength{\\textheight}{-\\headsep}
 > > +\\addtolength{\\textheight}{-\\footskip}
 > > +\\addtolength{\\textheight}{-3cm}
 > > +\\setlength{\\topmargin}{1.5cm}
 > > +\\addtolength{\\topmargin}{-2.54cm}"
 > >  "The document header used for processing LaTeX fragments."
 > >  :group 'org-latex
 > >  :type 'string)
 > >
 > >
 > > _______________________________________________
 > > Emacs-orgmode mailing list
 > > Remember: use `Reply All' to send replies to the list.
 > > Emacs-orgmode@gnu.org
 > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
 > 

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-28 20:10 ` Carsten Dominik
  2009-09-28 23:46   ` Tim Burt
@ 2009-09-29  6:48   ` Nick Dokos
  2009-09-29  7:38     ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2009-09-29  6:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

My $0.02: 

Let me point out that a dependency on soul.sty was introduced in order
to deal with strike-through emphasis in the LaTeX exporter. And guess
where soul.sty resides (on Debian/Ubuntu): in the texlive-latex-extra
package. So it seems to me that replacing the use of the fullpage
package by its contents is not the best solution: it would be better to
document the dependency (and other such dependencies). Keeping the
dependency on fullpage.sty would also insulate org-mode from missing
future changes to it - however unlikely that event happens to be.

Also, the main difference between these two is that if soul.sty is not
present, then when you try to process the exported latex file, you get
an explicit error message that fingers the problem exactly, whereas
without fullpage.sty, the preview failed silently. If the latter failure
could be made visible, then the problem would be solved (and this
solution would cover other similar failures as well).

Thoughts?

Thanks,
Nick

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-29  6:48   ` Nick Dokos
@ 2009-09-29  7:38     ` Carsten Dominik
  2009-09-29 17:03       ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-09-29  7:38 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi Nick,

On Sep 29, 2009, at 8:48 AM, Nick Dokos wrote:

> My $0.02:
>
> Let me point out that a dependency on soul.sty was introduced in order
> to deal with strike-through emphasis in the LaTeX exporter. And guess
> where soul.sty resides (on Debian/Ubuntu): in the texlive-latex-extra
> package. So it seems to me that replacing the use of the fullpage
> package by its contents is not the best solution: it would be better  
> to
> document the dependency (and other such dependencies). Keeping the
> dependency on fullpage.sty would also insulate org-mode from missing
> future changes to it - however unlikely that event happens to be.
>
> Also, the main difference between these two is that if soul.sty is not
> present, then when you try to process the exported latex file, you get
> an explicit error message that fingers the problem exactly, whereas
> without fullpage.sty, the preview failed silently. If the latter  
> failure
> could be made visible, then the problem would be solved (and this
> solution would cover other similar failures as well).

These are valid points!

However:

- Fullpage is a trivial ad very small package that only
   changes margins.  Even if it changes at some point, there is no  
reason
   for Org to follow this change.

- I'd like to have few dependencies if possible.

- People who use strike-through faces should know better :-)
   Well, I know there are exceptions where this does make sense.

The bad thing about packages that are in some TeX distros, but not
in others, is that you have to start documenting these dependencies
on a system-by-system basis, and I'd rather not go there, if possible.

If soul.sty is a non-guaranteed dependency, we should document it.   
Where?
Maybe I should make the use of soul.sty dependend on the use of strike- 
through
stuff in the file....

- Carsten

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-29  7:38     ` Carsten Dominik
@ 2009-09-29 17:03       ` Nick Dokos
  2009-09-30  8:27         ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2009-09-29 17:03 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> wrote:

> However:
> 
> - Fullpage is a trivial ad very small package that only
>    changes margins.  Even if it changes at some point, there is no  
> reason
>    for Org to follow this change.

Agreed - it was more "the principle of the thing" rather than this
particular change.

> 
> - I'd like to have few dependencies if possible.
> 

Agreed - but there are going to be dependencies anyway.

> - People who use strike-through faces should know better :-)
>    Well, I know there are exceptions where this does make sense.
> 

Agreed with this too - but soul.sty is included unconditionally
so you get the dependency even if you are on the side of the angels.

> The bad thing about packages that are in some TeX distros, but not
> in others, is that you have to start documenting these dependencies
> on a system-by-system basis, and I'd rather not go there, if possible.
> 

That's why I think we should document it at the level of latex packages:
we can then point people to CTAN as the last resort. A blurb like this
perhaps:

"Your distro may provide a package for this (e.g. on Debian/Ubuntu,
soul.sty is in the package texlive-latex-extra), but that varies greatly
from distro to distro, so you are on your own. Alternatively, you can
look for it on ctan.org: most LaTeX packages can be found there, but the
installation is more complicated; a description can be found at <here
comes a link>, but you will have to resolve problems on your own."

> If soul.sty is a non-guaranteed dependency, we should document it.   
> Where?

Perhaps a new Dependencies section in the manual that gathers up
dependencies of the various exporters, as well as the preview stuff and
anything else that fits. Maybe keep it online, so people can update it,
and have the manual point to it. Give me a week or so to work on the
latex part and see whether it seems helpful.

> Maybe I should make the use of soul.sty dependend on the use of
> strike- through stuff in the file....

The trade-off is of course added complexity, but if you are willing
to suffer the pain, who am I to dissuade you? :-)

Thanks,
Nick

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

* Re: fullpage.sty replacement [WAS: Problem with LaTeX snippets preview]
  2009-09-29 17:03       ` Nick Dokos
@ 2009-09-30  8:27         ` Carsten Dominik
  0 siblings, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-09-30  8:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode


On Sep 29, 2009, at 7:03 PM, Nick Dokos wrote:

> Carsten Dominik <carsten.dominik@gmail.com> wrote:
>
>> However:
>>
>> - Fullpage is a trivial ad very small package that only
>>   changes margins.  Even if it changes at some point, there is no
>> reason
>>   for Org to follow this change.
>
> Agreed - it was more "the principle of the thing" rather than this
> particular change.
>
>>
>> - I'd like to have few dependencies if possible.
>>
>
> Agreed - but there are going to be dependencies anyway.
>
>> - People who use strike-through faces should know better :-)
>>   Well, I know there are exceptions where this does make sense.
>>
>
> Agreed with this too - but soul.sty is included unconditionally
> so you get the dependency even if you are on the side of the angels.
>
>> The bad thing about packages that are in some TeX distros, but not
>> in others, is that you have to start documenting these dependencies
>> on a system-by-system basis, and I'd rather not go there, if  
>> possible.
>>
>
> That's why I think we should document it at the level of latex  
> packages:
> we can then point people to CTAN as the last resort. A blurb like this
> perhaps:
>
> "Your distro may provide a package for this (e.g. on Debian/Ubuntu,
> soul.sty is in the package texlive-latex-extra), but that varies  
> greatly
> from distro to distro, so you are on your own. Alternatively, you can
> look for it on ctan.org: most LaTeX packages can be found there, but  
> the
> installation is more complicated; a description can be found at <here
> comes a link>, but you will have to resolve problems on your own."
>
>> If soul.sty is a non-guaranteed dependency, we should document it.
>> Where?
>
> Perhaps a new Dependencies section in the manual that gathers up
> dependencies of the various exporters, as well as the preview stuff  
> and
> anything else that fits. Maybe keep it online, so people can update  
> it,
> and have the manual point to it. Give me a week or so to work on the
> latex part and see whether it seems helpful.

OK, great.

>
>> Maybe I should make the use of soul.sty dependend on the use of
>> strike- through stuff in the file....
>
> The trade-off is of course added complexity, but if you are willing
> to suffer the pain, who am I to dissuade you? :-)

Another possibility would be to try to load soul.sty but capture the  
error and continue.  So processing would work OK of strikethrough is  
not used.

- Carsten


>
> Thanks,
> Nick

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

end of thread, other threads:[~2009-09-30  8:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-26 11:36 fullpage.sty replacement [WAS: Problem with LaTeX snippets preview] Tim Burt
2009-09-28 20:10 ` Carsten Dominik
2009-09-28 23:46   ` Tim Burt
2009-09-29  6:48   ` Nick Dokos
2009-09-29  7:38     ` Carsten Dominik
2009-09-29 17:03       ` Nick Dokos
2009-09-30  8:27         ` Carsten Dominik

Code repositories for project(s) associated with this public 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).