TransWikia.com

in source code comments $ gets turned into £

TeX - LaTeX Asked on April 30, 2021

I’m creating pdfs of source code using the minted package… and surprised to see $ get turned into £.

pdflatex --shell-escape create_array.tex is the command. create_array.tex looks like:

documentclass[varwidth=20.06cm,border=2mm]{standalone}

usepackage{minted}
usemintedstyle{solarized}

begin{document}
begin{LARGE}
  inputminted[firstline=2,lastline=11,firstnumber=1]{php}{create_array.php}
end{LARGE}
end{document}

and create_array.php looks like:

<?php
// create an indexed array named $var with default indexing
$var = array('item1', 'item2', 'item3');
print_r($var);/* prints:
Array
 (
  [0] => item1
  [1] => item2
  [2] => item3
 )
*/

the $ in the first code comment is getting transformed when it should not be…
enter image description here

The create_array.php file cannot be changed. The solution must be done in the .tex file. How can I prevent this odd transformation from happening?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP