1. Igor Támara
  2. hgbook

Commits

Bryan O'Sullivan  committed e9d5b4c

First SVG image!

  • Participants
  • Parent commits d450d67
  • Branches default

Comments (0)

Files changed (6)

File .hgignore

View file
  • Ignore whitespace
 
 syntax: glob
 
-.run
-.*.swp
-*~
 *.aux
 *.bbl
 *.bib
 *.lo[fgt]
 *.out
 *.pdf
+*.png
 *.tmp
 *.toc
 *.xref
+*~
+.*.swp
+.run

File en/00book.tex

View file
  • Ignore whitespace
 \documentclass{book}
 \usepackage{enumerate}
 \usepackage{fullpage}
-\usepackage{graphics}
+\usepackage{ifpdf}
+\usepackage{graphicx}
 \usepackage{newcent}
 \usepackage{fancyvrb}
 % leave hyperref until last

File en/99defs.tex

View file
  • Ignore whitespace
 \newcommand{\hgcmdargs}[2]{``\texttt{hg #1 #2}''}
 
 \newsavebox{\notebox}
-\newenvironment{note}{\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}{\end{minipage}\end{lrbox}\begin{center}\fbox{\usebox{\notebox}}\end{center}}
+\newenvironment{note}%
+  {\begin{lrbox}{\notebox}\begin{minipage}{0.7\textwidth}\textbf{Note:}\space}%
+  {\end{minipage}\end{lrbox}\fbox{\usebox{\notebox}}}
 
 \DefineVerbatimEnvironment{codesample4}{Verbatim}{frame=single,gobble=4,numbers=left,commandchars=\\\{\}}
 \newcommand{\interaction}[1]{\VerbatimInput[frame=single,numbers=left,commandchars=\\\{\}]{examples/#1.out}}
 
+\ifpdf
+  \newcommand{\grafix}[1]{\includegraphics[scale=0.2]{#1_pdf.png}}
+\else
+  \newcommand{\grafix}[1]{\includegraphics{#1.png}}
+\fi
+
 %%% Local Variables: 
 %%% mode: latex
 %%% TeX-master: "00book"

File en/Makefile

View file
  • Ignore whitespace
 	99defs.tex \
 	mq.tex
 
+image-sources := \
+	mq-stack.svg
+
 example-sources := \
 	examples/run-example \
 	examples/mq.qinit-help \
 
 pdf: pdf/hgbook.pdf
 
-pdf/hgbook.pdf: $(sources) examples
+pdf/hgbook.pdf: $(sources) $(image-sources:%.svg=%_pdf.png) examples
 	mkdir -p $(dir $@)
 	pdflatex $(call latex-options,$@) $< || (rm -f $@; exit 1)
 	cp 99book.bib $(dir $@)
 	perl -pi -e 's/&#x00([0-7][0-9a-f]);/chr(hex($$1))/egi' $(dir $(1))/*.html
 endef
 
-html/onepage/hgbook.html: $(sources) examples
+html/onepage/hgbook.html: $(sources) $(image-sources:%.svg=%.png) examples
 	$(call htlatex,$@,$<)
+	cp $(image-sources:%.svg=%.png) $(dir $@)
 
-html/split/hgbook.html: $(sources) examples
+html/split/hgbook.html: $(sources) $(image-sources:%.svg=%.png) examples
 	$(call htlatex,$@,$<,2)
+	cp $(image-sources:%.svg=%.png) $(dir $@)
 
-.PHONY: examples
+%.png: %.svg
+	inkscape -D -e $@ $<
+
+%_pdf.png: %.svg
+	inkscape -D -d 300 -e $@ $<
+
+%.eps: %.svg
+	inkscape -E $@ $<
 
 examples: examples/.run
 
 	cd examples && ./run-example
 
 clean:
-	rm -rf html pdf *.aux *.dvi *.log *.out examples/*.out examples/.run
+	rm -rf html pdf *.eps *.png *.aux *.dvi *.log *.out examples/*.out examples/.run

File en/mq-stack.svg

View file
  • Ignore whitespace
Old
Old image
New
New image

File en/mq.tex

View file
  • Ignore whitespace
 \subsection{Manipulating the patch stack}
 
 The previous discussion implied that there must be a difference
-between ``known'' and ``applied'' patches, and there is.  MQ can know
-about a patch without it being applied in the repository.
+between ``known'' and ``applied'' patches, and there is.  MQ can
+manage a patch without it being applied in the repository.
 
 An \emph{applied} patch has a corresponding changeset in the
 repository, and the effects of the patch and changeset are visible in
 or two patches, the output of \hgcmd{qseries} remains the same, while
 that of \hgcmd{qapplied} has changed.
 
+\begin{figure}
+  \centering
+  \grafix{mq-stack}
+  \caption{Applied and unapplied patches in the MQ patch stack}
+  \label{fig:mq:stack}
+\end{figure}
+
 MQ does not limit you to pushing or popping one patch.  You can have
 no patches, all of them, or any number in between applied at some
 point in time.