emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-preview-latex-fragment ignores \includes in the LATEX_HEADER
@ 2015-05-27 13:02 Stefan Otte
  2015-05-27 13:37 ` Robert Klein
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Otte @ 2015-05-27 13:02 UTC (permalink / raw)
  To: emacs-orgmode

Hey,

I'm using orgmode with lots of LaTeX for equations. A typical document
start with

  #+TITLE: Some Title
  #+LaTeX_HEADER: \include{commands}

commands.tex contains commands like:
  \newcommand{\RRR}{{\mathbb{R}}}

The pdf export works flawlessly, however `org-preview-latex-fragment`
seems to ignore "\include{commands}", i.e., equations that use
commands that are defined in commands.tex are rendered as blank/empty
image.

Is it the intended behavior that `org-preview-latex-fragment` ignores
"\include", is it a bug, or is there a better way to do it?


Best,
 Stefan

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

* Re: org-preview-latex-fragment ignores \includes in the LATEX_HEADER
  2015-05-27 13:02 org-preview-latex-fragment ignores \includes in the LATEX_HEADER Stefan Otte
@ 2015-05-27 13:37 ` Robert Klein
  2015-05-28  9:21   ` Stefan Otte
  2015-05-28 16:09 ` Nick Dokos
  2015-05-29  7:44 ` Eric S Fraga
  2 siblings, 1 reply; 5+ messages in thread
From: Robert Klein @ 2015-05-27 13:37 UTC (permalink / raw)
  To: Stefan Otte; +Cc: emacs-orgmode

Hi,

On Wed, 27 May 2015 15:02:02 +0200
Stefan Otte <stefan.otte@gmail.com> wrote:

> Hey,
> 
> I'm using orgmode with lots of LaTeX for equations. A typical document
> start with
> 
>   #+TITLE: Some Title
>   #+LaTeX_HEADER: \include{commands}
> 
> commands.tex contains commands like:
>   \newcommand{\RRR}{{\mathbb{R}}}
> 
> The pdf export works flawlessly, however `org-preview-latex-fragment`
> seems to ignore "\include{commands}", i.e., equations that use
> commands that are defined in commands.tex are rendered as blank/empty
> image.
> 
> Is it the intended behavior that `org-preview-latex-fragment` ignores
> "\include", is it a bug, or is there a better way to do it?
> 

afaik \include doesn't work in LaTeX headers; you'll have to use \input
there.

Could you try to use \input?

Best regards
Robert

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

* Re: org-preview-latex-fragment ignores \includes in the LATEX_HEADER
  2015-05-27 13:37 ` Robert Klein
@ 2015-05-28  9:21   ` Stefan Otte
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Otte @ 2015-05-28  9:21 UTC (permalink / raw)
  To: Robert Klein; +Cc: emacs-orgmode

Hey,

"\input" does not solve the problem. Still no preview images. (The pdf
export still works as expected.)


Best,
 Stefan



On Wed, May 27, 2015 at 3:37 PM, Robert Klein <roklein@roklein.de> wrote:
> Hi,
>
> On Wed, 27 May 2015 15:02:02 +0200
> Stefan Otte <stefan.otte@gmail.com> wrote:
>
>> Hey,
>>
>> I'm using orgmode with lots of LaTeX for equations. A typical document
>> start with
>>
>>   #+TITLE: Some Title
>>   #+LaTeX_HEADER: \include{commands}
>>
>> commands.tex contains commands like:
>>   \newcommand{\RRR}{{\mathbb{R}}}
>>
>> The pdf export works flawlessly, however `org-preview-latex-fragment`
>> seems to ignore "\include{commands}", i.e., equations that use
>> commands that are defined in commands.tex are rendered as blank/empty
>> image.
>>
>> Is it the intended behavior that `org-preview-latex-fragment` ignores
>> "\include", is it a bug, or is there a better way to do it?
>>
>
> afaik \include doesn't work in LaTeX headers; you'll have to use \input
> there.
>
> Could you try to use \input?
>
> Best regards
> Robert

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

* Re: org-preview-latex-fragment ignores \includes in the LATEX_HEADER
  2015-05-27 13:02 org-preview-latex-fragment ignores \includes in the LATEX_HEADER Stefan Otte
  2015-05-27 13:37 ` Robert Klein
@ 2015-05-28 16:09 ` Nick Dokos
  2015-05-29  7:44 ` Eric S Fraga
  2 siblings, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2015-05-28 16:09 UTC (permalink / raw)
  To: emacs-orgmode

Stefan Otte <stefan.otte@gmail.com> writes:

> Hey,
>
> I'm using orgmode with lots of LaTeX for equations. A typical document
> start with
>
>   #+TITLE: Some Title
>   #+LaTeX_HEADER: \include{commands}
>
> commands.tex contains commands like:
>   \newcommand{\RRR}{{\mathbb{R}}}
>
> The pdf export works flawlessly, however `org-preview-latex-fragment`
> seems to ignore "\include{commands}", i.e., equations that use
> commands that are defined in commands.tex are rendered as blank/empty
> image.
>
> Is it the intended behavior that `org-preview-latex-fragment` ignores
> "\include", is it a bug, or is there a better way to do it?
>
>

Fragments are islands unto themselves with their own special
handling. See the doc for the variable org-format-latex-header.

Nick

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

* Re: org-preview-latex-fragment ignores \includes in the LATEX_HEADER
  2015-05-27 13:02 org-preview-latex-fragment ignores \includes in the LATEX_HEADER Stefan Otte
  2015-05-27 13:37 ` Robert Klein
  2015-05-28 16:09 ` Nick Dokos
@ 2015-05-29  7:44 ` Eric S Fraga
  2 siblings, 0 replies; 5+ messages in thread
From: Eric S Fraga @ 2015-05-29  7:44 UTC (permalink / raw)
  To: Stefan Otte; +Cc: emacs-orgmode

On Wednesday, 27 May 2015 at 15:02, Stefan Otte wrote:

[...]

> The pdf export works flawlessly, however `org-preview-latex-fragment`
> seems to ignore "\include{commands}", i.e., equations that use
> commands that are defined in commands.tex are rendered as blank/empty
> image.
>
> Is it the intended behavior that `org-preview-latex-fragment` ignores
> "\include", is it a bug, or is there a better way to do it?

Maybe create a style file and then use

,----[ C-h v org-latex-packages-alist RET ]
| org-latex-packages-alist is a variable defined in `org.el'.
| 
| Documentation:
| Alist of packages to be inserted in every LaTeX header.
| 
| These will be inserted after `org-latex-default-packages-alist'.
| Each element is either a cell or a string.
| 
| A cell is of the format:
| 
|     ("options" "package" SNIPPET-FLAG)
| 
| SNIPPET-FLAG, when non-nil, indicates that this package is also
| needed when turning LaTeX snippets into images for inclusion into
| non-LaTeX output.
| 
| A string will be inserted as-is in the header of the document.
| 
| Make sure that you only list packages here which:
| 
|   - you want in every file;
|   - do not conflict with the setup in `org-format-latex-header';
|   - do not conflict with the default packages in
|     `org-latex-default-packages-alist'.
| 
| You can customize this variable.
`----

Note bit about LaTeX snippets.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1136-g0e7062

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

end of thread, other threads:[~2015-05-29  8:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 13:02 org-preview-latex-fragment ignores \includes in the LATEX_HEADER Stefan Otte
2015-05-27 13:37 ` Robert Klein
2015-05-28  9:21   ` Stefan Otte
2015-05-28 16:09 ` Nick Dokos
2015-05-29  7:44 ` Eric S Fraga

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).