emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How can I make mdframed+minted work for multi-page source code blocks?
@ 2015-08-05  3:30 Kaushal
  2015-08-05 10:55 ` Kaushal
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal @ 2015-08-05  3:30 UTC (permalink / raw)
  To: emacs-org list

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

I am using org-mode version 8.3 and the latest build of emacs from git
master.

I am trying to make mdframed+minted work with source code blocks having
captions.

Here is  a minimum working example:
https://gist.githubusercontent.com/kaushalmodi/a9d05fe94d5641d0084f/raw/0ff356e8cfafbec53d91fa3b73a59226e5cd9825/minted-multiple-pages.org

The example is short; just the source code block is big so that it spans
multiple pages.

I am trying to get the code block parts on each page to be completely boxed
(borders on all 4 sides).

Currently only the code blocks in in-between pages gets borders only on the
sides. The first part of code block on the first page gets borders on top
and sides. And the last part of the code block on the last page gets
borders on bottom and on sides.

Here is the generated pdf:
https://dl.dropboxusercontent.com/u/10985/minted-multiple-pages.pdf (You
can ignore the lines crossing the borders as I will work on fixing those
once I gets the borders right).

Please let me know if there is any other way to get the following using
*minted*:
- Split code blocks on each page be completely boxed.
- The code block be captioned.
- The code block be properly listed in List of Listings
- Be able to customize the border lines, code background and line numbers.

--
Kaushal Modi

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

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

* Re: How can I make mdframed+minted work for multi-page source code blocks?
  2015-08-05  3:30 How can I make mdframed+minted work for multi-page source code blocks? Kaushal
@ 2015-08-05 10:55 ` Kaushal
  2015-08-05 19:26   ` Kaushal
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal @ 2015-08-05 10:55 UTC (permalink / raw)
  To: emacs-org list

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

I forgot to mention that I have this in my emacs setup related to ox-latex
and minted:

           (setq org-latex-listings 'minted)

            (setq org-latex-packages-alist
                  '(
                    ;; % 0 paragraph indent, adds vertical space between
paragraphs
                    ;;
http://en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting
                    (""          "parskip")
                    ;; Code blocks syntax highlighting
                    (""          "minted") ; Comment this if
org-latex-create-formula-image-program
                    ;; is set to dvipng. minted package can't be loaded
                    ;; when using dvipng to show latex previews
                    ;; (""          "minted" nil) ; Uncomment this if
org-latex-create-formula-image-program
                    ;;                            ; is set to dvipng
                    ;; Graphics package for more complicated figures
                    (""          "tikz")
                    ;; Prevent tables/figures from one section to float
into another section
                    ;;
http://tex.stackexchange.com/questions/279/how-do-i-ensure-that-figures-appear-in-the-section-theyre-associated-with
                    ("section"   "placeins")
                    ;; It doesn't seem below packages are required
                    ;; ;; Packages suggested to be added for previewing
latex fragments
                    ;; ;;
http://orgmode.org/worg/org-tutorials/org-latex-preview.html
                    ;; ("usenames"  "color") ; HAD TO COMMENT IT OUT
BECAUSE OF CLASH WITH placeins pkg
                    ("mathscr"   "eucal")
                    (""          "latexsym")
                    ;; Prevent an image from floating to a different
location
                    ;;
http://tex.stackexchange.com/questions/8625/force-figure-placement-in-text
                    (""          "float")
                    (""          "caption")
                    ))

            ;; "H" option is from the `float' package. That prevents the
images from floating around.
            ;; (setq org-latex-default-figure-position "htb") ; default -
figures are floating
            (setq org-latex-default-figure-position "H") ; figures are NOT
floating

            ;; minted package options (applied to embedded source codes)
            ;; https://github.com/gpoore/minted
            (setq org-latex-minted-options
                  '(("linenos")
                    ("numbersep"   "5pt")
                    ("frame"       "none") ; box frame is created by the
mdframed package
                    ("framesep"    "2mm")
                    ;; ("fontfamily"  "zi4") ; required only when using
pdflatex
                                        ; instead of xelatex
                    ;; minted 2.0 specific features
                    ("breaklines") ; line wrapping within code blocks
                    ))

--
Kaushal Modi
On Aug 4, 2015 11:30 PM, "Kaushal" <kaushal.modi@gmail.com> wrote:

> I am using org-mode version 8.3 and the latest build of emacs from git
> master.
>
> I am trying to make mdframed+minted work with source code blocks having
> captions.
>
> Here is  a minimum working example:
> https://gist.githubusercontent.com/kaushalmodi/a9d05fe94d5641d0084f/raw/0ff356e8cfafbec53d91fa3b73a59226e5cd9825/minted-multiple-pages.org
>
> The example is short; just the source code block is big so that it spans
> multiple pages.
>
> I am trying to get the code block parts on each page to be completely
> boxed (borders on all 4 sides).
>
> Currently only the code blocks in in-between pages gets borders only on
> the sides. The first part of code block on the first page gets borders on
> top and sides. And the last part of the code block on the last page gets
> borders on bottom and on sides.
>
> Here is the generated pdf:
> https://dl.dropboxusercontent.com/u/10985/minted-multiple-pages.pdf (You
> can ignore the lines crossing the borders as I will work on fixing those
> once I gets the borders right).
>
> Please let me know if there is any other way to get the following using
> *minted*:
> - Split code blocks on each page be completely boxed.
> - The code block be captioned.
> - The code block be properly listed in List of Listings
> - Be able to customize the border lines, code background and line numbers.
>
> --
> Kaushal Modi
>

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

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

