Comments (17)
No, there is currently no way to influence the available entities.
from orgro.
v1.34.2 is out on the App Store and Google Play; it supports local var list definitions for org-entities-user
, org-entities-local
, and the formulation in #84 (comment)
from orgro.
v1.34.2 is now available on F-Droid as well.
from orgro.
I hope this feature can be included in a near future. Nice app in any case.
from orgro.
Can you give an example entry or your org-entities-user
setting?
from orgro.
Sure.
The Emacs variable description of org-entities-user
is
The order of the fields is the following
name As a string, without the leading backslash.
LaTeX replacement In ready LaTeX, no further processing will take place.
LaTeX mathp Either t or nil. When t this entity needs to be in
math mode.
HTML replacement In ready HTML, no further processing will take place.
Usually this will be an &...; entity.
ASCII replacement Plain ASCII, no extensions.
Latin1 replacement Use the special characters available in latin1.
utf-8 replacement Use the special characters available in utf-8.
At the moment, mine has the following value.
(setq org-entities-user '(
("primes" "\\mathbb{P}" t "ℙ" "P" "P" "ℙ")
("naturals" "\\mathbb{N}" t "ℕ" "N" "P" "ℕ")
("integers" "\\mathbb{Z}" t "ℤ" "Z" "Z" "ℤ")
("rationals" "\\mathbb{Q}" t "ℚ" "Q" "Q" "ℚ")
("irrationals" "\\mathbb{I}" t "𝕀" "I" "I" "𝕀")
("reals" "\\mathbb{R}" t "ℝ" "R" "R" "ℝ")
("complexes" "\\mathbb{C}" t "ℂ" "C" "C" "ℂ")
("quaternions" "\\mathbb{H}" t "ℍ" "H" "H" "ℍ")
("scalars" "\\mathbb{K}" t "𝕂" "K" "K" "𝕂")
("coloneq" "\\coloneqq" t "≔" ":=" ":=" "≔")
("eqcolon" "\\eqqcolon" t "≕" "=:" "=:" "≕")
("then" "\\Rightarrow" t "⇒" "=>" "=>" "⇒")
("iff" "\\Leftrightarrow" t "⇔" "<=>" "<=>" "⇔")
("from" "\\leftarrow" t "←" "<-" "<-" "←")
("mapsto" "\\mapsto" t "&x21A6;" "->" "->" "↦")
("leadsto" "\\leadsto" t "&x21DD;" "->" "->" "⇝")
("pm" "\\mp" nil "±" "+-" "±" "±")
("mp" "\\pm" nil "∓" "-+" "-±" "∓")
("sqrt" "\\sqrt" t "√" "sqrt" "sqrt" "√")
("cbrt" "\\sqrt[3]" t "∛" "cbrt" "cbrt" "∛")
("frrt" "\\sqrt[4]" t "∜" "frrt" "frrt" "∜")
))
I believe only the first and last "columns" are of interest to Orgro.
I hope it is of help.
from orgro.
I've strenuously avoided adding settings to Orgro itself, and I'd prefer to keep it that way for this as well.
What I'm thinking now is to support parsing and interpreting org-entities-user
set via the local variables list.
You could hide such a section from export via the noexport
tag or the COMMENT
keyword.
Your setting would look like this at the bottom of your file:
* COMMENT Local Variables
# Local Variables:
# org-entities-user: (("primes" "\\mathbb{P}" t "ℙ" "P" "P" "ℙ") ("naturals" "\\mathbb{N}" t "ℕ" "N" "P" "ℕ") ("integers" "\\mathbb{Z}" t "ℤ" "Z" "Z" "ℤ") ("rationals" "\\mathbb{Q}" t "ℚ" "Q" "Q" "ℚ") ("irrationals" "\\mathbb{I}" t "𝕀" "I" "I" "𝕀") ("reals" "\\mathbb{R}" t "ℝ" "R" "R" "ℝ") ("complexes" "\\mathbb{C}" t "ℂ" "C" "C" "ℂ") ("quaternions" "\\mathbb{H}" t "ℍ" "H" "H" "ℍ") ("scalars" "\\mathbb{K}" t "𝕂" "K" "K" "𝕂") ("coloneq" "\\coloneqq" t "≔" ":=" ":=" "≔") ("eqcolon" "\\eqqcolon" t "≕" "=:" "=:" "≕") ("then" "\\Rightarrow" t "⇒" "=>" "=>" "⇒") ("iff" "\\Leftrightarrow" t "⇔" "<=>" "<=>" "⇔") ("from" "\\leftarrow" t "←" "<-" "<-" "←") ("mapsto" "\\mapsto" t "&x21A6;" "->" "->" "↦") ("leadsto" "\\leadsto" t "&x21DD;" "->" "->" "⇝") ("pm" "\\mp" nil "±" "+-" "±" "±") ("mp" "\\pm" nil "∓" "-+" "-±" "∓") ("sqrt" "\\sqrt" t "√" "sqrt" "sqrt" "√") ("cbrt" "\\sqrt[3]" t "∛" "cbrt" "cbrt" "∛") ("frrt" "\\sqrt[4]" t "∜" "frrt" "frrt" "∜"))
# End:
(The single-line form I got from doing M-x add-file-local-variable
and pasting in your value. You can also have it written item-by-item like below.)
Line-by-line version
* COMMENT Local Variables
# Local Variables:
# org-entities-user: (
# ("primes" "\\mathbb{P}" t "ℙ" "P" "P" "ℙ")
# ("naturals" "\\mathbb{N}" t "ℕ" "N" "P" "ℕ")
# ("integers" "\\mathbb{Z}" t "ℤ" "Z" "Z" "ℤ")
# ("rationals" "\\mathbb{Q}" t "ℚ" "Q" "Q" "ℚ")
# ("irrationals" "\\mathbb{I}" t "𝕀" "I" "I" "𝕀")
# ("reals" "\\mathbb{R}" t "ℝ" "R" "R" "ℝ")
# ("complexes" "\\mathbb{C}" t "ℂ" "C" "C" "ℂ")
# ("quaternions" "\\mathbb{H}" t "ℍ" "H" "H" "ℍ")
# ("scalars" "\\mathbb{K}" t "𝕂" "K" "K" "𝕂")
# ("coloneq" "\\coloneqq" t "≔" ":=" ":=" "≔")
# ("eqcolon" "\\eqqcolon" t "≕" "=:" "=:" "≕")
# ("then" "\\Rightarrow" t "⇒" "=>" "=>" "⇒")
# ("iff" "\\Leftrightarrow" t "⇔" "<=>" "<=>" "⇔")
# ("from" "\\leftarrow" t "←" "<-" "<-" "←")
# ("mapsto" "\\mapsto" t "&x21A6;" "->" "->" "↦")
# ("leadsto" "\\leadsto" t "&x21DD;" "->" "->" "⇝")
# ("pm" "\\mp" nil "±" "+-" "±" "±")
# ("mp" "\\pm" nil "∓" "-+" "-±" "∓")
# ("sqrt" "\\sqrt" t "√" "sqrt" "sqrt" "√")
# ("cbrt" "\\sqrt[3]" t "∛" "cbrt" "cbrt" "∛")
# ("frrt" "\\sqrt[4]" t "∜" "frrt" "frrt" "∜"))
# End:
from orgro.
I've strenuously avoided adding settings to Orgro itself, and I'd prefer to keep it that way for this as well.
I understand.
Your solution overwrites org-entities-user
. I propose do append a local list by looping add-to-list
with dolist
. It is perhaps not the best/fastest solution, but I think it is quite safe.
# Local Variables:
# eval: (dolist (org-entity-local '(
# ("cont" "\\mathcal{C}" t "𝒞" "C" "C" "𝒞")
# ("neigh" "\\mathcal{E}" t "ℰ" "E" "E" "ℰ")
# )) (add-to-list 'org-entities-user org-entity-local t))
# End:
Thank you for pointing me to the solution. Cheerios.
from orgro.
Your solution overwrites
org-entities-user
.
Ah yes, that would be a problem if you don't want to include your entire value in every document.
I propose do append a local list by looping
add-to-list
withdolist
. It is perhaps not the best/fastest solution, but I think it is quite safe.
Now Orgro can't just parse the value; it needs to be able to run arbitrary Elisp. This is a much bigger task, and may not even be allowed on the App Store.
from orgro.
Now Orgro can't just parse the value; it needs to be able to run arbitrary Elisp. This is a much bigger task, and may not even be allowed on the App Store.
Does Orgro get updates from Emacs? I could contact upstream to see if it is feasible to add a new variable, org-entities-local
, to be set locally per file.
from orgro.
Orgro doesn't use any Emacs or org-mode code; I've reimplemented the relevant bits in Dart. So in principle I can just decide to support org-entities-local
or even orgro-entities-user
.
In general I would prefer to not invent new things here; in other words ideally org-mode would add org-entities-local
and I would support that.
from orgro.
Orgro doesn't use any Emacs or org-mode code; I've reimplemented the relevant bits in Dart. So in principle I can just decide to support
org-entities-local
or evenorgro-entities-user
.
You should definitely give support to either org-entities-user
or org-entities-local
. Currently org-entities-user
is the official way to extend org-entities
. I assume that, if you decide to give support to orgro-entities-user
, supporting afterwards org-entities-local
should be a piece of cake. But I can also understand that you prefer to wait and see if the Emacs/Orgmode developers decide to implement a local solution such as org-entities-local
(I let you know if it is the case).
Just to know, what is the set of entities Orgro supports? The one from org-entities
? I'll be pushing a pull request to Emacs/Orgmode to update the default set of org-entities
which lacks of many basic symbols such as the numeric sets I gave above.
from orgro.
Just to know, what is the set of entities Orgro supports? The one from
org-entities
?
Yes, I generate the default list from org-entities
:
https://github.com/amake/org_flutter/blob/d30d0091124fc66b2b181ab5b9ef798fafe2b2e6/lib/src/entity.dart
from orgro.
Support for org-entities-user
and org-entities-local
will be available for testing in 1.34.0:
from orgro.
Nice! I'm gonna give it a try.
from orgro.
I've just tried it and it seems to work correctly. Thanks for the implementation!
from orgro.
Incidentally the "safe" predicate for org-entities-user
is incorrect as of Org 9.6.13, so if you set the value via local variables Emacs will bug you to accept it.
I submitted a fix that should be in the next release.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ec18b8ebcbfc6d3ad98535f80157307ccea911d
from orgro.
Related Issues (20)
- Section title not parsed correctly HOT 5
- Handling of telephone numbers HOT 1
- Android monochrome app icon HOT 2
- Add Terminus font HOT 4
- Support arbitrary blocks HOT 4
- Inline markup is dropped from titles HOT 5
- Jump to footnotes HOT 2
- Improve the TODO cycling UI HOT 12
- 2-state local cycling on subtrees HOT 2
- Swipe to widen HOT 3
- Filter/search by TODO state HOT 4
- Support for Org-drill HOT 1
- Editing files HOT 4
- Can there be more sans font HOT 2
- Can there be more sans font HOT 1
- Protect screen when showing decrypted content
- Agenda View
- Support custom headline keywords HOT 4
- Nice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orgro.