-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support pre-defined macros and more options for LaTeX #100
Comments
Typora uses MathJax for real-time rendering, so there's no preamble to deal with (thank goodness). I personally would like to see XyJax, but that's really up to the XyJax dev. If you want a similar WYSIWYG interface that you can use your own preamble with, try LyX. The LibreOffice TeXMaths plugin also approximates real-time rendering, but it hasn't been updated in a while. |
Alright, no extra packages. Still it would be nice if it could be possible to configure the underneath MathJax engine to include custom latex macros defined by \newcommand , \def etc. If I am not mistaken, these can be included in the MathJax configuration file. |
I think \newcommand and \def is supported, eg: $$
\newcommand{\water}{H_{2}O}
\water
$$ |
Yes, they are supported but, if you want to use the corresponding macros, you need to include them in every document you edit. It would we nice if one could specify these things once and for all in a sort of 'preamble' accessible via menu. The documents would look neater this way. |
OK, I got your point. Thanks for the suggestions. It's a good idea. |
One last thing, it could be great also if, once in math mode, common environments and commands could be triggered by some key shortcut. For instance eq+tab for \begin{equation} \end{equation} or ali+tab for the align environment. |
That seems like something many 3rd party applications could take care of, triggering actions or pasting in text based on keyboard shortcuts. E.g., https://smilesoftware.com/textexpander or https://www.keyboardmaestro.com/main/ |
Sure, however it could be nice to have a MathJax menu containing the option for a custom 'preamble', like I mentioned before, and the most common Mathjax commands and macros with the relative keybord shortcuts. This could improve the usability of Typora for people that are not familiar with Latex/MathJax. |
+1 needed |
+1 : it would be really great to get access to latex packages! |
+1 : this would be possible if a mathjax config file was exposed to the user. See http://docs.mathjax.org/en/latest/tex.html#defining-tex-macros and http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions |
For what it's worth, I've started adding the common tex newcommands that I use by editing For example, to add the example commands described in the mathjax documentation (http://docs.mathjax.org/en/latest/tex.html#defining-tex-macros), use:
|
Thank you, I don't know if you got this, but thanks, I'm going to give that
a try.
Best,
Bob Muller
…On Thu, Feb 23, 2017 at 7:48 PM, masonlr ***@***.***> wrote:
Yes, they are supported but, if you want to use the corresponding macros,
you need to include them in every document you edit. It would we nice if
one could specify these things once and for all in a sort of 'preamble'
accessible via menu. The documents would look neater this way.
For what it's worth, I've started adding the common tex newcommands that I
use by editing MathJax.Hub.Config in /Applications/Typora.app/
Contents/Resources/TypeMark/index.html.
For example, to add the example commands described in the mathjax
documentation (http://docs.mathjax.org/en/latest/tex.html#defining-tex-
macros), use:
TeX: {
extensions: ["noUndefined.js", "autoload-all.js", "AMSmath.js", "AMSsymbols.js", "mhchem.js"],
Macros: {
RR: "{\\bf R}",
bold: ["{\\bf #1}",1],
Abs: ['\\left\\lvert #2 \\right\\rvert_{\\text{#1}}', 2, ""]
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABtjc9l2b7zuHNV66oA46pbxwHE26Gl0ks5rfijfgaJpZM4HyzQr>
.
|
One thought - is there any way to expose this functionality as a text box in the preferences menu that just gets injected into the index.html file mentioned above? Edit: Or perhaps this alternative: http://docs.mathjax.org/en/latest/configuration.html#using-a-local-configuration-file-with-a-cdn |
+1: This is in fact the only thing that is holding me back from switching to Typora. |
+1, if you had this feature I'd switch over with no hesitation. |
Do you intend to add support for custom preambles and/or packages in the near future? |
For anyone reading this issue, I managed to shove the |
Also, updating MathJax to v3 would solve this problem immediately along with various other improvements! |
This would be wonderful. I'm used to typing all sorts of macros in my latex work. E.g. |
Will a feature with pre definable macros be added? Or is there already a way to do it? |
Since it seems like the MathJax way to pre-define macros and point to extensions is to provide a custom Editing |
I know this is a fairly old post, but my I only really want a few easy macros put in, so I'm happy to write them in as shown in the quoted comment. |
On MacOS
|
Thanks, @masonlr, for the suggestion. I looked in the The precise location for me, on Windows 10, was |
Just as a heads up, modifying this HTML file directly can be problematic! For me, it seems to be overwritten any time there is an update. |
@dzackgarza It is usually overwritten with every update. Which is why I have just resorted to using AutoHotkey for the few makros that I use in Typora. |
@dzackgarza @prossberg Thanks for the comment. Perhaps the best thing to do, then, is to have a separate text file with all the macros in, then copy and paste on update. There aren't updates super often, so not so much of an issue. AutoHotKey also seems like a good option |
scruel/docsify-latex@04155df |
+1, following. I want to import some Latex packages so that I could use \begin{proof}, \begin{document}, etc. |
Hello, I started to use Typora for writing down my notes and I really like it!
I would like to know if it is possible to use some extra latex packages via \usepackage{smt here}. I tried to include these commands at the code level but they do not seem to work.
If it was possible, it could be great to have the option to edit the standard 'latex preamble' via a menu, so that one could specify the extra packages that he/she intends to use, custom command, renewed commands and so on while keeping a neat look for the document being edited.
The text was updated successfully, but these errors were encountered: