How to specify the font used for word doc exported using pandoc?

Minnow

Rendering a microsoft word document using pandoc. The font seems to default to Calibri for headings and Cambri for body text. Goal is to have the file use Arial or Times roman fonts.

I don't want to touch/edit/have anything to do with the file in word.

How can I set the font that will be used in Word™ from either the multi-markdown source or in the call to pandoc?

Pandoc command:

pandoc -s my_markdown.txt -o whycambriafont.docx

This question: pandoc-generated docx misses italic variables in equations shows a way to edit the font styles by creating a zip and then editing the style files, but is a kludge.

mb21

You can supply a reference.docx file with the --reference-doc option to pandoc which acts sort of like a template.

  1. Generate a file with echo 'hello word' | pandoc -o reference.docx or similar.
  2. Change the font in the style. Either by opening the file in Word, changing the style and saving it, or alternatively opening it for example with vim:
    • Rename the reference.docx to reference.zip
    • vim reference.zip and select reference/theme/theme1.xml
    • find and change Calibri to Arial
    • save and rename zip back to docx
  3. Profit: use with pandoc --reference-doc reference.docx

See also Defining-custom-DOCX-styles-in-LibreOffice-(and-Word).

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How do I create a dropdown list in a word doc that is using a template?

分類Dev

C# - How to open a doc with word using arguments

分類Dev

How to send "<" characters to Word documents (.doc, docx) using Sendkeys method

分類Dev

How to specify CMake version used by vcpkg

分類Dev

How to specify word vector for OOV terms in Spacy?

分類Dev

How to set the font used for plots in Matlab to the default Latex font?

分類Dev

How should I use Arial font while creating word-cloud while using Python3 in Google-Colab?

分類Dev

How does Pyspark Calculate Doc2Vec from word2vec word embeddings?

分類Dev

R: how to change font and alignment of text in knitr word

分類Dev

How to know which font is used by browser from CSS font-family list?

分類Dev

How print python method documentation using inspect or __doc__ method

分類Dev

how to delete sub doc only on expire using mongoose?

分類Dev

How to remove ligatures from a font using FontForge

分類Dev

how to create a "shortcut" in Microsoft Word for frequently used actions

分類Dev

What font will be used for PDFs if Helvetica font unavailable

分類Dev

Search for the date of today in a Word doc filled with dates

分類Dev

how to compare first word in a line with the last word using sed?

分類Dev

cluster-ssh: specify terminal font

分類Dev

How to run pandoc with a keybinding in Vim?

分類Dev

How do I specify a zone offset in a DateTimeFormatterBuilder without using a pattern?

分類Dev

How to specify the axis when using the softmax activation in a Keras layer?

分類Dev

How to specify a custom error message in android using cognito

分類Dev

How to specify the type of a function input and output without using assert?

分類Dev

How to specify a composite primary key using EFCore Code First Migrations

分類Dev

How to specify "namespace" and "conformsto" attribute to APIs for services developed using ServiceStack?

分類Dev

How to specify output .apk file path when using fastlane gradle?

分類Dev

How do I specify a boolean command line flag using Clap?

分類Dev

how to specify a null key when using util:map

分類Dev

How to predict next word using Embedding

Related 関連記事

  1. 1

    How do I create a dropdown list in a word doc that is using a template?

  2. 2

    C# - How to open a doc with word using arguments

  3. 3

    How to send "<" characters to Word documents (.doc, docx) using Sendkeys method

  4. 4

    How to specify CMake version used by vcpkg

  5. 5

    How to specify word vector for OOV terms in Spacy?

  6. 6

    How to set the font used for plots in Matlab to the default Latex font?

  7. 7

    How should I use Arial font while creating word-cloud while using Python3 in Google-Colab?

  8. 8

    How does Pyspark Calculate Doc2Vec from word2vec word embeddings?

  9. 9

    R: how to change font and alignment of text in knitr word

  10. 10

    How to know which font is used by browser from CSS font-family list?

  11. 11

    How print python method documentation using inspect or __doc__ method

  12. 12

    how to delete sub doc only on expire using mongoose?

  13. 13

    How to remove ligatures from a font using FontForge

  14. 14

    how to create a "shortcut" in Microsoft Word for frequently used actions

  15. 15

    What font will be used for PDFs if Helvetica font unavailable

  16. 16

    Search for the date of today in a Word doc filled with dates

  17. 17

    how to compare first word in a line with the last word using sed?

  18. 18

    cluster-ssh: specify terminal font

  19. 19

    How to run pandoc with a keybinding in Vim?

  20. 20

    How do I specify a zone offset in a DateTimeFormatterBuilder without using a pattern?

  21. 21

    How to specify the axis when using the softmax activation in a Keras layer?

  22. 22

    How to specify a custom error message in android using cognito

  23. 23

    How to specify the type of a function input and output without using assert?

  24. 24

    How to specify a composite primary key using EFCore Code First Migrations

  25. 25

    How to specify "namespace" and "conformsto" attribute to APIs for services developed using ServiceStack?

  26. 26

    How to specify output .apk file path when using fastlane gradle?

  27. 27

    How do I specify a boolean command line flag using Clap?

  28. 28

    how to specify a null key when using util:map

  29. 29

    How to predict next word using Embedding

ホットタグ

アーカイブ