ashthespy / Atom-LaTeX

The only LaTeX package you need for typesetting with Atom.
https://atom.io/packages/atom-latex
MIT License
22 stars 9 forks source link

Suggested modification #262

Open gilbertohasnofb opened 3 years ago

gilbertohasnofb commented 3 years ago

This PR implements two suggestions:

ashthespy commented 3 years ago

Sorry, I seem to have missed this. f17a244 Won't work as expected, as bracket-matcher doesn't allow you to insert double characters (https://github.com/atom/bracket-matcher/issues/323) The package does the ``word'' quoting automatically already anyway..

gilbertohasnofb commented 3 years ago

@ashthespy No worries about it

The package does the ``word''

Are you sure about it? Prior to adding "`'" to the list, the quoting `word' was not done automatically to me.

Won't work as expected, as bracket-matcher doesn't allow you to insert double characters

Not too sure I understand this one. All additions in that commit are single characters. All I did was adding the "`'" quote and removing the '', "", and ` ` since "word", 'word' and `word` are not proper LaTeX quotes.

ashthespy commented 3 years ago

Try selecting a word and hitting " it will wrap it with the correct ``word'' quoting for LaTeX. The pair you added will yield `word', which isn't helpful? And due to the limitation of bracket-matcher, you can't add double characters.

gilbertohasnofb commented 3 years ago

Try selecting a word and hitting " it will wrap it with the correct `word'' quoting for LaTeX. The pair you added will on doword', which isn't helpful

The quotation style ``word'' is used in the US while the quotation style `word' is the standard here in the UK. Selecting word and pressing " will indeed result in ``word'', but selecting it and pressing ' will not result in `word'.

A second point to be made is that auto-completition should work both for when a word is selected as well as not selected. So while pressing " with word selected will result in ``word'', pressing just " without a selection will simply add " at the cursor point (rightfully so, as this character might be used in a different context). With the proposed change, pressing ` without selecting a word will create a pair of `' with the cursor in between, and pressing it twice will create ``'' with the cursor still in between. That's a much more efficient way of typing so that you are already wrapping words in quotes as you write, instead of needing to select them later. So basically this commit PR is for taking care of these two cases, when pressing ` once or twice will correctly create quotes (UK and US style, respectively) for a word yet to be typed.

But with all that said, if you don't feel like merging this, I completely understand. If that would be the case, would you like me to open a PR just with https://github.com/ashthespy/Atom-LaTeX/pull/262/commits/700c5a43c389c309841f57f176360a7034db4052 or you are not considering to merge that commit either? Either way it is fine with me.