# Force straight quotes in font (turn off smart quotes)

**URL:** <https://pressbooks.community/t/force-straight-quotes-in-font-turn-off-smart-quotes/4678>\
**Category:** Custom CSS, Styling, Themes\
**Created:** [September 15, 2026, 1:40am UTC](https://pressbooks.community/t/force-straight-quotes-in-font-turn-off-smart-quotes/4678 "2026-09-15T01:40:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathcobcroft](https://pressbooks.community/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@kathcobcroft](https://pressbooks.community/u/kathcobcroft)\
**Post date:** [September 15, 2026, 1:40am UTC](https://pressbooks.community/t/force-straight-quotes-in-font-turn-off-smart-quotes/4678/1 "2026-09-15T01:40:45Z")

</div>

We’re using a monospace font (Courier New) to show programming code in a book and automatically getting smart quotes applied to it (i.e. start and end quotes are angled instead of straight).

Is there a way to stop Pressbooks applying smart quotes to a section of the text, or to add this to the theme as a whole? Our author says that the smart quotes will cause an error if his students copy and paste them.

---

<div class="post-metadata">

**Author:** ![MichSpieler](https://pressbooks.community/user_avatar/pressbooks.community/michspieler/32/1528_2.png) [@MichSpieler](https://pressbooks.community/u/MichSpieler)\
**Post date:** [September 15, 2026, 1:40pm UTC](https://pressbooks.community/t/force-straight-quotes-in-font-turn-off-smart-quotes/4678/2 "2026-09-15T13:40:13Z")

</div>

The way many authors do this is to use pre and code tags around the code snippet `<pre><code>print("hello")</code></pre>`  
They add the code directly in the Code editor (as opposed to the Visual editor) in Pressbooks.  
A few things to consider:

- the quotes you enter must already be straight quotes (this may not be the case if content is copied from Word or Google Docs)
- any literal `<`, `>`, or `&` inside the code must be escaped as `&lt;`, `&gt;`, `&amp;`
- `<pre>` doesn’t wrap lines typically, so you may have to add custom CSS to achieve that if desired
- this should work well for the Webbook and probably the EPUB, it probably would not work for the PDF

---

<div class="post-metadata">

**Author:** ![kathcobcroft](https://pressbooks.community/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@kathcobcroft](https://pressbooks.community/u/kathcobcroft)\
**Post date:** [September 22, 2026, 1:03pm UTC](https://pressbooks.community/t/force-straight-quotes-in-font-turn-off-smart-quotes/4678/3 "2026-09-22T13:03:09Z")

</div>

Thanks! That worked for us 🙂
