Commit 979e36ca authored by Ivan Yossi's avatar Ivan Yossi 👌 Committed by Wolthera van Hövell

Add in Latex config and make file.

Latex configuration options
---------------------------
preamble redefines sphinxsgraphics to limit the size to max page width and height so no images is ever cropped

figure ht! reduce the times an image is not placed correctly within the document flow (but it is not perfect)

I add a full content table for the pdf.

Krita Docs Latex preprocessor and image creation MakeFile
---------------------------------------------------------

Prepares latex build output for LaTeX formats and compile options

Make file converts
SVG -> PDF
GIF -> PNG

Updates kritaManual.tex so all files call their new converted versions

Adds LATEXMKOPTS=-xelatex -interaction=nonstopmode

xelatex: tells mklatex to use xelaex as backend for pdflatex, this is preferred for unicode and some sphinx modules
-interaction=nonstopmode DO NOT stop because of errors. (If all dependencies are already intalled in Tex then most errors are warnings-like anyways)

Differential Revision: https://phabricator.kde.org/D13204
Differential Revision: https://phabricator.kde.org/D13205
parent 0866b8d9
......@@ -235,10 +235,13 @@ htmlhelp_basename = 'documentationProjectNamedoc'
# -- Options for LaTeX output ------------------------------------------------
latex_engine = 'xelatex'
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
'maxlistdepth': '8',
'figure_align':'ht!',
# The font size ('10pt', '11pt' or '12pt').
#
......@@ -246,7 +249,14 @@ latex_elements = {
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
'preamble': r'''
\usepackage[export]{adjustbox}
\let\oincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{
\oincludegraphics[#1,max width=\linewidth,max height=\textheight]{#2}
}
''',
'tableofcontents':'\sphinxtableofcontents',
# Latex figure (float) alignment
#
......@@ -260,6 +270,11 @@ latex_documents = [
(master_doc, 'kritaManual.tex', project,
author, 'manual'),
]
latex_show_pagerefs=True
# copy latex scripts to build dir
latex_additional_files = [
"latexImageMakefile",
]
# -- Internationalization Options --------------------------------------------
......
# Makefile Krita docs latex-imageconvert
# Convert all non standard image formats to latex friendly
#
# Latex can work with svg, but inkscape is needed!
#
WDIR=${PWD}
SVGCC=inkscape
# image conversion
SIPS=sips
CONVERT=convert
SVGToPDF := $(wildcard *.svg)
GIFToPNG := $(wildcard *.gif)
svgConverted := $(SVGToPDF:.svg=.pdf)
gifConverted := $(GIFToPNG:.gif=.png)
all: $(gifConverted) $(svgConverted)
# Modify paths from original tex file
sed -i -e 's/}\.svg/}\.pdf/g; s/}\.gif/}\.png/g' kritaManual.tex
sed -i -e 's/^LATEXMKOPTS.*$//LATEXMKOPTS=-xelatex -interaction=nonstopmode/' Makefile
# compile TeX file
# xelatex kritaManual.tex -interaction nonstopmode
%.pdf: %.svg
$(SVGCC) $(WDIR)/$< -z -A $(WDIR)/$@
%.png: %.gif
ifeq ($(TERM_PROGRAM),Apple_Terminal)
$(SIPS) -s format png $< --out $@
else
$(CONVERT) $< -flatten PNG32:$@
endif
clean:
rm $(gifConverted) $(svgConverted)
......@@ -30,10 +30,10 @@ You can click on one and to load it into the docker, or click on import resource
.. versionadded:: 4.0
* Double |mouseleft| a swatch will call up the edit window where you can change the color, the name, the id and whether it's a spot color. On a group this will allow you to set the group name.
* |mouseleft| drag will allow you to drag and drop swatches and groups to order them.
* Pressing the :guilabel:`+` icon will allow you to add a new swatch.
* Pressing the Folder icon will allow you to add a new group.
* Double |mouseleft| a swatch will call up the edit window where you can change the color, the name, the id and whether it's a spot color. On a group this will allow you to set the group name.
* |mouseleft| drag will allow you to drag and drop swatches and groups to order them.
* Pressing the :guilabel:`+` icon will allow you to add a new swatch.
* Pressing the Folder icon will allow you to add a new group.
The edit and new color dialogs ask for the following:
......
......@@ -31,6 +31,7 @@ This is specifically about support on Windows, not Linux or OSX.
.. list-table::
:header-rows: 1
:widths: 1 2 1
* - Brand
- Model
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment