Hot answers tagged

19 votes
Accepted

How to include rendered HTML in org mode?

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> &...
NickD's user avatar
  • 28.2k
15 votes
Accepted

HTML mode that closes tags

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: (...
Gilles 'SO- stop being evil''s user avatar
12 votes
Accepted

How do I export an ORG file to an interactive HTML site?

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 ...
glucas's user avatar
  • 20.4k
11 votes
Accepted

automatically move to n-th character on line after each C-n or C-p

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 ...
YoungFrog's user avatar
  • 3,526
10 votes
Accepted

no html/jsx indentation in jsx-mode

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. ...
flooose's user avatar
  • 511
9 votes

Markdown preview in Emacs using pandoc

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 ...
henning's user avatar
  • 92
9 votes
Accepted

Org-mode external links not working when exported to HTML

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: ...
Tobias's user avatar
  • 32.8k
9 votes

no html/jsx indentation in jsx-mode

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 ...
Victor Quinn's user avatar
6 votes
Accepted

Center image in GitHub's README.org

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 ...
Alex Shroyer's user avatar
6 votes
Accepted

HTML editing with preview

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 ...
Ehvince's user avatar
  • 1,091
6 votes

How to disable commented date in org mode html export

To disable that globally, you can use (setq org-export-time-stamp-file nil).
Jason Tian's user avatar
6 votes
Accepted

Emacs script to indent files from the command line

@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-...
NickD's user avatar
  • 28.2k
5 votes

Do not add TITLE as heading to body when exporting org file

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"> <!--/*...
JeanPierre's user avatar
  • 7,363
5 votes

Center image in GitHub's README.org

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]]
Xah Lee's user avatar
  • 1,756
5 votes
Accepted

Embed Image as Base64 on HTML export from Orgmode

See http://kitchingroup.cheme.cmu.edu/blog/2015/05/09/Another-approach-to-embedding-org-source-in-html/. You may also find this: https://github.com/KitchinHUB/kitchingroup-66/blob/master/manuscript....
John Kitchin's user avatar
  • 11.6k
5 votes
Accepted

Org-Mode: Exclude specific code line from html export

Take a look at the prologue header argument for Babel source blocks. You can use it to prepend some text to a code block prior to execution, and, like any other header argument, it isn't included in ...
Aaron Miller's user avatar
5 votes
Accepted

siunitx, MathJax, org-mode and html export

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 ...
NickD's user avatar
  • 28.2k
5 votes

HTML mode that closes tags

Install web-mode, http://web-mode.org/. It is the most complete mode for web pages and does contain what it calls HTML tag auto closing.
Heikki's user avatar
  • 3,026
5 votes
Accepted

How to use Org KEYWORD values within exported body?

Org mode defines macros for these things. Try: #+TITLE: Some Title #+AUTHOR: Foo Bar #+DATE: 2021-08-21 * some headline This works: - author's name: {{{author}}} - date: {{{date}}} See the &...
NickD's user avatar
  • 28.2k
5 votes

html-mode: publish to browser and jump to cursor location

One way is using an elisp function and a temporary anchor in the html: Surround the line where cursor is with an anchor <a name='CursorPosition'> Use browse-url-firefox (or preferred browser) ...
c_48's user avatar
  • 361
4 votes
Accepted

Embbed html/javascript in org-mode html export

#+INCLUDE: "someFile.html" html should result in an included rendered version of the html file and not just "quote the source file".
CantrianBear's user avatar
4 votes

Embed Image as Base64 on HTML export from Orgmode

As an alternative, you can use the ox-pandoc package. Pandoc itself has a command line option called --self-contained which will embed images in html. To you use this for just the pandoc HTML5 ...
Mark's user avatar
  • 440
4 votes
Accepted

HTML-mode insert tag without attribute(s)

As stated in my comment, the problem seemed to relate to ivy, a fantastic generic completion mechanism for Emacs. Somehow i failed to realise what was going on: ivy was doing its job and providing ...
Reverse_Polish's user avatar
4 votes
Accepted

Emacs picking the wrong browser

Well, in a sense sensible-browser is a system default browser:-) I believe that you need to use the update-alternatives system to set that system default. As to why Org mode is using sensible-...
Bob Uhl's user avatar
  • 146
4 votes
Accepted

Where is mhtml mode defined? And why am I getting it by default when I open HTML files?

mhtml-mode is defined in mhtml-mode.el. You can find it using M-x find-function mhtml-mode. Other interesting commands for locating/finding libraries: With M-x locate-library RET mhtml-mode RET the ...
Alex's user avatar
  • 1,028
4 votes
Accepted

How to put inline quotes in an org file for html export

You can achieve your desired result with a macro like this (which should also work for latex, but without the url): #+MACRO: quote @@html:<q cite="$2">$1</q>@@@@latex:``$1''@@ And then ...
theldoria's user avatar
  • 1,835
4 votes

Live view an html document in emacs

Live preview of Markdown in Emacs is discussed in the terrific Guide to Markdown Mode for Emacs and also at the Emacs wiki. The markdown-preview-eww package will use Emacs' build-in eww browser to ...
dotancohen's user avatar
4 votes
Accepted

Setting variable for org-mode html export?

For variables that cannot be set through the #+OPTIONS keyword, the #+BIND keyword mechanism can be used. Adding #+BIND: org-html-link-org-files-as-html:nil to the top of your file would be ...
NickD's user avatar
  • 28.2k
4 votes
Accepted

How write begin_export html blocks in an inline fashion?

As described in the org manual, alongside the explanation of #+BEGIN_EXPORT html @@html:the quick <b>brown</b> fox@@
Tyler's user avatar
  • 21.9k
4 votes
Accepted

How to render html in web-mode?

You can find out what C-c C-v does by pressing F1 k C-c C-v in a html-mode buffer: C-c C-v runs the command browse-url-of-buffer (found in html-mode-map), which is an interactive autoloaded ...
wasamasa's user avatar
  • 22k

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