Suppressing LaTeX Output from Using Monospaced Fonts When Displaying Code

ajsimmons's Avatar

ajsimmons

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:

    https://github.com/fletcher/MultiMarkdown/blob/master/XSLT/memoir-poetry.xslt

    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).

    Fletcher

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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

22 Apr, 2018 11:04 PM
13 Apr, 2018 10:58 PM
09 Apr, 2018 09:47 PM
09 Apr, 2018 04:28 PM
19 Feb, 2018 10:29 PM

Recent Articles