emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex markup in org?
@ 2014-06-01  6:57 Steven Arntson
  2014-06-01  7:03 ` Omid
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steven Arntson @ 2014-06-01  6:57 UTC (permalink / raw)
  To: emacs-orgmode

I've been learning to export from org to latex (to pdf), and have had
great success. There's a simplification to the process I'd like to make,
though, if it's possible.

Right now I use files: file.org and filestyle.sty. The .sty gives
the latex-specific instruction, and I point to it from file.org with a
line of #+LATEX_HEADER: \usepackage{filestyle}. This works great, but
I'd love to have just one file, not two, to keep things simple.

So I tried putting the contents of filestyle.sty near the top of file.org
inside of #+BEGIN_latex and #+END_latex, but it doesn't quite work. It
incompletely works, which is perplexing...

I'd appreciate any ideas about this--can it be done?

Thank you!
Steven

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

* Re: latex markup in org?
  2014-06-01  6:57 latex markup in org? Steven Arntson
@ 2014-06-01  7:03 ` Omid
  2014-06-01  7:09 ` Glyn Millington
  2014-06-01 19:26 ` John Kitchin
  2 siblings, 0 replies; 5+ messages in thread
From: Omid @ 2014-06-01  7:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello Steven,

LaTeX .sty files are special. They are not meant to be included in a
.tex file. See
https://tex.stackexchange.com/questions/91167/why-use-sty-files for
more information.

Omid

Sent from my Emacs

On 06/01/2014 02:57 AM, Steven Arntson wrote:
> I've been learning to export from org to latex (to pdf), and have had
> great success. There's a simplification to the process I'd like to make,
> though, if it's possible.
> 
> Right now I use files: file.org and filestyle.sty. The .sty gives
> the latex-specific instruction, and I point to it from file.org with a
> line of #+LATEX_HEADER: \usepackage{filestyle}. This works great, but
> I'd love to have just one file, not two, to keep things simple.
> 
> So I tried putting the contents of filestyle.sty near the top of file.org
> inside of #+BEGIN_latex and #+END_latex, but it doesn't quite work. It
> incompletely works, which is perplexing...
> 
> I'd appreciate any ideas about this--can it be done?
> 
> Thank you!
> Steven
> 
> 

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

