Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update defaults.md with export to Word docx #155

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

do-not-perceive-me
Copy link

Information about Word Reference docx and defaults file. Small addition of noting that the default files are found in Assets manager.

Information about Word Reference docx and defaults file. Small addition of noting that the default files are found in Assets manager.

#### Reference Document

Use an existing Word document or download the reference.docx from Pandoc and change the styles. Your reference doc is a Word file that you format to your preferences. You need to adjust the Word Styles (Paragraph, Heading, Body Text, Footnote Text, etc) for it to apply.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pandoc explicitly states to NOT use any word document. Instead, try the following (please adapt the wording):

You can either download the reference file from the Pandoc repository or use the Pandoc that ships with Zettlr to export it

And then provide both methods, i.e.:

Download:

  1. Open https://github.com/jgm/pandoc/tree/master/data/docx
  2. Click on the three dots
  3. Select "Download directory"
  4. ZIP the directory, and then exchange ".zip" to ".docx"

Pandoc CLI: pandoc -o custom-reference.docx --print-default-data-file reference.docx

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the repository, I don't see the download directory option, I only have the option to download the whole pandoc repository as a .zip

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouh, alright, then it's probably the GitHub extension I have installed. Then … nevermind. Feel free to adapt the wording so that it's correct (zipping that directory and renaming it from .zip to .docx will still work)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do that and it didn't work for me. I think it worked in the past though, so I assume it'll work for others. I included it in the updated file anyways.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a request, but maybe you could include a copy of the reference documents in the Zettlr or Zettlr docs repos, and then add a link to it in documentation, so that it's easier for people to find and download.

I don't really have much experience with command lines or github, so personally, it was a complicated and time consuming experience in trying to find the reference document to edit. I couldn't figure out where Pandoc was saving the doc or what I needed to change for it to show up or how to download it from github.

@@ -79,3 +79,47 @@ variables:
```

You can also make use of this templating system yourself. If you want to write a custom template, you can add statements such as `$if(myvariable)$$myvariable$$endif$` and insert the variable `myvariable` into any frontmatter or defaults file, and it will be replaced with whatever value you set it to.


### Microsoft Word Template (.docx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add the fact that exactly the same holds true for ODT-documents and PowerPoint presentations.

Copy link
Member

@nathanlesage nathanlesage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things, mainly wording, but other than that it looks pretty good! Thank you already for the work.


Use an existing Word document or download the reference.docx from Pandoc and change the styles. Your reference doc is a Word file that you format to your preferences. You need to adjust the Word Styles (Paragraph, Heading, Body Text, Footnote Text, etc) for it to apply.
For best results, it is recommended to download the reference document directly from Pandoc. It should already be installed with Zettlr, but if not, see [Pandoc installation](https://docs.zettlr.com/en/installing-pandoc/) instructions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use Pandoc to spit it out on the command line, it does not necessarily constitute a "download", so I would rephrase to:

For best results, it is recommended to retrieve the reference document directly from Pandoc. It comes bundled with Zettlr, but if not, see the Pandoc installation instructions.

Use an existing Word document or download the reference.docx from Pandoc and change the styles. Your reference doc is a Word file that you format to your preferences. You need to adjust the Word Styles (Paragraph, Heading, Body Text, Footnote Text, etc) for it to apply.
For best results, it is recommended to download the reference document directly from Pandoc. It should already be installed with Zettlr, but if not, see [Pandoc installation](https://docs.zettlr.com/en/installing-pandoc/) instructions.

##### Option 1: Using Pandoc from Command line or Terminal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since option 2 is definitely more cumbersome, I would suggest to remove that option and only leave this option.


##### Option 1: Using Pandoc from Command line or Terminal

In the command line: `pandoc -o "custom-reference.docx" --print-default-data-file reference.docx`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrase:

In order to retrieve a reference document, run any of the following commands to create the file custom-reference.docx, custom-reference.pptx, or custom-reference.odt:

And then list all three, but in a codeblock


In the command line: `pandoc -o "custom-reference.docx" --print-default-data-file reference.docx`

To adjust the name or location of where the document is saved, you can change `"custom-reference.docx"` to include the absolute path: `"/Users/[user]/Downloads/project-reference.docx"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the path only applies to macOS, I would suggest to say the following (or something along these lines): " … to include the absolute path, e.g., for macOS you could use …"


To adjust the name or location of where the document is saved, you can change `"custom-reference.docx"` to include the absolute path: `"/Users/[user]/Downloads/project-reference.docx"`

##### Option 2: Download from Pandoc Github repository
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this option

@@ -113,13 +156,18 @@ self-contained: true
etc.
```

More options for the writer can be found [here](https://pandoc.org/MANUAL.html#options-affecting-specific-writers-1), including options for numbered headings, the table of contents, etc.
Zettlr will search for the reference document in the same directory as the Markdown files that you're exporting. If you want different formatting for different projects and files, it can be convenient to have a custom-reference.docx within each of those folders.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? Never tried this myself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it definitely works! I have a different custom-reference.docx for each project, and as long as they're in the correct folder, Zettlr uses the right one, which is really convenient for all the different types of reports I need.

3. Change the Defaults file in Assets Manager to include that file
4. Adjust any other parameters in the Defaults Manager.
5. Export as Word Document
1. Download the custom-reference.docx from Pandoc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Download the custom-reference.docx from Pandoc
1. Retrieve the appropriate reference document from Pandoc

4. Adjust any other parameters in the Defaults Manager.
5. Export as Word Document
1. Download the custom-reference.docx from Pandoc
2. In Word, change the format of that document using Styles Pane or Organizer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. In Word, change the format of that document using Styles Pane or Organizer
2. In Word, change the format of that document using Styles Pane or Organizer; analogously with OpenDocument documents

5. Export as Word Document
1. Download the custom-reference.docx from Pandoc
2. In Word, change the format of that document using Styles Pane or Organizer
3. Place that .docx in the same folder with Markdown files for this export or get the absolute path name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Place that .docx in the same folder with Markdown files for this export or get the absolute path name
3. Place that reference file in the same folder as the Markdown files for this export or get the absolute path name

3. Place that .docx in the same folder with Markdown files for this export or get the absolute path name
4. Adjust the Defaults file in Zettlr Assets Manager to include that file name
5. Adjust any other parameters in the Defaults Manager
6. Export as Word Document in Zettlr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6. Export as Word Document in Zettlr
6. Export using the appropriate exporter profile in Zettlr

Need to format the image still and upload it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants