How to change the style of bullets in pandoc markdown? - styles

Second level bullets in markdown are "-" when converting to pdf. I would like to change them to some other type of bullets (disc or triangle for example). Is there something I can pass in to the pandoc command line to change this? Or something to change in the template?

It looks like there are two possibilities, both which would involve passing your markdown through a LaTeX style file like so:
pandoc -H format.sty -o foo.pdf bar.md
The first uses the Beamer template -- see this thread on changing bullet styles in Beamer. The second possibility uses the enumitem package -- here's another thread on changing bullet styles in this manner. So, I imagine your style file could simply contain the the following, for instance:
\usepackage{enumitem}
\usepackage{amsfonts}
\setlist[itemize,1]{label=$\bullet$}
\setlist[itemize,2]{label=$\diamond$}
When pandoc converts to PDF, it will place this LaTeX formatting information directly above \begin{document}.

Related

Inkscape/SVG - can I define a color name local to an Inkscape SVG file?

Ok, simple description - is it possible to define variables in an Inkscape (or general) SVG?
I would like to be able to define something like brand-color-primary as a color (with a suitable default) and then be able to re-define it externally by finding something like <color name="brand-color-primary" value="#xxyyzz"> and replacing the value.
Why? Because I could set colors like brand-color-primary, brand-color-secondary, brand-color-border, etc. If I define a transition from brand-color-primary to brand-color-secondary it will use the defined values for the colors. I could then generate a bunch of PNG files with different colors and automate selecting what looks good and what doesn't.
Basically I want to use this in a CI/CD environment with A/B testing to see what color combinations work best.
I can do this already by using 'well known values' for the things I want to change but this has problems - the 'well known values' may be used elsewhere by accident, using a name instead of a 'well known value' is a lot easier and requires less external documentation.
Is this possible? Can I define what is essentially a variable in InkScape SVG?
As Kevin remarked in his comment, svg accepts to be styled through css, so if it accepts css, why would not accept css variables too? The main notice here is that you must get all the inline styles, usually within every svg element, and place them inside style tags on de defs section of the svg code, or place them externally in a css file. to notice too that the election of one or the other method is deppendant of the goal you are pursuing.
In Inkscape, there are two ways to do this:
use custom swatches to create named colors
use CSS styles to assign styles
(This answer augments previous answers from users Moini and SIMBIOSIS)
Perhaps also use an SCSS preprocessor - in there you can define variables.
You can write for-loops in SCSS to, say, generate stepwise variations of styles, e.g., add increments of opacity.
Then style your SVG elements with CSS , by just exchanging 1 the class="" attribute.

How to add svg file extension on a beamer latex?

I am doing a beamer latex presentation and I would like to know how is it possible to add directly a svg graphic on it. I know that it is possible to convert the svg file to pdf format and then include it to beamer, but I want to include the svg file directly (without convert it to pdf format).
The code must looks like:
\begin{frame}
\frametitle{Frame SVG example}
\begin{figure}
\includegraphics[\textwidth]{graphic.svg}
\end{figure}
\end{frame}
Thanks in advance!
You can use the SVG package to achieve that. It will convert your .svg on the fly using Inkscape (which needs to be installed on your computer). It will re-export your figures if the .svg file is changed.
A minimal example could look like this:
\documentclass{beamer}
\usepackage{svg}
\setsvg{inkscape = "C:/Program Files/Inkscape/inkscape.exe" -z -D}
\begin{document}
\begin{frame}
\includesvg[width=0.7\textwidth]{path/to/mysvgimage}
\end{frame}
\end{document}
There are some things to consider, such as text formatting and alignment. Have a look at the documentation of the SVG package.
You also need to make sure that your allow latex to call Inkscape with
pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
or
latex -interaction=nonstopmode --shell-escape %.tex

How to show markdown format text in tkinter?

In python-3.x with tkinter GUI, I developed a program with a regular simple window.
I want to show a markdown format string saved in a string called markdownText on program window:
markdownText='_italic_ or **bold**'
desired output is:
italic or bold
Is there any solution?
I was just searching for a similar solution, and it does indeed not seem like there is a default module/class/library for the combination of Python, TkInter and markdown. However a continued search revealed the following options:
Python-Markdown – This a module capable of parsing markdown into the following output formats: Python-Markdown can output documents in HTML4, XHTML and HTML5.
TkInter displaying html – As the linked answer indicates, Tkhtml can display html "pretty well", and it has a python wrapper
In other words, if you are willing to use an intermediate step of converting into html that might be a viable route for you to display markdown strings within a tkinter GUI.

Programming printable 2d-graphics

I want to create parametric graphics that can be printed exactly on any printer:
setup some constants,
create some points,
create some lines with different line widths and line patterns between those points (a little bit like creating 3d-objects with OpenScad).
A simple example would be to print the net of a cube that can be printed on paper, cut and glued together.
I see following options:
use a normal programming language like Java and a pdf-creation library (see this question)
program using SVG (can this be printed exactly?)
What other options do you see or can you share experiences about the above options?
I'm a web programmer primarily, so I would create html representing what I wanted printed (in your case, it would require using html canvas element with javascript), and then use an html-to-pdf library to make a PDF. I use PrinceXML, but wkhtmltopdf will also do the trick.
HTML Canvas: http://www.w3schools.com/tags/ref_canvas.asp
Prince XML: http://www.princexml.com/

Modifying a SVG path to create word art like effects

I am trying to modify a SVG file which has a path converted from a text. I want to be able to manipulate it to create Word Art like effects (eg: Wedge, Widen, Curved text etc).
I've tried many options like parsing the file and modifying each point, but the results are bizarre and curves go wild. There is no tool/library to do this kinda stuff to an svg file.
In short, I am looking for a tool like ImageMagick but for svg. Please Help!!!
Inkscape can do some of this I think, also see this writeup by Tavmjong Bah. Inkscape uses a library called lib2geom to do these effects, and there seems to be a python wrapper for that library.

Resources