# Tag Info

38

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title: #+TITLE: Foo @@latex:\\@@ Bar I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this: #+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar Source: https://lists.gnu.org/archive/...

26

My preferred tool for live-editing HTML documents is skewer-mode. It updates the document in the browser without a refresh, so you get instant feedback on your changes. Here's a demo video that shows it in action. It has modes for live-editing HTML, CSS, and JavaScript. It's most useful for JavaScript, as it enables a workflow a lot like hacking on Emacs ...

24

Impatient Mode will get you most of the way there. Here's a cool video. It's especially handy when doing the first styling and prototyping. Since it renders the current buffer, you'll have to put all your html and css in one buffer, code and tweak until you're happy, then separate it all out. Even Javascript can be handled the same way — but it's a bit ...

20

You can use the built-in sgml-mode for this. M-x sgml-mode - Enable the sgml-mode major mode so that sgml-pretty-print command auto-loads. C-x h - Select the whole buffer. M-x sgml-pretty-print To save space, below is only a part of the formatted text that I get on doing the above on your sample text in the question: <table border="4px" cellpadding="0" ...

18

is it feasible to make one? Since this is emacs, yes. My approach is to use a 3rd party tools that can take HTML and convert to plain text or even directly to Org format. I think this is an ugly hack, and there may be better ways to do this, but it looks like it works for my test cases. (defun kdm/html2org-clipboard () "Convert clipboard contents from ...

16

If you want to include literal HTML in your org file, and have it exported only when you export to HTML, use an export block: #+BEGIN_EXPORT html <br> <h2>This is the footer.</h2> <p>You can put stuff here.</p> <br> #+END_EXPORT You cannot use #+INCLUDE inside an export block though (well, you can, but it won't work the ...

15

First, I believe org can use htmlize to automatically color your source code blocks according to your theme. Alternatively. Check out http://definitelyaplug.b0.cx/post/custom-inlined-css-in-org-mode-html-export/. It has a great example of how to use the org-export-before-processing-hook to throw custom css onto an org document before an html export. Here'...

13

You can get this result by setting the CUSTOM_ID property. From the following file: * Test :PROPERTIES: :CREATED: [2014-10-02 Thu 11:48] :END: ** Sub no custom :PROPERTIES: :CREATED: [2014-10-02 Thu 11:49] :END: ** Sub custom :PROPERTIES: :CREATED: [2014-10-02 Thu 11:49] :CUSTOM_ID: Custom :END: I get the following Export (C-c C-e h H): <div id="...

12

What you are looking for is org-info.js, a JavaScript library to be used in conjunction with HTML files generated from Org. This library adds support for folding, navigation, etc. Take a look at http://orgmode.org/manual/JavaScript-support.html, and the more detailed documentation here: http://orgmode.org/worg/code/org-info-js/.

12

With the default HTML mode as of Emacs 24.4, you can get the same behavior as Sublime Text (automatic insertion of the closing tag if you type </) by putting the following line in your init file: (setq sgml-quick-keys 'close) Out of the box, pressing C-c / or C-c C-e or C-c / inserts a closing tag (the whole </foo>). You can find out about these ...

11

Maybe something like this (tested with LaTeX and HTML) #+TITLE: An Orged Paper #+AUTHOR: Rasmus #+DATE: A Dark Day for Science #+RESULTS: html-header #+begin_abstract #+begin_center {{{html-only(*Abstract*)}}} #+end_center my long abstract that is longer than one line. my long abstract that is longer than one line. #+end_abstract #+toc: headlines * ...

11

set-goal-column might be what you're looking for : set-goal-column is an interactive compiled Lisp function in `simple.el'. It is bound to C-x C-n. (set-goal-column ARG) Set the current horizontal position as a goal for C-n and C-p. Those commands will move to this position in the line moved to rather than trying to keep the same horizontal position. ...

10

Alternatively to query replace you can go with multiple-cursors: Also consider using something like this: (defun wrap-html-tag (tagName) "Add a tag to beginning and ending of current word or text selection." (interactive "sEnter tag name: ") (let (p1 p2 inputText) (if (use-region-p) (progn (setq p1 (region-beginning) ) ...

10

This is a known issue and as of now, it has not been fixed. I've decided to forego jsx-mode for this reason and just use web-mode. It has support for JSX and is better suited for mixed content files. Since I do work in several projects that don't all have the same convention of using the .jsx ending for JSX files (some simply use .js endings), I've also ...

9

FYI for anyone else who comes across this issue, this is because this jsx-mode project is not made to edit Facebook's React JSX templates but rather this other compiled javascript language also called JSX. That having the same name as the React templates is entirely coincidental. This is why the first commits to this repo were 4 years (pre-dating Facebook'...

9

The string behind :: is actually a search. In this context one understands the relevant comment in the source code of the function org-html-link in the library file ox-html.el (org 8.2.5). It says: ;; Add search option, if any. A search option can be ;; relative to a custom-id or a headline title. Any other ;; option is ignored. So, you can either ...

8

Org is extremely versatile when it comes to defining links, so they're probably your best bet. For that you need the org-add-link-type function. (org-add-link-type "audio" #'ignore #'endless/export-audio-link) The second argument is telling org you don't care about opening audio links for now, and the third argument says how to export them to html. Use the ...

8

You can use query-replace-regexp (C-M-%). Replace ^$$.*$$$with <li>\1</li>. 8 After a while, I found the answer myself: In a nutshell: Use a combination of Eww and markdown mode, and configure markdown mode to render markdown with pandoc. Alas, easier said than done. Update to Emacs 24.5 Eww is the built-in browser since Emacs 24.5 It can be used to display html output. Eww does not run out of the box in Emacs 24.5 for windows. The ... 7 The most direct way of doing this would be to Mark the region of text lines to become a list Press M-% (query-replace) Type C-q C-j RET </li> C-q C-j <li> RET (C-q C-j inserts a quoted newline character) Press ! to replace all occurrences 6 You have some options: http://wikemacs.org/wiki/Markdown#Impatient-mode the best for html looking to be impatient-mode, it allows to see the changes in your browser while you type. After intsallation (in melpa) it is just a matter of M-x httpd-start and M-x impatient-mode and then open your browser to http://localhost:8080/imp/ 6 @glucas's answer is correct in its diagnosis, but has a minor problem (you want the 0th element of argv) and is incomplete. Here is a more complete example: #!/usr/bin/env -S emacs --script (find-file (nth 0 argv)) (mhtml-mode) (indent-region (point-min) (point-max) nil) (save-buffer) This does not use web-mode which is not available to me (does it exist?);... 5 You could write a minor mode that refreshes the rendered webpage after you modify any relevant buffer. Of course, doing so after each keystroke would be overkill, so using a timer and rendering when emacs is idling A quick POC would be: (defvar my-html-render-delay 1) (defun my-html-render-post-command-hook () (run-with-idle-timer my-html-render-delay ... 5 You can get Emacs to show you a stack trace when the function is called, so that you can figure out what called it. M-x debug-on-entry RET auto-fill-mode RET trigger the issue Check the stack trace. Depending on the details, the exact cause may not be 100% clear, but it should certainly give you a good idea of where to look next. Use c to continue execution ... 5 I guess the simplest way is to define a macro in your orgmode file with: #+MACRO: abbr @@html:<abbr title="$1">\$2</abbr>@@ You can then add an abbr in your text with: {{{abbr(Definition, abbreviation)}}} Edit: This is probably the better solution: Add a special tag for abbr: (defun org-export-abbr (backend) "Replace {abbreviation|...

5

You can hide the title by providing the appropriate CSS setting. For example, add this line to your file (and hit C-c C-c to activate the change): #+HTML_HEAD: <style type="text/css"> <!--/*--><![CDATA[/*><!--*/ .title { display: none; } /*]]>*/--> </style> or set the org-html-head variable. Here's the documentation.

5

To center with CSS, you need to use margin-left: auto; and margin-right: auto; try this #+ATTR_HTML: :style margin-left: auto; margin-right: auto; [[/path/to/img.png]]

5

You can embed "raw" html as follows: <p align="center"><img src="images/wim-128.png" /></p> When displayed on GitHub.com, for some reason org-mode's image styling directives are ignored. However GitHub does not ignore styling of <p> tags, so I used the above fix.

5

You have to set the variable org-html-mathjax-template appropriately. Assuming you are using the default configuration, loading mathjax from cdn.mathjax.org, then the following setting (which loads the mhchem extension, as well as the siunitx extension, but also contains ancient cruft that might no longer be needed, or might even cause problems) works for me,...

Only top voted, non community-wiki answers of a minimum length are eligible