* Re: How can I make mdframed+minted work for multi-page source code blocks?
  2015-08-05 10:55 ` Kaushal
@ 2015-08-05 19:26   ` Kaushal
  0 siblings, 0 replies; 3+ messages in thread
From: Kaushal @ 2015-08-05 19:26 UTC (permalink / raw)
  To: emacs-org list

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

Actually everyone can ignore this; I have a working hack.

On Wed, Aug 5, 2015 at 6:55 AM Kaushal <kaushal.modi@gmail.com> wrote:

> I forgot to mention that I have this in my emacs setup related to ox-latex
> and minted:
>
>            (setq org-latex-listings 'minted)
>
>             (setq org-latex-packages-alist
>                   '(
>                     ;; % 0 paragraph indent, adds vertical space between
> paragraphs
>                     ;;
> http://en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting
>                     (""          "parskip")
>                     ;; Code blocks syntax highlighting
>                     (""          "minted") ; Comment this if
> org-latex-create-formula-image-program
>                     ;; is set to dvipng. minted package can't be loaded
>                     ;; when using dvipng to show latex previews
>                     ;; (""          "minted" nil) ; Uncomment this if
> org-latex-create-formula-image-program
>                     ;;                            ; is set to dvipng
>                     ;; Graphics package for more complicated figures
>                     (""          "tikz")
>                     ;; Prevent tables/figures from one section to float
> into another section
>                     ;;
> http://tex.stackexchange.com/questions/279/how-do-i-ensure-that-figures-appear-in-the-section-theyre-associated-with
>                     ("section"   "placeins")
>                     ;; It doesn't seem below packages are required
>                     ;; ;; Packages suggested to be added for previewing
> latex fragments
>                     ;; ;;
> http://orgmode.org/worg/org-tutorials/org-latex-preview.html
>                     ;; ("usenames"  "color") ; HAD TO COMMENT IT OUT
> BECAUSE OF CLASH WITH placeins pkg
>                     ("mathscr"   "eucal")
>                     (""          "latexsym")
>                     ;; Prevent an image from floating to a different
> location
>                     ;;
> http://tex.stackexchange.com/questions/8625/force-figure-placement-in-text
>                     (""          "float")
>                     (""          "caption")
>                     ))
>
>             ;; "H" option is from the `float' package. That prevents the
> images from floating around.
>             ;; (setq org-latex-default-figure-position "htb") ; default -
> figures are floating
>             (setq org-latex-default-figure-position "H") ; figures are NOT
> floating
>
>             ;; minted package options (applied to embedded source codes)
>             ;; https://github.com/gpoore/minted
>             (setq org-latex-minted-options
>                   '(("linenos")
>                     ("numbersep"   "5pt")
>                     ("frame"       "none") ; box frame is created by the
> mdframed package
>                     ("framesep"    "2mm")
>                     ;; ("fontfamily"  "zi4") ; required only when using
> pdflatex
>                                         ; instead of xelatex
>                     ;; minted 2.0 specific features
>                     ("breaklines") ; line wrapping within code blocks
>                     ))
>
> --
> Kaushal Modi
> On Aug 4, 2015 11:30 PM, "Kaushal" <kaushal.modi@gmail.com> wrote:
>
>> I am using org-mode version 8.3 and the latest build of emacs from git
>> master.
>>
>> I am trying to make mdframed+minted work with source code blocks having
>> captions.
>>
>> Here is  a minimum working example:
>> https://gist.githubusercontent.com/kaushalmodi/a9d05fe94d5641d0084f/raw/0ff356e8cfafbec53d91fa3b73a59226e5cd9825/minted-multiple-pages.org
>>
>> The example is short; just the source code block is big so that it spans
>> multiple pages.
>>
>> I am trying to get the code block parts on each page to be completely
>> boxed (borders on all 4 sides).
>>
>> Currently only the code blocks in in-between pages gets borders only on
>> the sides. The first part of code block on the first page gets borders on
>> top and sides. And the last part of the code block on the last page gets
>> borders on bottom and on sides.
>>
>> Here is the generated pdf:
>> https://dl.dropboxusercontent.com/u/10985/minted-multiple-pages.pdf (You
>> can ignore the lines crossing the borders as I will work on fixing those
>> once I gets the borders right).
>>
>> Please let me know if there is any other way to get the following using
>> *minted*:
>> - Split code blocks on each page be completely boxed.
>> - The code block be captioned.
>> - The code block be properly listed in List of Listings
>> - Be able to customize the border lines, code background and line numbers.
>>
>> --
>> Kaushal Modi
>>
>

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

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

end of thread, other threads:[~2015-08-05 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05  3:30 How can I make mdframed+minted work for multi-page source code blocks? Kaushal
2015-08-05 10:55 ` Kaushal
2015-08-05 19:26   ` Kaushal

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