2

I need to emphasise one entries in this liste of number, but I can't seem to use \textbf{} or something similar in within a minted workspace. How do I emphasise certain within minted?

\documentclass[11pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[toc,page]{appendix}

\usepackage{listings}
\usepackage{minted}
\usepackage{fullpage}
\begin{document}

\begin{listing}[H]
    \centering
    \begin{minted}[autogobble,xleftmargin=0.1\textwidth,xrightmargin=0.1\textwidth,frame=single]{bash}
        [[  1.21105916e-03   9.98751879e-01   3.69788831e-05]]
        [[  9.31845248e-01   8.14934465e-05   6.80731535e-02]]
        [[  2.51991690e-08   1.38797950e-05   9.99986053e-01]]
        [[  2.20720409e-04   3.13331257e-05   9.99747932e-01]]
        [[  2.88604596e-03   9.97110307e-01   3.71164833e-06]]
        [[  9.65342045e-01   1.14912807e-04   3.45430225e-02]]
        [[  9.35987046e-05   2.29562909e-04   9.99676824e-01]]
        [[  3.64742687e-06   1.02245028e-03   9.98973966e-01]]
        [[  9.98075962e-01   1.79647308e-04   1.74431293e-03]]
        [[  7.45317191e-02   9.24890220e-01   5.78058825e-04]]
        [[  4.23816502e-01   1.95193406e-05   5.76164007e-01]]
        [[  5.45647919e-01   1.01446029e-04   \textbf{4.54250574e-01}]]
        ....
    \end{minted}
\end{listing}

\end{document}

enter image description here

  • Is this supported in sharelatex?... @koleygr – dfh Sep 27 '17 at 15:20
  • sharelatex just runs latex... It is not a new language (you just use their service to avoid installing for some reason). see here related: tex.stackexchange.com/questions/260551/minted-mathescape. Also why minted inside listing? – koleygr Sep 27 '17 at 15:23
  • Listing is used for adding caption and label... The reason why I ask whether it is supported on sharelatex, is as it doesn't work.. I am able to get it into normal text format, but not in bold – dfh Sep 27 '17 at 15:28
  • Ok... trying now... – koleygr Sep 27 '17 at 15:30
  • removing my comment... it doesn't work... but looking to find it – koleygr Sep 27 '17 at 15:35
2

This works:

\documentclass[11pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{bm}

\usepackage[toc,page]{appendix}

\usepackage{listings}
\usepackage{minted}
\usepackage{fullpage}
\begin{document}


    \begin{minted}[escapeinside=||,autogobble,xleftmargin=0.1\textwidth,xrightmargin=0.1\textwidth,frame=single]{python}
        [[  1.21105916e-03   9.98751879e-01   3.69788831e-05]]
        [[  9.31845248e-01   8.14934465e-05   6.80731535e-02]]
        [[  2.51991690e-08   1.38797950e-05   9.99986053e-01]]
        [[  2.20720409e-04   3.13331257e-05   9.99747932e-01]]
        [[  2.88604596e-03   9.97110307e-01   3.71164833e-06]]
        [[  9.65342045e-01   1.14912807e-04   3.45430225e-02]]
        [[  9.35987046e-05   2.29562909e-04   9.99676824e-01]]
        [[  3.64742687e-06   1.02245028e-03   9.98973966e-01]]
        [[  9.98075962e-01   1.79647308e-04   1.74431293e-03]]
        [[  7.45317191e-02   9.24890220e-01   5.78058825e-04]]
        [[  4.23816502e-01   1.95193406e-05   5.76164007e-01]]
        [[  5.45647919e-01   1.01446029e-04  |$\bm{4.54250574e-01}$|]]
        ....
    \end{minted}


\end{document}

Output:

enter image description here

This is using text:

\documentclass[11pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{bm}

\usepackage[toc,page]{appendix}

\usepackage{listings}
\usepackage{minted}
\usepackage{fullpage}
\begin{document}


    \begin{minted}[escapeinside=||,autogobble,xleftmargin=0.1\textwidth,xrightmargin=0.1\textwidth,frame=single]{python}
        [[  1.21105916e-03   9.98751879e-01   3.69788831e-05]]
        [[  9.31845248e-01   8.14934465e-05   6.80731535e-02]]
        [[  2.51991690e-08   1.38797950e-05   9.99986053e-01]]
        [[  2.20720409e-04   3.13331257e-05   9.99747932e-01]]
        [[  2.88604596e-03   9.97110307e-01   3.71164833e-06]]
        [[  9.65342045e-01   1.14912807e-04   3.45430225e-02]]
        [[  9.35987046e-05   2.29562909e-04   9.99676824e-01]]
        [[  3.64742687e-06   1.02245028e-03   9.98973966e-01]]
        [[  9.98075962e-01   1.79647308e-04   1.74431293e-03]]
        [[  7.45317191e-02   9.24890220e-01   5.78058825e-04]]
        [[  4.23816502e-01   1.95193406e-05   5.76164007e-01]]
        [[  5.45647919e-01   1.01446029e-04   |\bfseries{4.54250574e-01}|]]
        ....
    \end{minted}


\end{document}

Output:

enter image description here

But if I change to text seems that can not accept \bfseries but works with bf:

\documentclass[11pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{bm}

\usepackage[toc,page]{appendix}

\usepackage{listings}
\usepackage{minted}
\usepackage{fullpage}
\begin{document}


    \begin{minted}[escapeinside=||,autogobble,xleftmargin=0.1\textwidth,xrightmargin=0.1\textwidth,frame=single]{text}
        [[  1.21105916e-03   9.98751879e-01   3.69788831e-05]]
        [[  9.31845248e-01   8.14934465e-05   6.80731535e-02]]
        [[  2.51991690e-08   1.38797950e-05   9.99986053e-01]]
        [[  2.20720409e-04   3.13331257e-05   9.99747932e-01]]
        [[  2.88604596e-03   9.97110307e-01   3.71164833e-06]]
        [[  9.65342045e-01   1.14912807e-04   3.45430225e-02]]
        [[  9.35987046e-05   2.29562909e-04   9.99676824e-01]]
        [[  3.64742687e-06   1.02245028e-03   9.98973966e-01]]
        [[  9.98075962e-01   1.79647308e-04   1.74431293e-03]]
        [[  7.45317191e-02   9.24890220e-01   5.78058825e-04]]
        [[  4.23816502e-01   1.95193406e-05   5.76164007e-01]]
        [[  5.45647919e-01   1.01446029e-04   |\bf{4.54250574e-01}|]]
        ....
    \end{minted}


\end{document}

Output:

enter image description here

  • You change the format from bash to text, but its ok... – dfh Sep 27 '17 at 16:03
  • @dfh, the funny thing is that I am working on debian... (Anyway... please if you agree, change your title to "bold letters within minted (bash/text)" ... this way it will be more helpful I think.) – koleygr Sep 27 '17 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.