Get rid of file name and date in VScode markdown - visual-studio-code

I am very new to markdown. I use VScode editor with Markdown All in One and Markdown PDF extensions.
Let's say I open test.md file and write the following text
### This is my first markdown text
Hello
When I export the text into pdf, using Ctrl+Shift+P - markdown-pdf: Export (pdf), I get the following output:
The question is, how do I get rid of the name and the date in the upper part of the page?

Please refer to Markdown-Pdf's README doc,in the chapter Options,disable the markdown-pdf.displayHeaderFoote may solve your problem.

Related

Change title of untitled tab in Visual Studio Code

I'm building a VS Code extension which includes changing the name/title of untitled-1 tab (unsaved file).
I tried running the below code in debugger console of extension but it didn't reflect in the editor:
vscode.workspace.textDocuments[0].fileName="myFile"
Is it not possible or am I missing something?
It is still (Q1 2020) not possible, but the next VSCode 1.42 will name its Untitled editors differently.
Untitled editors in VS Code are text buffers that have not yet been saved to disk.
You can leave them open for as long as you like and all text content is stored and restored between restarts.
Untitled editors were given generic names such as Untitled-1 and counting upwards.
In this release, untitled editors will use the content of the first line of the document for the editor title, and include the generic name as part of the description:
Note: If the first line is empty or does not contain any words, the title will fall back to Untitled_* as before.
So while you cannot set the title yourself (still readonly fileName), technically... changing the first line of that file would be enough to change the title of said "Untitled" editor.
With VSCode 1.43 (Q1 2020), a new setting workbench.editor.untitled.labelFormat allows to control whether untitled editors should use the contents as title or not.
Possible values are content or name.
Configure 'workbench.editor.untitled.labelFormat': 'name' to get the previous behavior back where untitled editors would have a short title, such as Untitled-1.
It's not possible - if you check out the source code for the API definition in vscode.d.ts, you'll see that fileName is declared as readonly:
export interface TextDocument {
// ...
readonly fileName: string;
// ...
}
Unfortunately, it seems that the readonly attribute isn't reflected in the API docs on the website.
This mainly happens if we create a new file in the OPEN EDITORS section, thus they appear as unsaved. To prevent this, create a folder for storing your files, and then in that folder, create your new file then it will show options to name it, also you can add a file type extension like .cpp.
TIP: vsc-rename-files extension to rename your files.

Visual Studio Code html formatting doesn't work

Code formatting doesn't seem work in Visual Studio Code. I have tried with shift+alt+f, but it wouldn't format html code. I run ctrl+shift+p and type Format and only option I have is Format Document(shift+alt+f) and Format Selection (don't have Format code). I don't understand what I' doing wrong? Do I need to install some kind of extension in order for this formatting to work on html files?
This worked for me:
Right click inside html file that is being edited.
Select "Format Document With...".
Selected "Configure Default Formatter ...".
Changed from "Prettier - Code formatter" to "HTML Language Features".
This worked for me in Visual Studio 2015 (VS2015):
Right-click on the code window with the HTML you want to format
Click 'Un-minify" in the popup menu.
That worked for me when Format Document (Ctrl-K, Ctrl-D) and Format Selection (Ctrk-K, Ctrl-F) failed to format HTML that I pasted into a Visual Studio HTML document.
There are two scenarios here
You are editing an html file with a non-standard html extension. Find fix #1 below.
You are editing a non-html file with html embedded. For this scenario find fix #2.
Both fixes involve installing the Beautify extension so do that first.
Fix 1
To fix this issue, you will need to update your js-beautify extension properties to include those types. From the Beautify documentation:
You can contol which file types, extensions, or specific file names should
be beautified with the beautify.language setting.
{
"beautify.language": {
"js": {
"type": ["javascript", "json"],
"filename": [".jshintrc", ".jsbeautifyrc"]
// "ext": ["js", "json"]
// ^^ to set extensions to be beautified using the javascript beautifier
},
"css": ["css", "scss"],
"html": ["htm", "html"]
// ^^ providing just an array sets the VS Code file type
}
}
Fix 2
In this case when you run the beautify command (after installing the extension) it will prompt you for the language type. Select html and voila.
You might have some error in your html document like maybe you forgot to close a tag. I had the same problem but after fixing that error code formatting works well. If you have a large file then try pasting your code here and validating it here

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

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.
You can supply a reference.docx file with the --reference-doc option to pandoc which acts sort of like a template.
Generate a file with echo 'hello word' | pandoc -o reference.docx or similar.
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
Profit: use with pandoc --reference-doc reference.docx
See also Defining-custom-DOCX-styles-in-LibreOffice-(and-Word).

How can I output the code for my model into a word document without taking a screen shot?

I want to include an example of my model code within my project report. I have tried taking a screenshot of my code but it is just too long to be legible. I am therefore wondering if it is possible to output an image of my model code that has not been minimised or cut up into a word document for annotation?
(I assume the reason you don't just copy and paste is that you want to preserve the colors?)
Use “Save as Applet” on the File menu. From the resulting HTML file, cut out the applet part and just keep the code part.
Direct support for "Save as HTML" is coming in NetLogo 6.0; see https://github.com/NetLogo/NetLogo/issues/645.
If Seth guessed wrong and you just need a monospace font, you can just copy (ctrl-A,ctrl-C) in the Code tab, paste into your Word document, and set the font to any monospace font (like Courier New).
If Seth guessed correctly and you want syntax highlighting, you can get the Vim syntax file, open your NetLogo file in Vim, select the code range, and then use Vim's TOhtml command. You can then read this HTML file into your Word document.
Note that using Word for reports involving code is a terrible idea: the code will immediately be out of sync, as soon as you make further changes. Instead, learn LaTeX use the listings package to read your code into your document.

emacs org mode : How to select a page style when exporting to odt?

I am exporting an org document to odt using org-odt-export-to-odt (Org-mode version 8.2.6 and emacs 23) and I would like the first page to get the OrgFirstPage style and the following pages to get the OrgPage style.
I tried using a custom style file created by exporting an empty org file to odt and modifying it with LibreOffice so that the first page has the OrgFirstPage style and the second one has the OrgPage style. I referenced it in my org file with #+ODT_STYLES_FILE: but all pages in the exported document have the Standard style.
I'm sure my exported odt file uses my custom style file because I also added a header to the standard page style and I see it in the exported odt file.
Is there a way to set the page style in the org file?