Suppressing LaTeX Output from Using Monospaced Fonts When Displaying Code

ajsimmons's Avatar


15 Sep, 2014 06:00 PM

I'm loving Scrivener/MMD/Latex workflow. Thanks for all your work on that. In the MMD Manual, Fletcher describes something that I would like to do—suppress LaTeX output from using monospaced fonts when displaying code, so that I can use that feature to quote verse without having the font change. As I'm typing and thinking about it at the same time, I'm guessing I need to put some LaTeX code in the preamble to the tex file. Here's the quote from the manual:

"If it’s not there, consider whether you can “hijack” an existing feature. For example, I needed to create a PDF to print a book of poetry. MMD didn’t have a “poetry” feature. But it did have code blocks, which are essentially the same thing, except poetry doesn’t usually use monospaced fonts. Voila, I used code blocks for all of the poems, and then changed the LaTeX output to refrain from using monospaced fonts when displaying code."

I tried to search for this, but without success—although I have to think it has already been asked and answered. If this is the wrong place to ask this question, please accept my apologies, chastise me and I'll move along! The more I think about it, this seems to be a LaTeX question, because the MMD is working great to define the text as code, I just need the LaTeX bit to get it finished up. (But some direction would be greatly appreciated!)

Again, many thanks to all the wonderful folks who have provided so much useful information in the various forums.

A Simmons

  1. Support Staff 1 Posted by fletcher on 15 Sep, 2014 07:41 PM

    fletcher's Avatar

    The way I did it at the time was the the XHTML HTML->LaTeX transformer,
    but the same concept applies to MMD-3 and MMD-4:

    That file shows the LaTeX code that was used to wrap the poetry blocks.
      Code blocks are normally just wrapped in a `verbatim`.

    You could modify the source of MMD to treat all LaTeX code blocks as
    "poetry" and have a poetry variant of MMD. Or you could create a script
    that finds/replaces the old verbatim blocks and replaces them with the
    new block from the above file (adjustwidth/verbatim combination).


  2. fletcher closed this discussion on 09 Nov, 2018 04:44 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

11 Jan, 2022 02:33 PM
23 Nov, 2021 07:46 PM
10 Jun, 2021 11:53 AM
10 Jun, 2021 01:15 AM
17 Dec, 2020 03:23 PM

Recent Articles