question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using \( for starting a mathematical expression completes with ) rather than \), also quotation marks.

See original GitHub issue

The suggested formatting for mathematical expressions is \( ... \) for inline expressions and \[ ... \] for displays. However, LaTeX Workshop matches parentheses and brackets without respect to these rules, so typing in \( will have it complete with \( ... ), same with square brackets. It should probably match a \( with a \) at the end.

Also, left ticks, which in TeX are used for lefthand quotation marks, are automatically matched with apostrophes on the second half, as it should be, but if you insert a quote containing apostrophes inside

`` ...aasdf's... '',

they are removed from the end of the quote. I think this is a bug.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lagrucommented, Oct 11, 2017

Open File > Preferences > User Snippets, select “LaTeX” in the dialog and a file named “latex.json” should open.

Paste the above snippet to the appropriate place inside the file and save. After that try typing the following inside a TeX file --im (which is my chosen prefix) and press tab. VSCode should now replace the prefix with \(...\).

1reaction
James-Yucommented, Aug 17, 2017

Unfortunately, the math mode pairing for \( is not supported by vscode. Specifically,

	"autoClosingPairs": [
		["{", "}"],
		["[", "]"],
		["(", ")"],
		["$", "$"],
		["`", "'"],
		["\\(", "\\)"]
	],

won’t work. There can be some dirty hack like listening to user input and programatically add an addtional \. However, I am hesitated to do so since it can be against vscode’s design principle, and quality control can be a big issue. Though I will push a small fix on the pairing of ` and '. Further discussion is welcomed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to write quotation marks in math environment? - TeX
To display items encased in single or double quotes while in math mode, it may be best to encase the item in question...
Read more >
Brackets vs. Parentheses - Grammarist
Parentheses separate non-essential information from the sentence. Brackets indicate changes or comments within quoted material.
Read more >
Mid-Sentence Punctuation Marks – The Simple Math of ...
Quotation marks are used (1) with direct quotes and (2) with the titles of shorter works. Remember that commas and periods always go...
Read more >
A Guide to Writing Mathematics - UC Davis Computer Science
Mastering the ability to write clear mathematical explanations is important for non-mathematicians as well. As you continue taking math courses in college, you ......
Read more >
U.S. Government Printing Office Style Manual - Punctuation
When matter in brackets makes more than one paragraph, start each paragraph ... formally any matter that forms a complete sentence, question, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found