# macro.org -- Pamhyr documentation macro
# Copyright (C) 2023  INRAE
#
# 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 <https://www.gnu.org/licenses/>.

# -*- coding: utf-8 -*-

# Constant name
#+MACRO: pamhyr        \textsc{PAMHyR}
#+MACRO: pamhyr2       \textsc{Pamhyr2}
#+MACRO: mage          \textsc{Mage}
#+MACRO: mage7         \textsc{Mage7}
#+MACRO: mage8         \textsc{Mage8}
#+MACRO: rubarbe       \textsc{RubarBE}
#+MACRO: adists        \textsc{AdisTS}
#+MACRO: mascaret      \textsc{Mascaret}
#+MACRO: inrae         INRAE
#+MACRO: latex         \LaTeX

# Information
#+MACRO: version       (eval (pamhyr-version))
#+MACRO: current-file  (eval (pamhyr-current-file))

# Special format
#+MACRO: file          =$1=

# Biblio
#+MACRO: cite          [cite:$1]
#+MACRO: biblio        \bibliography{documentation}

# Icons
#+MACRO: bulb \faIcon{lightbulb}
#+MACRO: OK  \faIcon{check}

#+MACRO: linux  \faIcon{linux}
#+MACRO: windows  \faIcon{windows}

#+MACRO: python  \faIcon{python}
#+MACRO: java  \faIcon{java}

# Wrapper
#+NAME: attr_wrap
#+HEADER: :var width="\\textwidth"
#+HEADER: :var caption=""
#+HEADER: :var smallcaption=""
#+HEADER: :var name=""
#+HEADER: :var data=""
#+HEADER: :var float="nil"
#+BEGIN_SRC sh :results output :exports none
  echo "#+CAPTION[$smallcaption]: $caption"
  echo "#+NAME: $name"
  echo "#+ATTR_LATEX: :width $width :float $float"
  echo "$data"
#+END_SRC
