Welcome to pandoc-latex-tip’s documentation!¶
Explanation¶
In the metadata block, specific set of classes can be defined to
decorate HTML span
, div
, code
or codeblock
elements by
icons generated from popular icon collections:
Collection |
Version |
Author |
License |
---|---|---|---|
Font-Awesome |
4.7, 5.x |
||
Glyphicons |
3.3 |
||
Material Design |
2.x |
||
It’s also possible to specify a tip on such an element using description by attribute.
The metadata block add information using the pandoc-latex-tip
entry
by a list of definitions:
pandoc-latex-tip:
- classes: [tip, error]
icons: [bug]
- classes: [tip]
The metadata block above is used to add a bug
icon to span
,
div
, code
or codeblock
elements which have tip
and
error
classes and a generic icon to span
, div
, code
or
codeblock
elements that have only a tip
class.
Each entry of pandoc-latex-tip
is a YAML dictionary containing:
classes
: the set of classes of thespan
,div
,code
orcodeblock
elements to which the transformation will be applied. This parameter is mandatory.icons
: the list of icons that will decorate thespan
,div
,code
orcodeblock
elements ([exclamation-circle]
by default)size
: the size of the rendered icons (18
by default)position
: the position of the icons (left
by default orright
orinner
orouter
)color
: the default color for icons which do not have a color description by themselves
Each icon is either:
an icon name taken from the Font-Awesome icons collection 4.7.0
a YAML object containing
a
name
property (for the icon)a
color
property taken from the X11 color collectionan icon
collection
property (eitherfontawesome
,glyphicons
ormaterialdesign
)an icon collection
version
property (4.7
or5.x
forfontawesome
,3.3
forglyphicons
and2.x
formaterialdesign
)an icon collection
variant
property (Font-Awesome5.x
version define 3 variantsbrands
,regular
,solid
)a
link
property to make the icon clickable
If only an icon name is specified (in this case, you can simply put its
name instead of inserting it in a list), the color is assumed to be
Black
, the version is assumed to be 4.7
and the variant is
assumed to be regular
.
It’s also possible to specify a tip for individual elements using attribute description:
latex-tip-icon
: the name of the iconlatex-tip-size
: the size of the rendered icon (18
by default)latex-tip-position
: the position of the icon (left
by default orright
orinner
orouter
)latex-tip-color
: the color for the icon (black
by default)latex-tip-name
: the collection name property (fontawesome
by default)latex-tip-version
: the collection version property (4.7
by default)latex-tip-variant
: the collection variant property (regular
by default)latex-tip-link
: a link for the clickable icon
The following LaTeX packages are required:
marginnote
etoolbox
changepage
needspace
Example¶
Demonstration: Using pandoc-latex-tip-sample.txt as input gives output file in pdf.