LyXThe ' font in code listing (Matlab).

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
User avatar
CrocoDuck
Posts: 8
Joined: Mon Oct 20, 2014 6:35 pm

The ' font in code listing (Matlab).

Post by CrocoDuck »

Hi cool people!
I have some Matlab code in a listing in lyx, and everything is working exactly as I want it... except one thing.

When I copy and paste the code the ' font doesn't get copied properly. Instead of ' (single straight quote) the font copied is ’ (single curly quote). I have no idea how to fix it... googling have not been helpful.

Here my preamble:

Code: Select all

%\renewcommand\thesection{\arabic{section}}
%\renewcommand\thesubsection{\thesection.\alph{subsection}}
%\def\thesection{\alph{subsection}}

\usepackage[titletoc]{appendix}

%\usepackage{hyperref}
\usepackage{url}

%\urlstyle{same}

\AtBeginDocument{\urlstyle{APACsame}}

\usepackage{alltt}
\usepackage{color}
\definecolor{string}{rgb}{0.7,0.0,0.0}
\definecolor{comment}{rgb}{0.13,0.54,0.13}
\definecolor{keyword}{rgb}{0.0,0.0,1.0}
%\setcounter{tocdepth}{3}
Here the advanced settings of my listing:

Code: Select all

commentstyle={\color{comment}}
keywordstyle={\color{keyword}}
stringstyle={\color{string}}
morekeywords={matlab2tikz}
columns=fullflexible
all the rest has been set from the listing GUI. Hope you can help, I have a submission tomorrow (damn me I am always late!)...
Last edited by CrocoDuck on Fri May 22, 2015 3:29 am, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

CrocoDuck
Posts: 8
Joined: Mon Oct 20, 2014 6:35 pm

The ' font in code listing (Matlab).

Post by CrocoDuck »

Dear friends, I think I figured out a solution:

add this to the preamble:

\usepackage{textcomp}

add this to the code listing advanced options:

upquote=true


Seems I can copy and paste the code correctly now. I will report if issues!
Post Reply