* Re: latex markup in org?
  2014-06-01  6:57 latex markup in org? Steven Arntson
  2014-06-01  7:03 ` Omid
@ 2014-06-01  7:09 ` Glyn Millington
  2014-06-01 19:26 ` John Kitchin
  2 siblings, 0 replies; 5+ messages in thread
From: Glyn Millington @ 2014-06-01  7:09 UTC (permalink / raw)
  To: emacs-orgmode

Steven Arntson <steven@stevenarntson.com> writes:

> I've been learning to export from org to latex (to pdf), and have had
> great success. There's a simplification to the process I'd like to make,
> though, if it's possible.
>
> Right now I use files: file.org and filestyle.sty. The .sty gives
> the latex-specific instruction, and I point to it from file.org with a
> line of #+LATEX_HEADER: \usepackage{filestyle}. This works great, but
> I'd love to have just one file, not two, to keep things simple.
>
> So I tried putting the contents of filestyle.sty near the top of file.org
> inside of #+BEGIN_latex and #+END_latex, but it doesn't quite work. It
> incompletely works, which is perplexing...
>
> I'd appreciate any ideas about this--can it be done?

I'm sure it can, but not that way!

As I understand it, blocks like this ....

#+BEGIN_LaTeX
\marginpar{\color{red} \tiny \raggedright
\vspace{18pt}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat.}
#+END_LaTeX

work where they are and not file-wide.

For file-wide instructions you need to put 'em in 

#+LATEX_HEADER lines.

Exactly how to do that will depend on the precise contents of
filestyle.sty.

atb



Glyn

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

* Re: latex markup in org?
  2014-06-01  6:57 latex markup in org? Steven Arntson
  2014-06-01  7:03 ` Omid
  2014-06-01  7:09 ` Glyn Millington
@ 2014-06-01 19:26 ` John Kitchin
  2014-06-02  0:09   ` Steven Arntson
  2 siblings, 1 reply; 5+ messages in thread
From: John Kitchin @ 2014-06-01 19:26 UTC (permalink / raw)
  To: Steven Arntson; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]

Maybe you can include the sty file as a code block that will be tangled
before export. You should put that block in a section tagged no-export.
Depending on your setup, you may need to make a code block to build your
latex file and/or pdf to make sure the tangling happens.

at the top keep this
#+LATEX_HEADER: \usepackage{filestyle}

and in the last section do this
* build :noexport:

#+begin_src text :tangle filestyle.sty
latex code for style
#+end_src

#+begin_src emacs-lisp
(org-babel-tangle)
(save-buffer)
(org-latex-export-to-pdf)
#+end_src

and finally put your cursor in the last block, and type C-c C-c. that
should do what you want.

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Sun, Jun 1, 2014 at 2:57 AM, Steven Arntson <steven@stevenarntson.com>
wrote:

> I've been learning to export from org to latex (to pdf), and have had
> great success. There's a simplification to the process I'd like to make,
> though, if it's possible.
>
> Right now I use files: file.org and filestyle.sty. The .sty gives
> the latex-specific instruction, and I point to it from file.org with a
> line of #+LATEX_HEADER: \usepackage{filestyle}. This works great, but
> I'd love to have just one file, not two, to keep things simple.
>
> So I tried putting the contents of filestyle.sty near the top of file.org
> inside of #+BEGIN_latex and #+END_latex, but it doesn't quite work. It
> incompletely works, which is perplexing...
>
> I'd appreciate any ideas about this--can it be done?
>
> Thank you!
> Steven
>
>
>

[-- Attachment #2: Type: text/html, Size: 2633 bytes --]

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

* Re: latex markup in org?
  2014-06-01 19:26 ` John Kitchin
@ 2014-06-02  0:09   ` Steven Arntson
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Arntson @ 2014-06-02  0:09 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Maybe you can include the sty file as a code block that will be
> tangled before export. You should put that block in a section tagged
> no-export. Depending on your setup, you may need to make a code block
> to build your latex file and/or pdf to make sure the tangling happens.
>
> at the top keep this
> #+LATEX_HEADER: \usepackage{filestyle}
>
> and in the last section do this
> * build :noexport:
>
> #+begin_src text :tangle filestyle.sty
> latex code for style
> #+end_src
>
> #+begin_src emacs-lisp
> (org-babel-tangle)
> (save-buffer)
> (org-latex-export-to-pdf)
> #+end_src
>
> and finally put your cursor in the last block, and type C-c C-c. that
> should do what you want. 
>
> John
>
> -----------------------------------
> John Kitchin
> Associate Professor
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> http://kitchingroup.cheme.cmu.edu
>
> On Sun, Jun 1, 2014 at 2:57 AM, Steven Arntson
> <steven@stevenarntson.com> wrote:
>
>     I've been learning to export from org to latex (to pdf), and have
>     had
>     great success. There's a simplification to the process I'd like to
>     make,
>     though, if it's possible.
>     
>     Right now I use files: file.org and filestyle.sty. The .sty gives
>     the latex-specific instruction, and I point to it from file.org
>     with a
>     line of #+LATEX_HEADER: \usepackage{filestyle}. This works great,
>     but
>     I'd love to have just one file, not two, to keep things simple.
>     
>     So I tried putting the contents of filestyle.sty near the top of
>     file.org
>     inside of #+BEGIN_latex and #+END_latex, but it doesn't quite
>     work. It
>     incompletely works, which is perplexing...
>     
>     I'd appreciate any ideas about this--can it be done?
>     
>     Thank you!
>     Steven
>     
>     
Thanks for this--great idea. I'll give it a try.

-steven

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

end of thread, other threads:[~2014-06-02  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-01  6:57 latex markup in org? Steven Arntson
2014-06-01  7:03 ` Omid
2014-06-01  7:09 ` Glyn Millington
2014-06-01 19:26 ` John Kitchin
2014-06-02  0:09   ` Steven Arntson

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