Org-mode mailing list
 help / color / mirror / Atom feed
* LaTeX fragment preview weirdness
@ 2021-06-02 16:53 Scott Randby
  2021-06-02 17:28 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Randby @ 2021-06-02 16:53 UTC (permalink / raw)
  To: emacs-orgmode

First, I'm using Emacs 27.2 and Org 9.4.6.

I have the following code in an Org file:

#+latex_header: \hypersetup{pdfauthor={Author},pdftitle={Title},pdfsubject={Subject},pdfkeywords={keyword},pdfproducer={Emacs Org},pdfcreator={pdflatex}}
#+latex_header: \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=black}

The above lines are in a section at the end of my document.

When I do C-c C-x C-l in a section (or with a fragment at point), the following appears above every  fragment that is previewed:

pdfauthor=Author,pdftitle=Title,pdfsubject=Subject,pdfkeywords=keyword,pdfproducer=Emacs Org,pdfcreator=pdflatex colorlinks=true,urlcolor=blue,linkcolor=black

Here is a sample section from my Org file:

--BEGIN--

* Distance Formula

Let $d$ be the distance between $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$.
\[
d=\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}
\]

--END--

Scott Randby


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

* Re: LaTeX fragment preview weirdness
  2021-06-02 16:53 LaTeX fragment preview weirdness Scott Randby
@ 2021-06-02 17:28 ` Nick Dokos
  2021-06-02 18:19   ` Scott Randby
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2021-06-02 17:28 UTC (permalink / raw)
  To: emacs-orgmode

Scott Randby <srandby@gmail.com> writes:

> First, I'm using Emacs 27.2 and Org 9.4.6.
>
> I have the following code in an Org file:
>
> #+latex_header: \hypersetup{pdfauthor={Author},pdftitle={Title},pdfsubject={Subject},pdfkeywords={keyword},pdfproducer={Emacs Org},pdfcreator={pdflatex}}
> #+latex_header: \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=black}
>
> The above lines are in a section at the end of my document.
>
> When I do C-c C-x C-l in a section (or with a fragment at point), the following appears above every  fragment that is previewed:
>
> pdfauthor=Author,pdftitle=Title,pdfsubject=Subject,pdfkeywords=keyword,pdfproducer=Emacs Org,pdfcreator=pdflatex colorlinks=true,urlcolor=blue,linkcolor=black
>
> Here is a sample section from my Org file:
>
> --BEGIN--
>
> * Distance Formula
>
> Let $d$ be the distance between $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$.
> \[
> d=\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}
> \]
>
> --END--
>
>

You probably want #+LATEX_HEADER_EXTRA, not #+LATEX_HEADER. Do

   (info "(org) Latex header and sectioning")

where it says:

#+BEGIN_QUOTE
   The LaTeX export back-end appends values from ‘LATEX_HEADER’ and
‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header.  The docstring for
‘org-latex-classes’ explains in more detail.  Also note that LaTeX
export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when
previewing LaTeX snippets (see *note Previewing LaTeX fragments::).
#+END_QUOTE

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



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

* Re: LaTeX fragment preview weirdness
  2021-06-02 17:28 ` Nick Dokos
@ 2021-06-02 18:19   ` Scott Randby
  2021-06-03 19:54     ` Scott Randby
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Randby @ 2021-06-02 18:19 UTC (permalink / raw)
  To: emacs-orgmode

On 6/2/21 1:28 PM, Nick Dokos wrote:
> You probably want #+LATEX_HEADER_EXTRA, not #+LATEX_HEADER. Do
> 
>     (info "(org) Latex header and sectioning")
> 
> where it says:
> 
> #+BEGIN_QUOTE
>     The LaTeX export back-end appends values from ‘LATEX_HEADER’ and
> ‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header.  The docstring for
> ‘org-latex-classes’ explains in more detail.  Also note that LaTeX
> export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when
> previewing LaTeX snippets (see *note Previewing LaTeX fragments::).
> #+END_QUOTE
> 

That worked after I deleted the old images in the ltximg directory. I hardly ever preview LaTeX fragments, but I'm changing #+latex_header: to #+latex_header_extra: everywhere.

Thanks,
Scott


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

* Re: LaTeX fragment preview weirdness
  2021-06-02 18:19   ` Scott Randby
@ 2021-06-03 19:54     ` Scott Randby
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Randby @ 2021-06-03 19:54 UTC (permalink / raw)
  To: emacs-orgmode

> On 6/2/21 1:28 PM, Nick Dokos wrote:
>> You probably want #+LATEX_HEADER_EXTRA, not #+LATEX_HEADER. Do
>>
>>     (info "(org) Latex header and sectioning")
>>
>> where it says:
>>
>> #+BEGIN_QUOTE
>>     The LaTeX export back-end appends values from ‘LATEX_HEADER’ and
>> ‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header.  The docstring for
>> ‘org-latex-classes’ explains in more detail.  Also note that LaTeX
>> export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when
>> previewing LaTeX snippets (see *note Previewing LaTeX fragments::).
>> #+END_QUOTE
>>
> On 6/2/21 2:19 PM, Scott Randby wrote:
> 
> That worked after I deleted the old images in the ltximg directory. I hardly ever preview LaTeX fragments, but I'm changing #+latex_header: to #+latex_header_extra: everywhere.
> 

I had to do a little extra work to get subtree export to work properly. Subtree export appears to also not append ‘LATEX_HEADER_EXTRA’ to the header. I had to add the values I need to the properties of the subtree using 'EXPORT_LATEX_HEADER_EXTRA'. This actually cleaned up a lot of the code, but it was work I'd been putting off.

Scott


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

end of thread, other threads:[~2021-06-03 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 16:53 LaTeX fragment preview weirdness Scott Randby
2021-06-02 17:28 ` Nick Dokos
2021-06-02 18:19   ` Scott Randby
2021-06-03 19:54     ` Scott Randby

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git