texlive[48932] Master: ditaa (18oct18)
commits+karl at tug.org
commits+karl at tug.org
Thu Oct 18 22:28:02 CEST 2018
Revision: 48932
http://tug.org/svn/texlive?view=revision&revision=48932
Author: karl
Date: 2018-10-18 22:28:01 +0200 (Thu, 18 Oct 2018)
Log Message:
-----------
ditaa (18oct18)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/ditaa/
trunk/Master/texmf-dist/doc/latex/ditaa/README
trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf
trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.tex
trunk/Master/texmf-dist/doc/latex/ditaa/example.tex
trunk/Master/texmf-dist/doc/latex/ditaa/resources/
trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/
trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.ditaa
trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png
trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.ditaa
trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png
trunk/Master/texmf-dist/tex/latex/ditaa/
trunk/Master/texmf-dist/tex/latex/ditaa/ditaa.sty
trunk/Master/tlpkg/tlpsrc/ditaa.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/ditaa/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/README (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/README 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,56 @@
+= The LaTeX ditaa package
+
+With this, you will not need to bring your diagrams outside your ```.tex``` file and not to worry about wiring such files for diagrams, and tools (Microsoft Visio, PowerPoint, Libre Office tools, as such) from which they are created.
+
+```
+\begin{ditaa}{ditaa caption example}{ditaaexample}
+ +-----+ +----+ +---+
+ |Store+---->|This+---->|One|
+ +--+--+ +----+ +---+
+ |
+ V
+ +-----+
+ |THIS |
+ +--+--+
+ |
+ V
+ +-----------+ +--+
+ |another one+---->|Hi|
+ +-----------+ +--+
+\end{ditaa}
+
+```
+
+The source above will be converted into a following diagram and incorporated in your final PDF.
+
+.Figure Rendered Ascii Art
+[#img-sunset]
+[caption="Figure 1: ",link=resources/rendered.png]
+image::resources/rendered.png[Rendered Ascii Art,480,300]
+
+== Prerequisites
+https://github.com/asciidoctor[Asciidoctor @ *GitHub*]
+
+* You need to have http://ditaa.sourceforge.net/[ditaa] installed. (Need to be able to run ```ditaa``` from your command line). Fortunately, recent package managers such as ```apt``` allow you to install it with a single command line ```sudo apt install ditaa```. ```brew``` let me do similar ```sudo brew isntall ditaa``` on my mac. For windows, sorry, please let me know how to do that...
+* You need to give an option ```--shell-escape``` to your LaTeX compiler (such as ```pdflatex```, ```latex```, etc) command whichever you use.
+
+
+== How to use
+
+* Place the ```ditaa.sty``` file at the same directory as your ```.tex``` file.
+* Create ```ditaa``` directory under the directory you have for the other non-ditaa images. This package will create ```.ditaa``` and ```.png``` files.
+* Do ```usepackage[imagepath=IMAGEPATH]{ditaa}``` beffore ```\begin{document}```. The IMAGEPATH is the directory you have images.
+* Compile your ```.tex``` files as usual, but giving ```--shell-escape``` option to your ```(pdf)latex``` command.
+
+== Tips
+Online sites such as [ascii-flow](http://stable.ascii-flow.appspot.com/#Draw) will be your friends!
+
+== Future Works
+* Make it possible to define caption and filename independently.
+* ~~Improve the way to define resource directory.~~
+* ~~Make it possible to specify image size.~~ (Now you can specify image width. See the example)
+* I want to use this in OverLeaf. Publish in CTAN? Help me. I'm a LaTeX newbie.
+
+== References
+* https://github.com/deselaers/latex-beamerposter[latex-beamerposter]: I learned a lot from this; such as how to package my .sty, how to organize directories under my repo for LaTeX style package, etc.
+
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf 2018-10-18 20:26:46 UTC (rev 48931)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf 2018-10-18 20:28:01 UTC (rev 48932)
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.tex 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,108 @@
+\documentclass[pagesize=auto]{scrartcl}
+
+\addtokomafont{title}{\rmfamily}
+
+\title{The \textsf{ditaa} package}
+\author{Hiroshi Ukai}
+\date{2018/10/18}
+
+
+\usepackage{verbatim}
+\def\imagepath{./resources}
+\usepackage[imagepath=\imagepath]{ditaa}
+\graphicspath{ {\imagepath/} }
+
+\begin{document}
+
+\maketitle
+
+\noindent
+The \LaTeX\ \textsf{ditaa} package renders your ascii art inside your LaTeX files into pretty image files which you can use them in your papers.
+
+\minisec{Usage:}
+To \texttt{usepackage} \textbf{ditaa}, typically do following.
+\begin{verbatim}
+ \def\imagepath{./resources}
+ \usepackage[imagepath=\imagepath]{ditaa}
+ \graphicspath{ {\imagepath/} }
+\end{verbatim}
+
+A vaiable \texttt{\textbackslash imagepath} points a directory that your images reside.
+Under it, you need to create a directory \texttt{ditaa} in advance.
+In this directory, \texttt{ditaa} environment creates its working files.
+
+\minisec{Features:}
+%
+This is a ditaa diagram example.
+\begin{verbatim}
+ \begin{ditaa}[8cm]{ditaa caption example}{ditaaexample}
+ +--------+ +-------+ +-------+
+ | | --+ ditaa +--> | |
+ | Text | +-------+ |diagram|
+ |Document| |!magic!| | |
+ | {d}| | | | |
+ +---+----+ +-------+ +-------+
+ : ^
+ | Lots of work |
+ +-------------------------+
+ \end{ditaa}
+\end{verbatim}
+
+The fragment above will be rendered into following diagram.
+
+\begin{ditaa}[8cm]{ditaa caption example}{ditaaexample}
+ +--------+ +-------+ +-------+
+ | | --+ ditaa +--> | |
+ | Text | +-------+ |diagram|
+ |Document| |!magic!| | |
+ | {d}| | | | |
+ +---+----+ +-------+ +-------+
+ : ^
+ | Lots of work |
+ +-------------------------+
+\end{ditaa}
+\pagebreak
+And you can specify image width like this Figure.\ref{fig:ditaaexample2}.
+
+\begin{verbatim}
+ \begin{ditaa}[6cm]{ditaa caption example2}{ditaaexample2}
+ +---------+
+ | cBLU |
+ | |
+ | +----+
+ | |cPNK|
+ | | |
+ +----+----+
+ \end{ditaa}
+\end{verbatim}
+
+To denote your diagram, you can do
+
+\begin{verbatim}
+
+ Figure~\ref{fig:ditaaexample2}
+
+\end{verbatim}
+
+, where \texttt{ditaaexample2} is the second argument you gave to the \texttt{ditaa} environment as you see above.
+The prefix \texttt{fig:} is given by \texttt{ditaa} environment automatically.
+
+\begin{ditaa}[6cm]{ditaa caption example2}{ditaaexample2}
+ +---------+
+ | cBLU |
+ | |
+ | +----+
+ | |cPNK|
+ | | |
+ +----+----+
+\end{ditaa}
+
+Enjoy!
+
+\minisec{ChangeLog:}
+%
+\begin{labeling}[\hspace{\labelsep}--]{0.9}
+\item[0.9] Preparation for first \textsf{ditaa} release.
+\end{labeling}
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/ditaa.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/ditaa/example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/example.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/example.tex 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,35 @@
+% Preamble
+\documentclass[11pt]{article}
+
+% Packages
+\usepackage{a4wide}
+\def\imagepath{./resources/graphics}
+\usepackage[imagepath=\imagepath]{ditaa}
+\graphicspath{ {\imagepath/} }
+
+\begin{document}
+ This is a ditaa diagramm example.
+ \begin{ditaa}{ditaa caption example}{ditaaexample}
+ +--------+ +-------+ +-------+
+ | | --+ ditaa +--> | |
+ | Text | +-------+ |diagram|
+ |Document| |!magic!| | |
+ | {d}| | | | |
+ +---+----+ +-------+ +-------+
+ : ^
+ | Lots of work |
+ +-------------------------+
+ \end{ditaa}
+ Enjoy!
+ And you can even specify image width like this Figure.\ref{fig:ditaaexample2}.
+ \begin{ditaa}[6cm]{ditaa caption example2}{ditaaexample2}
+ +---------+
+ | cBLU |
+ | |
+ | +----+
+ | |cPNK|
+ | | |
+ +----+----+
+ \end{ditaa}
+\end{document}
+
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.ditaa
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.ditaa (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.ditaa 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,9 @@
+ +--------+ +-------+ +-------+
+ | | --+ ditaa +--> | |
+ | Text | +-------+ |diagram|
+ |Document| |!magic!| | |
+ | {d}| | | | |
+ +---+----+ +-------+ +-------+
+ : ^
+ | Lots of work |
+ +-------------------------+
Added: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png 2018-10-18 20:26:46 UTC (rev 48931)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png 2018-10-18 20:28:01 UTC (rev 48932)
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.ditaa
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.ditaa (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.ditaa 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,7 @@
+ +---------+
+ | cBLU |
+ | |
+ | +----+
+ | |cPNK|
+ | | |
+ +----+----+
Added: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png
===================================================================
--- trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png 2018-10-18 20:26:46 UTC (rev 48931)
+++ trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png 2018-10-18 20:28:01 UTC (rev 48932)
Property changes on: trunk/Master/texmf-dist/doc/latex/ditaa/resources/ditaa/ditaaexample2.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/ditaa/ditaa.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/ditaa/ditaa.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/ditaa/ditaa.sty 2018-10-18 20:28:01 UTC (rev 48932)
@@ -0,0 +1,47 @@
+% 'ditaa' package
+%
+% (c) Hiroshi Ukai
+%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ditaa}
+[2018/09/27 v0.01 LaTeX package for embedding ditaa style ascii art]
+
+\RequirePackage{fancyvrb}
+\RequirePackage{graphicx}
+\RequirePackage{kvoptions}
+
+\DeclareStringOption[]{imagepath}
+\ProcessKeyvalOptions*
+
+%@formatter:off (This line indicates IntelliJ that formatter should be off before this)
+\newenvironment{ditaa}[3][\columnwidth]
+ {
+ \def\ditaacaption{#2}
+ \def\ditaastem{#3}
+ \def\ditaadir{\ditaa at imagepath/ditaa}
+ \def\ditaafile{\ditaadir/\ditaastem.ditaa}
+ \def\ditaafigwidth{#1}
+ \VerbatimOut{\ditaafile}}
+ {\endVerbatimOut
+ \immediate\write18{ditaa -E "\ditaafile" "\ditaadir/\ditaastem.png"}
+ \begin{figure}[ht]
+ \begin{center}
+ \vspace{-1em}
+ \includegraphics[width=\ditaafigwidth]{\ditaadir/\ditaastem.png}
+ \vspace{-2em}
+ \caption{\ditaacaption}
+ \label{fig:\ditaastem}
+ \vspace{-1.5em}
+ \end{center}
+ \end{figure}
+ }
+%@formatter:on (This line indicates IntelliJ that formatter should be off before this)
+%--------------------------------------------------
+
+\endinput
+%%
+%% End of file `ditaa.sty'.
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/ditaa/ditaa.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2018-10-18 20:26:46 UTC (rev 48931)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2018-10-18 20:28:01 UTC (rev 48932)
@@ -220,7 +220,7 @@
delim delimseasy delimset delimtxt denisbdoc dhua
diadia diagbox diagmac2 dialogl diagnose dice dichokey
dickimaw dictsym diffcoeff digiconfigs dijkstra din1505
- dinat dinbrief dingbat directory dirtree dirtytalk disser dithesis
+ dinat dinbrief dingbat directory dirtree dirtytalk disser ditaa dithesis
dk-bib dlfltxb
dnaseq dnp doc-pictex docbytex doclicense
docmfp docmute docsurvey doctools documentation
Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2018-10-18 20:26:46 UTC (rev 48931)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2018-10-18 20:28:01 UTC (rev 48932)
@@ -32,6 +32,7 @@
depend curves
depend dcpic
depend diagmac2
+depend ditaa
depend doc-pictex
depend dottex
depend dot2texi
Added: trunk/Master/tlpkg/tlpsrc/ditaa.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list