# Tag Info

## New answers tagged minted

0

So as was suggested by @Sigur and @R. Schumacher in the origional post comments this was a version error... ProTex does not come with the latest TexStudio (2.6.6). Downloading the newest version (2.9.4) solved the issue.

1

Probably 2 solutions: Specify the full (absolute path). Make the current directory the working directory. To do this go to Tools > Preferences > Paths and under temporary directory put .. This works on Ubuntu but I'm not sure about Windows. Explanation: because you are using ERT, LyX does not know to copy the file to the temporary directory that it uses ...

3

It works for me if I Make sure the ERT is on its own line (return before and after). Highlight the ERT and go to Edit > Language > English. I get the following file: #LyX 2.2 created this file. For more info see http://www.lyx.org/ \lyxformat 474 \begin_document \begin_header \textclass heb-article \begin_preamble \usepackage{fullpage} ...

5

Use xleftmargin: \documentclass[10pt]{article} \usepackage{minted,lipsum} \begin{document} \lipsum[1] \begin{minted}[xleftmargin=\parindent,linenos,breaklines]{text} Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus ...

1

Since you are using $as part of some script (for example$USER) TeXstudio will interpret that dollar sign as opening math mode and will highlight as well. So if you insert %$at the end of the line containing$ in the script code it will not have effect since it is a comment (%). And according to the solution you cited (I didn't tested) it should correct ...

1

The easiest way to deal with this would probably be to put the code in an external file (or a temp file, as in the example below) and then input the different segments at the appropriate points. \documentclass{beamer} \usepackage{minted} \begin{document} \begin{VerbatimOut}{minted.tmp} { "this": "is valid JSON", "but": "this is not!" } ...

2

Here's an approach that scans through each line and attempts to insert potential breaks at all possible locations, using \discretionary. Heiko Oberdiek's approach will probably be superior when the long strings are natural language and have existing hyphenation patterns. But it seems to allow at most one break, and doesn't break strings that mix letters and ...

7

The code is set in a environment Verbatim of package fancyvrb. The breaklines feature is an addition of package minted. The overlong lines are processed in macro \FV@SaveLineBox. The example patches this macro to add support for normal hyphenation. In font \ttfamily the hyphenation is usually disabled via a negative \hyphenchar, see question "Hyphenate ...

2

As per the FAQ, the currently installed version (as of this writing) is TeX Live 2014, which does not include the up to date version of minted. The FAQ also says to contact the Overleaf team with specific package requirements. However, an easier option is to just add the minted.sty file version 2.0 to your Overleaf project. Then this file will be used ...

2

The minted package just offers the \newminted facility, which has several limitations. You can profit of the powerful tcolorbox package, instead: \documentclass{article} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} \NewTCBListing{codeblock}{O{python}}{% %colback=white,colframe=white, listing only, minted language=#1, } \begin{document} ...

4

Your conjecture is true: \documentclass{memoir} \usepackage{minted} \usepackage{fontspec} % disable the default 'Ligatures=TeX' option \defaultfontfeatures{} \setmonofont{Courier} \begin{document} \begin{minted}{bash} 0-1--2---3 \end{minted} \end{document} If you want to have ligatures in running text also for the monospaced font, but not in ...

6

I think I found the cause of the problem. Your use of \RecustomVerbatimEnvironment seems to make the minted code unbreakable. If you omit this (and thereby also omit centering), your code is breakable: \begin{filecontents*}{script.txt} Bla bla bla bla bla. Blub blub blub. Bla bla bla bla bla. Blub blub blub. Bla bla bla bla bla. Blub blub blub. Bla bla bla ...

3

You can do it with tcolorbox. Customize the frame as you like. \documentclass{article} \usepackage[many]{tcolorbox} \tcbuselibrary{minted} \NewTCBListing[auto counter]{codefragment}{mo}{% before skip=\topsep, after skip=\topsep, colback=red!5!white,colframe=red!75!black, comment={\hfill(\thetcbcounter)\IfValueT{#2}{\listinglabel{#2}}}, listing ...

3

The error says ! Package minted Error: You must invoke LaTeX with the -shell-escape flag. So you have to use the flag -shell-escape when compiling, that is, use it before the name of the file. To do this, move %1.tex to the end. -interaction=nonstopmode -shell-escape %.tex

Top 50 recent answers are included