LaTeX forum ⇒ LyXminted | Get it working Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
waspinator
Posts: 2
Joined: Mon Nov 07, 2011 9:13 pm

minted | Get it working

Postby waspinator » Mon Nov 07, 2011 9:14 pm

Is there anyway to get minted to work with LyX?

http://code.google.com/p/minted/

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Mon Nov 07, 2011 10:25 pm

Since minted is an official package listed on CTAN and part of the common TeX distributions, you should be able to install it by the package manager of your distribution and utilize it. I cannot tell you how to include the package in LyX.


Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

waspinator
Posts: 2
Joined: Mon Nov 07, 2011 9:13 pm

Postby waspinator » Tue Nov 08, 2011 12:13 am

localghost wrote:Since minted is an official package listed on CTAN and part of the common TeX distributions, you should be able to install it by the package manager of your distribution and utilize it. I cannot tell you how to include the package in LyX.


Best regards and welcome to the board
Thorsten



Hmm, I can't seem to find it in Ubuntu 11.10. Is there a distro you know has it? Also, why can't you tell me how to include it in LyX? Do you not want to tell me, or do you not know?

Thanks

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Tue Nov 08, 2011 12:24 am

waspinator wrote:Hmm, I can't seem to find it in Ubuntu 11.10. […]

Check on the command line (terminal) whether the package can be found in your TeX installation tree.
  1. kpsewhich minted.sty

This should yield the complete path to the package. If there is no output, you have to install extra TeX Live packages by the Ubuntu package manager. Since I'm not using Ubuntu, I can't tell you details.
waspinator wrote:[…] Is there a distro you know has it? […]

Note that I was not talking about Linux distributions, but about TeX distributions like MiKTeX or TeX Live. Both contain the minted package.
waspinator wrote:[…] Also, why can't you tell me how to include it in LyX? Do you not want to tell me, or do you not know? […]

What makes you think that I don't want? Would I be here else? I can't tell you because I just don't use LyX.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

telewatho
Posts: 3
Joined: Wed Jan 25, 2012 10:10 pm

Postby telewatho » Wed Jan 25, 2012 10:17 pm

Hi, guys, here is how I got minted.sty working in lyx. (alternatively minted is an official CTAN package so it could be done that way)

First download (or make) minted.sty

  1. sudo mkdir "/usr/share/texmf-texlive/tex/latex/minted/"
  2. sudo cp minted.sty "/usr/share/texmf-texlive/tex/latex/minted/"
  3. sudo mktexlsr


Then in lyx, go to Tools/Tex Information, select latex styles and click rescan. minted.sty should appear in the list

in lyx, go to "Tools>preferences>file handling>converters" and find the converter from tex to pdflatex. Edit its command line adding the option "-shell-escape" (no quotes) into the Converter field, then click the Modify button next to the list of converters. Then click Apply

in lyx, go to Document>Settings and enter "/usepackage{minted}" (no quotes) in the latex preamble

in lyx, in the part of your document where you want the highlighted code to appear, go to "Insert>TEX code" to get an Evil Red Text (ERT) box

in the ERT box, type:
  1. \begin{minted}{python}
  2. def boring(args = None): pass
  3. \end{minted}


Then render your lyx file as a pdf by clicking the render pdf button in lyx. If you get an error message post it here.

Hope this helps! Telewatho

EDIT: oh, and make sure you get ERT boxes in the right place in lyx or you will get errors when you try and render

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 4 guests