Error message in TexShop

I compiled my .scriv as a MMD->LaTex and type set it in TexShop. Unfortunately it spits out the error message Command \quotedblbase unavailable in encoding OT1

In Scrivener the passage that causes the error message looks like „Big-Bang“ and in the .tex file it changed to ‚ÄûBig-Bang``. I’m writing in German hence the German quotation marks.

Do I have to change something within the preferences? I activated typographer’s quotes (German) and SmartyPants Language German, too. Is that correct?

Where can be the mistake?

I’m sure an MMD expert will be able to put you right better than me, but I think you need to set the Compile Draft options to straighten the smart quotes and then just let SmartyPants turn the straight quotations into markup that MMD understands.

No, still the same error message… Though for a second I hoped it would be that easy! :slight_smile:

I would try taking the file in shorter steps to see where the problem is occurring first. Instead of using the MMD -> LaTeX exporter in Scrivener, use the plain MultiMarkdown exporter. This will give you a text file which Scrivener generates. Ordinarily this file is saved temporarily and fed to the MMD scripts automatically. Producing this copy allows you to run MMD yourself and examine the intermediate step.

Open that in a text editor and verify that the quotation marks are in fact “straightened”. If not, use the text editor to do this yourself, save the file, and then process it manually (if you are not sure how to do that, you might need to download a stand-alone copy of MultiMarkdown, which is useful to have around anyway).

You’ll get English quotes by following that process (unless you have the MMD meta-data “Language” field set appropriately). To get German typography, you’ll need to add “Language: german” to the top meta-data section. This isn’t necessary when using Scrivener’s export function; it handles that for you. If you can get things working manually, hopefully you can apply changes to rectify the problem and restore a fully automatic workflow.

One neat trick is that Scrivener will use your installed version of MultiMarkdown (providing you placed it in ~/Library/Application Support/MultiMarkdown). So whatever modifications you make to the Perl scripts getting things to work will be utilised by Scrivener in the future.

The MakrDown .txt seems to be fine. Is there anywhere nicely explained how to process the raw file manually except the five sentence “general instruction”? It’s the terminal I’ve to use, right?

Basically I’ve no idea how to specify the location of my .txt file. Where is the default place if I follow the instructions (I understand where to put the MMD folder…)?

cd MultiMarkdown bin/ file.txt > file.html

I’m afraid this gets into Terminal 101.

You could do most of this without using Terminal. First, unzip the file and drag the folder into ~/Library/Application Support/. Then just drag the text file that Scrivener created into the MultiMarkdown folder. Now start Terminal.

$ cd ~/Library/Application\ Support/MultiMarkdown $ bin/ Scrivener_Export.txt > test_quotes.tex

Now you should be able to double-click on the “test_quotes.tex” file in Finder to open it in TeXShop.

Note, as a bit of a “101” hint, you can press at any point while typing in Terminal to complete words. For example, in the first line you could type up to “…Applic”, press and the rest of it will be typed for you. Naturally, this only works for things that already exist.

Awesome! We’re getting closer. As I read on one should try the txt->xhtml->tex route if something goes wrong. Tried that and I still get the error.

The problematic piece of text in the .xhtml looks the following (Big-Bang is my word I put into quotes):
Searching for that in Google I found out that „ must be the German first quotation mark (in German first one is down, last one is up), “ the second one. Fine…
Transforming the .xhtml into .tex obviously causes the problem. Do I need to tweak the

Okay, tried two things.
1: Replaced all „ and “ with straight quotes in the .xhtml. Still gives me the error in TexShop.
2: Then deleted the language:German line in the .xhtml. Gives me a nice PDF in TexShop but of course with English quotes.

What can I do to get my German quotes? :slight_smile:

Update: Found the solution (what a great feeling). I needed to put in the \usepackage[ngerman]{babel} anyway to get German chapters. With the straightened quotes in the .xhtml, the language:German on and \usepackage[ngerman]{babel} I was able to output a PDF with German quotes and chapters/Kapitel. YES!

I agree, it looks like everything is going as it should up to the XHTML point. That’s good news, as it means Scrivener, SmartyPants, and the first stage of MultiMarkdown are all working together the way they should be.

There are several files that do the heavy lifting in getting an XHTML converted to a valid LaTeX file, and these are all located in the XSLT directory. The file which handles text cleaning is appropriately named, clean-text.xslt, and you’ll just have to hunt through there to look for the quotation mark replacement lines, and adjust it so that it produces proper LaTeX quotes (I would duplicate the file first before editing it; that way you can always safely revert). I am not sure what that looks like for German. I have always assumed they look like ordinary (``Big-Bang’’) syntax and it is the TeX rendering that produces typographic localisation, but I would be wrong. You just need to make sure there is a converter for #8222 in that file, and that #8220 creates syntax pointing in the right direction. (Check around line 160)

Update: Ah, excellent, glad you found a non-painful solution. You can add that preamble line into one of the XSLT files so that happens automatically in the future. It looks like the workflow you want is probably similar to what I would have guessed. Just work in Scrivener as though using English punctuation, typing with straight-quotes and not using German SmartyPants processing. Then let LaTeX do all of the dirty work. As long as you do not need to create web pages that should be fine.

Don’t forget to set the font encoding!


EDIT: Ok, maybe I should give a better explanation of what’s going on behind the scenes in your LaTeX file. First of all, the error you’ve encountered has nothing do with Scrivener or MMD, it’s a TeX thing! The default font encoding in LaTeX is ‘OT1’, which is suitable for english material, but lacks some characters necessary for typesetting german texts.


You’ve entered a character in your document that is not defined in ‘OT1 font encoding’, which means that TeX does not know to which glyph in the current font the requested character should be mapped. By loading the ‘german’ option of the ‘babel’ package you’ve defined a command named \quotedblbase in OT1 encoding (which happens to be an alias for the german quotation mark you’ve used in your .tex file. I think the ‘utf8’ input encoding is responsible for that). So now you got a mapping for your character and TeX seems to be happy.

The problem with your ‘babel solution’ is that you’ll only get a fake quotation mark. The ‘babel’ package simply lowers the baseline of an english quotation mark to compose the glyph. The canonical solution is to use a font encoding that has the character you want, which happens to be ‘T1’ aka Cork for german documents. As a bonus, you’ll also get correct german hyphenation, which is not possible with ‘OT1’ and the ‘german’ option alone (the fake umlauts do not work with the german hyphenation patterns).

Hi there!

Thanks for the hint to use the


That works fine and tex produces a correct pdf. But inside the tex-file the characters are displayed incorrect as something else than the double low-9 quote. It’s also the same for the german umlaute (eg. ä,ö,ü, …) Any idea how to fix that?

thx a lot, matz

%!TEX encoding = UTF-8 Unicode