I want arrows…

I am using MMD → LaTex workflow. I’m so used to it just working (now…not always!) that I was surprised when the special characters: ➔➡︎➡︎ (bold right arrows) that I wanted to insert into my text caused an error:

My preamble does include the line (for UTF-8 support): \usepackage[utf8]{inputenc}

If i go onto LaTex bulletins, I know that I’ll be instructed in solutions that work by editing the .tex file, such as

etc. But I want to do this from within my Scrivener / MultiMarkdown file.

Anyone know: is it possible to find a workaround?

Thanks

If this is a one-off preamble command, then I would add it to one of the MMD tex support files – possibly mmd-memoir-packages.tex.

If, however, this is a recurring command you need every time you need an arrow then the simplest thing is to enclose the code in Scrivener with the comment markers, which will let it pass through MMD untouched:

<!--\DeclareUnicodeCharacter{2014}{\dash}-->

As it’s quite a chunk of code you could also set up a compile replacement, that would turn a defined combination of symbols into that code. Perhaps something like: ->b

That would be quick to type and wouldn’t impact too much on the legibility of the text as you are writing it.

Thanks MrGruff. Helpful ideas.

I was hoping to avoid having to utilise embedded tex commands for something like this, but looks like might not be possible.

I wonder whether there is anyway to discover which glyphs and symbols do translate readily into PDFLaTex, without embedded tex commands?

Regards.

Have you tried using XeTeX for the processing? It does a better job of handling UTF, but can sometimes mess up stylesheets that aren’t tuned for it.

AmberV

XeTex is completely new to me. Is there somewhere I can quickly get up to speed on how to use that in a Scrivner Multi l-markdown LaTex workflow kind of away?

Thnx.

It actually would not be all that different from what you are already doing. In fact, if you have installed the full MacTeX distribution, you already have XeTeX, and should be able to select it from the engine pull-down in TeXShop’s editor toolbar, or at the least just run pdfxetex (I believe that’s correct, I can’t confirm at the moment) from the command line in the same way you’d use pdflatex. So really, from the Scrivener angle, it is likely nothing would change. You just choose .tex output, the rest is up to you. One other nice thing about XeTeX is that you can use of modern fonts for typesettings—meaning just about anything your Mac can use.

And, if XeTeX does not work, you could consider the Replacements table pane in the compile settings. Just have it replace the unicode arrows you are currently using, with the embedded code.

The bonus here is that your text looks the way you want, there is only one thing to change (adding this new Replacement), and it can be tinkered with or even eliminated at any time without Project Replace.

  • asotir

Xetex is a good way forward. I’ve been using it for years to get Mac fonts in my documents.

The main things I had to change in TexShop preferences:

Typesetting tab: The Default command is set to Command listed below, which is XeLaTeX.

In the Misc tab: The personal script Tex Program is set to xetex. The Latex Program is set to xelatex.

Then, I think the only thing you need to do in the MMD support tex files is specify the fonts, using the fontspec package. I use:

\usepackage{fontspec} \setmainfont[Ligatures=TeX]{Optima} \setromanfont[Ligatures=TeX]{Optima} \setmonofont{Courier}

The extra Ligatures parameter ensures that en dashes come out properly (MMD converts en dashes to double hyphens which LaTeX then converts to en dashes: but XeLaTeX doesn’t do the second conversion – why would it – so the Ligatures makes sure it does).

You can either add that fontspec definition to mmd-memoir-packages.tex, or create a new file (e.g. mmd-xelatex-fonts.tex) and call it with an \input command.

Thanks, AmberV, asotir and MrGruff.

I’ll give that a go …