-
Notifications
You must be signed in to change notification settings - Fork 16
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
Need help with o-thread-blockcall #23
Comments
Hey @rusimody, I'm glad you like it 😊 Admittedly, I thought But the idea of (o-defblock align nil nil
"A block for aligned equations."
(format "\\begin{align*} %s \\end{align*}" raw-contents))
(o-defblock goftex (shorthands "-> to \\Rightarrow") nil
"SHORTHANDS is a comma-separated list of ‘to’-separated string-to-LaTeX pairs."
(thread-last raw-contents ;; Get the block's raw contents,
(o--blockcall align) ;; Place them in an ‘align’ block,
(o--blockcall rename shorthands) ;; Place that into a ‘rename’ block
(s-replace-regexp "#\\+.*" ""))) ;; (← implementation fudge factor) Since the above (o-defblock align nil (numbered nil)
"A block for aligned equations.
- NUMBERED: Non-nil if you want the equations to be numbered.
- Lines that have a ‘\\tag’, a display name, override any numbering.
- Block contents are interpretted directly as LaTeX elements, not Org markup.
- The ampersand character & determines where the equations align.
- We provide a shorthand for beautifully coloured tags, and labels:
- “ :tag-𝑪𝑶𝑳𝑶𝑼𝑹: 𝑻𝑰𝑻𝑳𝑬 ” ≈ “ \\tag{$\\color{𝑪𝑶𝑳𝑶𝑼𝑹}{𝑻𝑰𝑻𝑳𝑬}$} \\label{𝑻𝑰𝑻𝑳𝑬} \\\\ ”
- Note, if a line does not have such a tag, it should end with ‘\\\\’.
- Finally, for MathJax to be loaded via Org, you should have some Math outside
this block; e.g., $\\;$ anywhere in your Org document, or an \\eqref{⋯} anywhere.
Example use:
#+begin_align
y &= m \\cdot x + b & e^{i \\cdot \\pi} + 1 = 0 :tag-pink: Weird Symbols
rise &= slope \\cdot run + base & \\mathsf{fun\\; circle\\; stuff} :tag-blue: Friendly English
\\hline
p ∧ q &≡ p ≡ q ≡ p ∨ q & \\min\\{p, q\\} = p \\;≡\\; q = \\max\\{p,q\\} :tag-gold: Golden Rule
#+end_align
Since 𝔹oolean equivalence, ‘≡’, is associative and symmetric; the \eqref{Golden Rule}
can be parsed as a definition for (1) conjunction ‘∧’, (2) equivalence ‘≡’, and (3) disjunction ‘∨’."
(-let [n? (if numbered "" "*")]
(format "\\begin{align%s}\n %s \n\\end{align%s}" n?
(s-replace-regexp ":tag-\\(.*\\):\\( \\)*\\(.*\\)\\( \\)*"
"\\\\tag{$\\\\color{\\1}{\\\\text{\\3}}$} \\\\label{\\3} \\\\\\\\"
raw-contents)
n?))) With this new fancy definition loaded, you can type into an Org file...
|
OOOOO---FFFF!! Currently I am grappling with some more basic stuff Here's a hopefully small eg Took your
With that stutter seems to work ok
Notice the Somehow your example blocks don't suffer this extra while mine do Also here's my current attempt of what I am trying to do.
Being a teacher myself I'd say this is D-grade Lisp so far 🙃 a. I just took your parallel block and started hacking on it Actually I want the haskell to be in |
Aaahhh
😆😂 When and how to use?? Here's a mwe of what I want to do:
|
I did notice some typos, doc bugs etc. |
Thanks for some mind-blowing elisp work!
Just trying to figure out how to use
o-thread-blockcall
Basically I want to use
#begin_rename
with a fixed listAnd then wrap it in
#begin_eqnarray*
Currently I hacked this far
Which basically cutpasted your
rename
block and hardcoded (one element of) the list I want replaced.goftex
is the block I want -- gofer as Latex equationsObviously I'd prefer to reuse your
rename
not cutpaste it!The other thing is that in the current attempt, org is not recognizing
#begin_eqnarray
if it is mixed with mygoftex
.Result of that is that I get extra
\(
and\)
enclosing the\leftarrow
inside thebegin{eqnarray*}
The text was updated successfully, but these errors were encountered: