org-macros icon indicating copy to clipboard operation
org-macros copied to clipboard

Take your Org mode productivity to the next level with our Macro Refcard! Discover the power of macros with practical examples and shortcuts. Download now. #orgmode #macros #productivityhacks

#+TITLE: Org Macros #+AUTHOR: Fabrice Niessen #+EMAIL: (concat "fniessen" at-sign "pirilampo.org") #+DESCRIPTION: #+KEYWORDS: org-mode, macro, examples #+LANGUAGE: en #+OPTIONS: H:4 num:nil toc:2 #+EXCLUDE_TAGS: noexport

#+PROPERTY: header-args :comments no :eval no :exports code :noweb yes :tangle org/org-macros.setup

#+SETUPFILE: ~/org/theme-readtheorg.setup

#+INCLUDE: ~/org/org-macros.setup

#+begin_html :license-gpl-blue.svg

btn_donate_LG.gif #+end_html
  • Tasks :noexport:

On 2016-12-19, Nicolas Goaziou added ~org-export-global-macros~ in master. Could be interesting to use!

  • Overview

** Description

The macros in Org allow you to add text or code to an Org document that will be expanded during export: the text between the 3 pairs of accolades is expanded so that readers can see it in the exported versions of the document.

Some people (such as me) use it to construct complex HTML or LaTeX code.

** Objectives

Using macros allows you to insert dynamic content or add extra functionality in exports of an Org document.

** Features

These [[https://github.com/fniessen/org-macros][Org-macros]] have been tested for HTML exports.

FIXME They will be soon made available for PDF exports.

  • Code

** Checkout

Use this command to check out the latest source code of the project from the Git repository hosted at [[https://github.com/fniessen/org-macros][GitHub]]:

: git clone https://github.com/fniessen/org-macros

** Installation

#+begin_src org :tangle no ,#+INCLUDE: /PATH/TO/org/org-macros.setup #+end_src

#+begin_info As there are Babel code blocks inside the =org/org-macros.setup= file, it needs to be loaded via the ~#+INCLUDE:~ directive, not via a ~#+SETUPFILE:~! #+end_info

** Usage

Once you've cloned [[https://github.com/fniessen/org-macros][Org-macros]], many macros will be ready to use within your Org files.

You can invoke macros anywhere in the document (even in code examples).

Examples:

  • With no arguments:

    #+begin_example {{{name-of-the-macro}}} #+end_example

  • With arguments:

    #+begin_example {{{name-of-the-macro(arg1,arg2)}}} #+end_example

** Macros

Below is a list of the few macros currently available.

*** Org built-ins

  • [[#author][author]] macro
  • [[#date][date]] macro
  • [[#email][email]] macro
  • [[#input-file][input-file]] macro
  • [[#modification-time][modification-time]] macro
  • [[#property][property]] macro
  • [[#time][time]] macro
  • [[#title][title]] macro

*** Basic formatting

  • [[#bgcolor][bgcolor]] macro

  • [[#clearpage][clearpage]] macro

  • [[#color][color]] macro

  • [[#fixme][fixme]] macro

  • [[#highlight][highlight]] macro

  • [[#loremipsum][loremipsum]] macro

  • [[#newline][newline]] macro

  • [[#redact][redact]] macro

  • [[#kbd][kbd]] macro

HTML phrase tags:

- :: Renders as emphasized text

- :: Defines important text

- :: Defines a piece of computer code

- :: Defines sample output from a computer program

- :: Defines keyboard input

- :: Defines a variable

#+MACRO: sup \zwnj^{$1}

*** Advanced

  • [[#dvipng-when-odt][dvipng-when-odt]] macro
  • [[#if-latex-else][if-latex-else]] macro
  • [[#style][style]] macro

*** Generic macros

- [[#area-chart][area-chart]] macro

- [[#bar-chart][bar-chart]] macro

  • [[#image][image]] macro
  • ~recently-updated~ macro
  • ~tasklist~ macro
  • [[#version-history][version-history]] macro

*** Layout

  • [[#collapse][collapse]] macro
  • [[#info][info]] macro
  • [[#minipage][minipage]] macro
  • [[#note][note]] macro
  • [[#panel][panel]] macro
  • [[#tip][tip]] macro
  • [[#warning][warning]] macro

*** Navigation and lists

  • ~children~ macro (to display child pages)
  • [[#toc][toc]] macro

*** Dev tools

  • [[#twitter-share-link-button][twitter-share-link-button]] macro

** Cookie :noexport:

#+begin_src org

-- mode: org; --

#+end_src

  • Org built-ins

** Author macro :PROPERTIES: :CUSTOM_ID: author :END:

The ~author~ macro outputs a list of users who have created or edited the document.

*** Parameters

None.

*** Examples

People who have created and edited this document: {{{author}}}.

*** See also

Option ~#+AUTHOR:~.


** Date macro :PROPERTIES: :CUSTOM_ID: date :END:

The ~date~ macro outputs the date and time specified in the document.

*** Parameters

  1. Format string understood by ~format-time-string~.

*** Examples

The date of this document is: {{{date}}} or {{{date(%Y-%m)}}}.

*** See also

  • Option ~#+DATE:~ (for the whole document).
  • Property ~:EXPORT_DATE:~ (for specific subtrees).
  • [[#modification-time][modification-time]] macro.
  • [[#time][time]] macro.

** Email macro :PROPERTIES: :CUSTOM_ID: email :END:

The ~email~ macro outputs the email of the author(s).

*** Parameters

None.

*** Examples

The email of this document is: {{{email}}}.

*** See also

Option ~#+EMAIL:~.


** Input-file macro :PROPERTIES: :CUSTOM_ID: input-file :END:

The ~input-file~ macro displays the name of the input Org file.

*** Parameters

None.

*** Examples

The input file name for this document is: {{{input-file}}}.


** Modification-time macro :PROPERTIES: :CUSTOM_ID: modification-time :END:

The ~modification-time~ macro outputs the modification date and time /of/ the file being exported.

*** Parameters

  1. Format string understood by ~format-time-string~.

*** Examples

This document was last modified on: {{{modification-time(%Y-%m-%d %a %H:%M)}}}.

*** See also

  • [[#date][date]] macro.
  • [[#time][time]] macro.

** Property macro :PROPERTIES: :CUSTOM_ID: property :END:

The ~property~ macro outputs ...

*** Parameters

  1. Node property name.

*** Examples

#+begin_src org :tangle no ,* TODO Do it! :PROPERTIES: :Effort: 1:00 :END:

This task should take no more than {{{property(Effort)}}} hours. #+end_src


** Time macro :PROPERTIES: :CUSTOM_ID: time :END:

The ~time~ macro outputs the current date and time /when/ the document is being exported.

*** Parameters

  1. Format string understood by ~format-time-string~.

*** Examples

This document was last exported on: {{{time(%Y-%m-%d %a %H:%M)}}}.

*** See also

  • [[#date][date]] macro.
  • [[#modification-time][modification-time]] macro.

** Title macro :PROPERTIES: :CUSTOM_ID: title :END:

The ~title~ macro outputs the document title.

*** Parameters

None.

*** Examples

The title of this document is: {{{title}}}.

*** See also

Option ~#+TITLE:~.


  • Basic formatting

** BgColor macro :PROPERTIES: :CUSTOM_ID: bgcolor :END:

The ~bgcolor~ macro allows you to change the background color of a block of text.

*** Code

#+begin_src org ,#+MACRO: bgcolor @@html:

$2
@@ #+end_src

*** Parameters

  1. Color name or hexadecimal code.
  2. Text you want to color.

*** Examples

{{{bgcolor(red, This information is important.)}}} {{{bgcolor(#E0E0E0, This other isn't.)}}}

Common color names are supported by most Org exporters (HTML, LaTeX):

{{{bgcolor(red, red)}}} {{{bgcolor(orange, orange)}}} {{{bgcolor(yellow, yellow)}}} {{{bgcolor(green, green)}}} {{{bgcolor(blue, blue)}}} {{{bgcolor(purple, purple)}}} {{{bgcolor(violet, violet)}}}

You can also use hexadecimal color codes:

{{{bgcolor(#FF0000, #FF0000)}}} {{{bgcolor(#00FF00, #00FF00)}}} {{{bgcolor(#0000FF, #0000FF)}}}

*** See also

  • [[#color][color]] macro
  • [[#highlight][highlight]] macro
  • [[#hl][hl]] macro

** Clearpage macro :PROPERTIES: :CUSTOM_ID: clearpage :END:

*** Code

#+begin_src org ,#+MACRO: clearpage @@latex:\clearpage@@@@odt:<text:p text:style-name="PageBreak"/>@@ #+end_src

#+begin_warning To see the above example in action in ODT, edit your ~styles.xml~ file and add a custom style:

: <style:style style:name="PageBreak" style:family="paragraph" : style:parent-style-name="Text_20_body"> : <style:paragraph-properties fo:break-before="page"/> : </style:style>

See https://www.gnu.org/software/emacs/manual/html_node/org/Creating-one_002doff-styles.html. #+end_warning

*** Parameters

None.

*** Examples


** Color macro :PROPERTIES: :CUSTOM_ID: color :END:

The ~color~ macro allows you to change the foreground color of inline text.

*** Code

#+begin_src org ,#+MACRO: color @@html:$2@@@@latex:\textcolor{$1}{$2}@@@@odt:<text:span text:style-name="$1">$2</text:span>@@ #+end_src

#+begin_warning To see the above example in action in ODT, edit your ~styles.xml~ file and add a custom style for each new color.

See https://www.gnu.org/software/emacs/manual/html_node/org/Creating-one_002doff-styles.html. #+end_warning

*** Parameters

  1. Color name or hexadecimal code.
  2. Text you want to color.

*** Examples

{{{color(red, This information is important.)}}} {{{color(#E0E0E0, This other isn't.)}}}

Common color names are supported by most Org exporters (HTML, LaTeX):

{{{color(red, red)}}} {{{color(orange, orange)}}} {{{color(yellow, yellow)}}} {{{color(green, green)}}} {{{color(blue, blue)}}} {{{color(purple, purple)}}} {{{color(violet, violet)}}}

You can also use hexadecimal color codes:

{{{color(#FF0000, #FF0000)}}} {{{color(#00FF00, #00FF00)}}} {{{color(#0000FF, #0000FF)}}}

*** See also

  • [[#bgcolor][bgcolor]] macro
  • [[#highlight][highlight]] macro
  • [[#hl][hl]] macro

** Fixme macro :PROPERTIES: :CUSTOM_ID: fixme :END:

The ~fixme~ macro inserts a "Fix Me!" image (with adequate CSS).

*** Code

#+begin_src org ,#+MACRO: fixme @@html:FIXME@@ #+end_src

CSS example:

#+begin_src css :tangle no .fixme { background: #FFFF88 url('../images/fixme.png') no-repeat top left; color: #CC0000; display: inline-block; height: 16px; text-indent: -9999px; width: 82px; } #+end_src

*** Parameters

None.

*** Examples

{{{fixme}}} Delete this...

Testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing {{{FIXME}}} testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing testing


** Highlight macro :PROPERTIES: :CUSTOM_ID: highlight :END:

The ~highlight~ macro allows you to change the background color of inline text.

*** Code

#+begin_src org ,#+MACRO: highlight @@html:$2@@ #+end_src

*** Parameters

  1. Color name or hexadecimal code.
  2. Text you want to color.

*** Examples

{{{highlight(red, Highlighting text is easy in Org mode.)}}} {{{highlight(#E0E0E0, This text isn't important.)}}}

Common color names are supported by most Org exporters (HTML, LaTeX):

{{{highlight(red, red)}}} {{{highlight(orange, orange)}}} {{{highlight(yellow, yellow)}}} {{{highlight(green, green)}}} {{{highlight(blue, blue)}}} {{{highlight(purple, purple)}}} {{{highlight(violet, violet)}}}

You can also use hexadecimal color codes:

{{{highlight(#FF0000, #FF0000)}}} {{{highlight(#00FF00, #00FF00)}}} {{{highlight(#0000FF, #0000FF)}}}

*** See also

  • [[#bgcolor][bgcolor]] macro
  • [[#color][color]] macro
  • [[#hl][hl]] macro

** Hl macro :PROPERTIES: :CUSTOM_ID: hl :END:

The ~hl~ macro allows you to highlight text with a "neon marker" effect.

*** Code

#+begin_src org ,#+MACRO: hl {{{highlight(#FFFF00,$1)}}} #+end_src

*** Parameters

  1. Color name or hexadecimal code.
  2. Text you want to color.

*** Examples

{{{hl(This information is important.)}}}

*** See also

  • [[#bgcolor][bgcolor]] macro
  • [[#color][color]] macro
  • [[#highlight][highlight]] macro

** LoremIpsum macro :PROPERTIES: :CUSTOM_ID: loremipsum :END:

The ~loremipsum~ macro displays one paragraph of meaningless text that you can use for demonstration purposes of visual elements such as font, typography or layout.

*** Code

#+begin_src org ,#+MACRO: loremipsum Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. #+end_src

*** Parameters

None.

*** Examples

This is a basic example of the ~Loremipsum~ text:

{{{loremipsum}}}


** Newline macro :PROPERTIES: :CUSTOM_ID: newline :END:

~\~ in headlines doesn't cause a line break, but gets exported in LaTeX to ~$\backslash$~.

You have to put it in a macro.

*** Code

#+begin_src org ,#+MACRO: newline @@latex:\hspace{0pt}\@@ @@html:
@@ #+end_src

*** Parameters

None.

*** Examples

#+begin_src org :tangle no ,#+TITLE: Foo {{{newline}}} bar #+end_src


** Redact macro :PROPERTIES: :CUSTOM_ID: redact :END:

Is there any way to completely redact text in HTML export, so it just looks like black boxes?

I'm not sure I fully understand, but it this what you are looking for?

#+MACRO: redact @@html:$1@@

To {{{redact(redact)}}} or not to {{{redact(redact)}}} that is the question.


** Kbd macro :PROPERTIES: :CUSTOM_ID: kbd :END:

*** Code

#+begin_src org ,#+MACRO: kbd @@html:@@$1@@html:@@ #+end_src

See ~menukeys~ for LaTeX.

*** Parameters

  1. Text to markup.

*** Examples

#+begin_src org :tangle no Use {{{kbd(C-c a a)}}} to launch the agenda. #+end_src


  • Advanced

** dvipng-when-odt :PROPERTIES: :CUSTOM_ID: dvipng-when-odt :END:

*** Code

#+begin_src org ,#+MACRO: dvipng-when-odt (eval (if (org-export-derived-backend-p org-export-current-backend 'odt) "#+OPTIONS: tex:dvipng" )) #+end_src

*** Parameters

*** Examples


** if-latex macro :PROPERTIES: :CUSTOM_ID: if-latex-else :END:

XXX

*** Code

#+begin_src org ,#+MACRO: if-latex-else (eval (if (org-export-derived-backend-p org-export-current-backend 'latex) "$1" "$2")) #+end_src

*** Parameters

  1. Code for LaTeX back-end.
  2. Code for other back-ends.

*** Examples

{{{if-latex-else(latex code,something else)}}}


** style :PROPERTIES: :CUSTOM_ID: style :END:

The ~style~ macro allows you to add custom style sheets to a page or import from an external URL.

*** Code

#+begin_src org ,#+MACRO: style (eval (concat "#+HTML_HEAD_EXTRA: ")) #+end_src

*** Parameters

URL to import an external style sheet.

*** Examples

{{{style}}}

<link type="text/css" rel="stylesheet" href="http://whatever.com/mystyle.css" media="all">

  • Generic

** COMMENT Area chart macro :PROPERTIES: :CUSTOM_ID: area-chart :END:

The ~area-chart~ macro displays a chart.

*** Code

#+begin_src org ,#+MACRO: area-chart ... #+end_src

*** Parameters

  1. Path to chart file.

*** Examples

Data to be charted:

#+name: satisfaction | | 2009 | 2010 | 2011 | |-------------------+------+------+------| | Very satisfied | 20 | 23 | 34 | | Satisfied | 40 | 34 | 23 | | Dissatisfied | 25 | 26 | 25 | | Very dissatisfied | 15 | 17 | 18 |

Code:

#+name: area-chart #+begin_src R :var data=satisfaction :results graphics :file images/area-chart.png :exports both :eval yes :tangle no plot(data, type="b", bty="l", col=c("#ABD249"), las=1, lwd=4) grid(nx=NULL, ny=NULL, col=c("#E8E8E8"), lwd=1) legend("bottom", legend=c("Degrees"), col=c("#ABD249"), pch=c(19)) #+end_src

XXX See https://confluence.atlassian.com/display/DOC/Chart+Macro;jsessionid=E1FA8760BC67BA4A130C1DF8DD4477CE.node2#ChartMacro-AreaCharts

The resulting area chart:

#+results: area-chart [[file:bar-chart.png]]

{{{area-chart}}}


** COMMENT Bar chart macro :PROPERTIES: :CUSTOM_ID: bar-chart :END:

The ~bar-chart~ macro displays a chart.

*** Code

#+begin_src org ,#+MACRO: bar-chart ... #+end_src

*** Parameters

  1. Path to chart file.

*** Examples

Data to be charted:

#+name: income-expenses | | Income | Expenses | |------+--------+----------| | 2012 | 31 | 12 | | 2013 | 42 | 32 | | 2014 | 43 | 41 |

Code:

#+name: bar-chart #+begin_src R :var data=income-expenses :results graphics :file images/bar-chart.png :exports both :eval yes :tangle no plot(data, type="b", bty="l", col=c("#ABD249"), las=1, lwd=4) grid(nx=NULL, ny=NULL, col=c("#E8E8E8"), lwd=1) legend("bottom", legend=c("Degrees"), col=c("#ABD249"), pch=c(19)) #+end_src

XXX See https://confluence.atlassian.com/display/DOC/Creating+Beautiful+and+Dynamic+Pages#CreatingBeautifulandDynamicPages-Bringingnumberstolife

The resulting bar chart:

#+results: bar-chart [[file:bar-chart.png]]

{{{bar-chart}}}


** Image macro :PROPERTIES: :CUSTOM_ID: image :END:

The ~image~ macro displays an image.

*** Code

#+begin_src org ,#+MACRO: image \includegraphics{$1} #+end_src

*** Parameters

  1. Path to image file.

*** Examples

{{{image}}}

| {{{image(a.png)}}} | {{{image(b.png)}}} | | {{{image(c.png)}}} | {{{image(d.png)}}} |


** Version-history macro :PROPERTIES: :CUSTOM_ID: version-history :END:

The ~version-history~ macro inserts the history of (the last 5) updates made to a document: version number, date, author and comment.

XXX + link to View Changes?

*** Code

#+begin_src org ,#+name: version-history ,#+begin_src shell :exports none :results silent :colnames '(Version Date Author Comment) git log --pretty=format:"%h%x09%ad%x09%an%x09%s" --date=short | head -n 5 ,#+end_src

,#+MACRO: version-history call_version-history:eval yes[:eval yes :results table :colnames '(Version Date Author Comment)] #+end_src

#+begin_tip We chose an inline Babel call so that the macro can be used in a paragraph. #+end_tip

*** Parameters

None.

*** Remarks

This only will work with Git repositories.

*** Examples

{{{version-history}}}


  • Layout

** Collapse macro :PROPERTIES: :CUSTOM_ID: collapse :END:

The ~collapse~ macro inserts of collapsed block of text.

*** Code

*** Parameters

None.

*** Examples

{{{collapse(View details...) This is a block of text that is collapsed by default. It can be expanded by clicking a link. }}}


** Info macro :PROPERTIES: :CUSTOM_ID: info :END:

The ~info~ macro is useful for including helpful information.

*** Code

#+begin_src org ,#+MACRO: begin_info @@html:

@@ ,#+MACRO: end_info @@html:

@@ #+end_src

*** Parameters

None.

*** Examples

{{{begin_info}}} Info example \ Did you know... {{{end_info}}}

*** Remarks

You'd better use a "special block", such as:

#+begin_example ,#+begin_info ,Info example \ Did you know... ,#+end_info #+end_example


** MiniPage macro :PROPERTIES: :CUSTOM_ID: minipage :END:

*** Code

#+begin_src org ,#+MACRO: BeginMiniPage @

,#+MACRO: EndMiniPage @
#+end_src

*** Parameters

*** Examples


** Note macro :PROPERTIES: :CUSTOM_ID: note :END:

*** Code

#+begin_src org ,#+MACRO: begin_note @@html:

@@ ,#+MACRO: end_note @@html:

@@ #+end_src

*** Parameters

None.

*** Examples

{{{begin_note}}} Note example \ This is a useful note... {{{end_note}}}

*** Remarks

You'd better use a "special block", such as:

#+begin_example ,#+begin_note ,Note example \ This is a useful note... ,#+end_note #+end_example


** Panel macro :PROPERTIES: :CUSTOM_ID: panel :END:

*** Code

#+begin_src org ,#+MACRO: begin_panel @@html:

@@ ,#+MACRO: end_panel @@html:

@@ #+end_src

XXX PanelHeader + PanelContent

*** Parameters

None.

*** Examples

{{{begin_panel}}} Panel example \ This is a formatted block of text... {{{end_panel}}}

*** Remarks

You'd better use a "special block", such as:

#+begin_example ,#+begin_panel ,Panel example \ This is a formatted block of text... ,#+end_panel #+end_example


** Tip macro :PROPERTIES: :CUSTOM_ID: tip :END:

*** Code

#+begin_src org ,#+MACRO: begin_tip @@html:

@@ ,#+MACRO: end_tip @@html:

@@ #+end_src

*** Parameters

None.

*** Examples

{{{begin_tip}}} Tip example \ Try doing it this way... {{{end_tip}}}

*** Remarks

You'd better use a "special block", such as:

#+begin_example ,#+begin_tip ,Tip example \ Try doing it this way... ,#+end_tip #+end_example


** Warning macro :PROPERTIES: :CUSTOM_ID: warning :END:

*** Code

#+begin_src org ,#+MACRO: begin_warning @@html:

@@ ,#+MACRO: end_warning @@html:

@@ #+end_src

*** Parameters

None.

*** Examples

{{{begin_warning}}} Warning example \ Be careful! Check that you have... {{{end_warning}}}

*** Remarks

You'd better use a "special block", such as:

#+begin_example ,#+begin_warning ,Warning example \ Be careful! Check that you have... ,#+end_warning #+end_example


** Vertically aligning table row contents

I'm trying to create a simple two-column table. The left column will show images of symbols used in the document, and the right column will explain what those images mean.

#+MACRO: p @@latex:\raisebox{-.5\height}{\includegraphics[scale=.35]{$1}}@@ #+CAPTION: Document Symbols #+ATTR_LATEX: :align lp{5in} :float nil :border 2 :frame border | {{{p(./GreenDot.png)}}} | This symbol indicates that the associated item is in a /normal/ or /successful/ state. | | {{{p(./YellowDots.png)}}} | This symbol denotes a state of /concern/ or /potential trouble/ for the associated item. | | {{{p(./RedDots.png)}}} | This symbol indicates that the associated item is in a /severely troubled/ or /non-functioning/ state. |


  • Navigation and lists

FIXME Problem with the tab title.

** Toc macro :PROPERTIES: :CUSTOM_ID: toc :END:

Insert a table of contents.

*** Code

#+begin_src org ,#+MACRO: toc #+toc: headlines $1 #+end_src

*** Parameters

  1. Number of headline levels.

*** Remarks

The ~toc~ macro can't be inlined in text.

*** Examples

Insert the TOC here, with one headline level:

{{{toc(1)}}}


** Listing

>> This makes it tricky to reference figures in a way that works with

>> both HTML and LaTeX: for HTML one needs to write "Figure [[fig:a]]

>> shows x, Listing [[lst:b]] shows y" (which exports into "Figure

>> 1 shows x, Listing 1 shows y", while for LaTeX one needs to write

>> "Figure [[fig:a]] shows x, Figure [[lst:a]] shows y" (which exports

>> into "Figure 1 shows x, Figure 2 shows y"). I don't know of an easy

>> way to achieve this.

>

> You can use @@html:Listing@@@@latex:Figure@@ [[lst:a]], or with a macro

>

> #+macro: listing @@html:Listing@@@@latex:Figure@@

>

> and

>

> {{{listing}}} [[lst:a]]


  • Dev tools

** Twitter "Share a link" :PROPERTIES: :CUSTOM_ID: twitter-share-link-button :END:

Add a "Share a link" button to your website.

*** Code

#+begin_src org ,#+MACRO: twitter-share-link-button @@html:Tweet@@ #+end_src

*** Parameters

  1. Username.

*** Examples

Insert the Twitter "Share a link" button here:

{{{twitter-share-link-button(f_niessen)}}}


  • Others :noexport:

Keep a library of helpful CSS classes. Useful for debugging, but should be avoided in the release version (separate markup and presentation). Since you can use multiple class names (i.e. ~

...

~), make use of them debugging your markup.

#+begin_src css :tangle no .width100 { width: 100%; } .width75 { width: 75%; } .width50 { width: 50%; } .floatLeft { float: left; } .floatRight { float: right; } .alignLeft { text-align: left; } .alignRight { text-align: right; }

.clear { clear: both; } .float-left { float: left; } .float-right { float: right; }

.highlight { background: #FFFFCC; }

.wrap { width: 960px; margin: 0 auto; }

.img-left { float: left; margin: 4px 10px 4px 0; } .img-right { float: right; margin: 4px 0 4px 10px; }

.nopadding { padding: 0; } .noindent { margin-left: 0; padding-left: 0; } .nobullet { list-style: none; list-style-image: none; } #+end_src

  • Contributing

** Issues

Report issues and suggest features and improvements on the [[https://github.com/fniessen/org-macros/issues/new][GitHub issue tracker]].

** Patches

I love contributions! Patches under any form are always welcome!

** Donations

If you use the org-macros project and feel it is making your life better and easier, you can show your appreciation and help support future development by making today a [[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VCVAS6KPDQ4JC&lc=BE&item_number=org%2dmacros&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted][donation]] through PayPal. Thank you!

Regardless of the donations, org-macros will always be free both as in beer and as in speech.

  • License

Copyright (C) 2014-2022 Fabrice Niessen

Author: Fabrice Niessen \ Keywords: org-mode macros

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

#+begin_html :license-gpl-blue.svg

btn_donate_LG.gif #+end_html