emacs-orgmode@gnu.org archives
help / color / mirror / code / Atom feed
* Exporting Code Blocks to PDF
2014-04-23  0:43    John Hendy
To: emacs-orgmode

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

Hello Emacs World-

I’m using LaTex to export documents to PDF, but the code blocks are not fitting to the page properly and the code is being cutoff. Is there a way to turn on word-wrapping for export to PDF, or to resize code blocks?

Also, does anyone have a good system for dealing with exporting large tables? Right now I’m just linking to a file, but I’m curious if anyone else is doing anything clever.

Summer
SRE@stowers.org<mailto:SRE@stowers.org>

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

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

* Re: Exporting Code Blocks to PDF
2014-04-22 23:28  Exporting Code Blocks to PDF Elasady, Summer
@ 2014-04-23  0:43    John Hendy
2014-04-23  7:22      Bernhard Pröll
From: John Hendy @ 2014-04-23  0:43 UTC (permalink / raw)

On Tue, Apr 22, 2014 at 6:28 PM, Elasady, Summer <sre@stowers.org> wrote:
> Hello Emacs World-
>
> I’m using LaTex to export documents to PDF, but the code blocks are not
> fitting to the page properly and the code is being cutoff. Is there a way to
> turn on word-wrapping for export to PDF, or to resize code blocks?
>

I don't know if there's a way to wrap, but in my one formal
programming class, the convention was only to write 80 characters or
less -- are you exceeding that? If not, and it's just a font size
thing, you can always use LaTeX to reduce the font. I frequently do
this, especially using code in Beamer presentations:

#+latex: \scriptsize
#+begin_src R blah blah

code here

#+end_src
#+latex: \normalsize

This way, the block is downsized, and then resumes to regular font
size for the rest of the document. You can use any size command you
want; I frequently use \footnotesize, \scriptsize, and \tiny. I hardly
notice a difference with \small, though you can try that, too.

> Also, does anyone have a good system for dealing with exporting large
> tables? Right now I’m just linking to a file, but I’m curious if anyone else
> is doing anything clever.
>

For tables that are /close/ in size already, I do the same thing as
above, at least if we're talking about fitting to width. You can also
flip sideways and extend over multiple pages to handle both wide and
long:

#+latex: \begin{landscape}
#+attr_latex: :environment longtable
| *alpha* | *beta* | *gamma* | *delta* |
|---------+--------+---------+---------|
|       1 |      1 |       1 |       1 |
|       2 |      2 |       2 |       2 |
|       3 |      3 |       3 |       3 |
|       4 |      4 |       4 |       4 |
#+latex: \end{landscape}

You can use them independently, too. Initially I tried the Org syntax
for sidewaystable, but it didn't seem to work with longtable:
- http://orgmode.org/manual/LaTeX-specific-attributes.html

As in, technically it would seem you could do:

#+attr_latex: :environment longtable :float sidewaystable

But perhaps that's more of a LaTex issue:
- http://tex.stackexchange.com/questions/63585/sidewaystable-together-with-longtable

Anyway, the above works, and that covers any handles I've ever used
(font, rotate, extend over multiple pages). Other than trying to
wordsmith my column names where the title exceeds the contents...
that's all the tricks up my sleeve!

John

>
> Summer
> SRE@stowers.org
>

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

* Re: Exporting Code Blocks to PDF
2014-04-23  0:43    John Hendy
@ 2014-04-23  7:22      Bernhard Pröll
0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Pröll @ 2014-04-23  7:22 UTC (permalink / raw)
To: emacs-orgmode

Instead of switching fontsizes regularly, you might want to set the monofont size or scale:

Bernhard

John Hendy <jw.hendy@gmail.com> schrieb am Tue, 22. Apr 19:43:
>On Tue, Apr 22, 2014 at 6:28 PM, Elasady, Summer <sre@stowers.org> wrote:
>> Hello Emacs World-
>>
>> I’m using LaTex to export documents to PDF, but the code blocks are not
>> fitting to the page properly and the code is being cutoff. Is there a way to
>> turn on word-wrapping for export to PDF, or to resize code blocks?
>>
>
>I don't know if there's a way to wrap, but in my one formal
>programming class, the convention was only to write 80 characters or
>less -- are you exceeding that? If not, and it's just a font size
>thing, you can always use LaTeX to reduce the font. I frequently do
>this, especially using code in Beamer presentations:
>
>#+latex: \scriptsize
>#+begin_src R blah blah
>
>code here
>
>#+end_src
>#+latex: \normalsize
>
>This way, the block is downsized, and then resumes to regular font
>size for the rest of the document. You can use any size command you
>want; I frequently use \footnotesize, \scriptsize, and \tiny. I hardly
>notice a difference with \small, though you can try that, too.
>
>> Also, does anyone have a good system for dealing with exporting large
>> tables? Right now I’m just linking to a file, but I’m curious if anyone else
>> is doing anything clever.
>>
>
>For tables that are /close/ in size already, I do the same thing as
>above, at least if we're talking about fitting to width. You can also
>flip sideways and extend over multiple pages to handle both wide and
>long:
>
>#+latex: \begin{landscape}
>#+attr_latex: :environment longtable
>| *alpha* | *beta* | *gamma* | *delta* |
>|---------+--------+---------+---------|
>|       1 |      1 |       1 |       1 |
>|       2 |      2 |       2 |       2 |
>|       3 |      3 |       3 |       3 |
>|       4 |      4 |       4 |       4 |
>#+latex: \end{landscape}
>
>You can use them independently, too. Initially I tried the Org syntax
>for sidewaystable, but it didn't seem to work with longtable:
>- http://orgmode.org/manual/LaTeX-specific-attributes.html
>
>As in, technically it would seem you could do:
>
>#+attr_latex: :environment longtable :float sidewaystable
>
>But perhaps that's more of a LaTex issue:
>- http://tex.stackexchange.com/questions/63585/sidewaystable-together-with-longtable
>
>Anyway, the above works, and that covers any handles I've ever used
>(font, rotate, extend over multiple pages). Other than trying to
>wordsmith my column names where the title exceeds the contents...
>that's all the tricks up my sleeve!
>
>
>John
>
>
>>
>> Summer
>> SRE@stowers.org
>>
>

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

end of thread, other threads:[~2014-04-23  7:22 UTC | newest]

2014-04-22 23:28  Exporting Code Blocks to PDF Elasady, Summer
2014-04-23  7:22      Bernhard Pröll

Code repositories for project(s) associated with this inbox:
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).