matplatex 0.10.0.0.dev0__tar.gz → 0.10.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/PKG-INFO +6 -13
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/README.md +5 -12
- matplatex-0.10.2/src/matplatex/__about__.py +1 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/ui.py +25 -22
- matplatex-0.10.0.0.dev0/src/matplatex/__about__.py +0 -1
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/.github/workflows/publish-to-pypi.yml +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/.gitignore +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/COPYING +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/doc/example.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/docs/example/example.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/pyproject.toml +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/__init__.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/extensions.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/journal_settings.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/latex_input.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/settings.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/string_replacements.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/tools.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/__init__.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/latex_test_code.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/test_cmyk_conversion.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/test_extraction.py +0 -0
- {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/test_latex_compilation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: matplatex
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.2
|
|
4
4
|
Summary: A package to save matplotlib figures for easy inclusion in LaTeX.
|
|
5
5
|
Project-URL: GitHub, https://github.com/johashei/matplatex
|
|
6
6
|
Author-email: Johannes Sørby Heines <j.s.heines@protonmail.ch>
|
|
@@ -47,26 +47,19 @@ matplatex.save(fig, "myfig")
|
|
|
47
47
|
```
|
|
48
48
|
this will create two files named `myfig.pdf` and `myfig.pdf_tex`.
|
|
49
49
|
|
|
50
|
-
In your LaTeX
|
|
50
|
+
In your LaTeX preamble, add the following
|
|
51
51
|
```
|
|
52
52
|
\newlength{\figurewidth}
|
|
53
|
-
\
|
|
53
|
+
\newlength{\matplatextmp}
|
|
54
54
|
```
|
|
55
55
|
and include the figure as such:
|
|
56
56
|
```
|
|
57
|
+
\setlength{\figurewidth}{<your desired width>}
|
|
57
58
|
\input{myfig.pdf_tex}
|
|
58
59
|
```
|
|
59
60
|
LaTeX commands such as `\small` and `\textbf{}` will affect the text in the expected way.
|
|
60
61
|
|
|
61
62
|
## Options
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`matplatex.save` accepts the following keyword options:
|
|
66
|
-
- `widthcommand`: string
|
|
67
|
-
Command used to set the width of the figure. Default: `\figurewidth`.
|
|
68
|
-
- `draw_anchors`: bool
|
|
69
|
-
Mark the text anchors in the figure. Useful for debugging. Default: `False`.
|
|
70
|
-
- `verbose`: bool
|
|
71
|
-
Print message upon successful save. Default: `True`.
|
|
72
|
-
|
|
64
|
+
See the docstring of `matplatex.save()` for information on optional arguments.
|
|
65
|
+
A proper documentation is coming eventually.
|
|
@@ -26,26 +26,19 @@ matplatex.save(fig, "myfig")
|
|
|
26
26
|
```
|
|
27
27
|
this will create two files named `myfig.pdf` and `myfig.pdf_tex`.
|
|
28
28
|
|
|
29
|
-
In your LaTeX
|
|
29
|
+
In your LaTeX preamble, add the following
|
|
30
30
|
```
|
|
31
31
|
\newlength{\figurewidth}
|
|
32
|
-
\
|
|
32
|
+
\newlength{\matplatextmp}
|
|
33
33
|
```
|
|
34
34
|
and include the figure as such:
|
|
35
35
|
```
|
|
36
|
+
\setlength{\figurewidth}{<your desired width>}
|
|
36
37
|
\input{myfig.pdf_tex}
|
|
37
38
|
```
|
|
38
39
|
LaTeX commands such as `\small` and `\textbf{}` will affect the text in the expected way.
|
|
39
40
|
|
|
40
41
|
## Options
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`matplatex.save` accepts the following keyword options:
|
|
45
|
-
- `widthcommand`: string
|
|
46
|
-
Command used to set the width of the figure. Default: `\figurewidth`.
|
|
47
|
-
- `draw_anchors`: bool
|
|
48
|
-
Mark the text anchors in the figure. Useful for debugging. Default: `False`.
|
|
49
|
-
- `verbose`: bool
|
|
50
|
-
Print message upon successful save. Default: `True`.
|
|
51
|
-
|
|
43
|
+
See the docstring of `matplatex.save()` for information on optional arguments.
|
|
44
|
+
A proper documentation is coming eventually.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.10.2"
|
|
@@ -37,34 +37,37 @@ def save(
|
|
|
37
37
|
trim: bool = False,
|
|
38
38
|
verbose: int = 1
|
|
39
39
|
):
|
|
40
|
-
"""Save matplotlib Figure with text in a separate tex file.
|
|
40
|
+
r"""Save matplotlib Figure with text in a separate tex file.
|
|
41
41
|
|
|
42
42
|
Arguments
|
|
43
43
|
---------
|
|
44
|
-
figure
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
figure : matplotlib figure
|
|
45
|
+
The matplotlib Figure to save
|
|
46
|
+
filename : str or path
|
|
47
|
+
The name to use for the files, without extention. This will
|
|
48
|
+
create the files: `<filename>.tex` and `<filename>.gfx.<format>`
|
|
49
49
|
|
|
50
50
|
Optional keyword arguments
|
|
51
51
|
--------------------------
|
|
52
|
-
format
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
format : str, default 'pdf'
|
|
53
|
+
The format in which to save the no-text figure.
|
|
54
|
+
widthcommand : str, default r'\figurewidth'
|
|
55
|
+
The LaTeX length command which will be used to define the width
|
|
56
|
+
of the figure.
|
|
57
|
+
scale_fontsize : bool or float, default False
|
|
58
|
+
Map the fontsizes in the figure to LaTeX font sizes. If a float
|
|
59
|
+
is given, the fontsizes are scaled by that value before mapping.
|
|
60
|
+
If False, no LaTeX font size commands are used.
|
|
61
|
+
draw_anchors : bool, default False
|
|
62
|
+
If True, mark the text anchors on the figure. Useful for debugging.
|
|
63
|
+
externalize : bool, default False
|
|
64
|
+
Set to True if you want to use manual tikz externalization.
|
|
65
|
+
trim : bool, default False
|
|
66
|
+
Trim LaTeX bounding box to figure size, ignore overflowing text.
|
|
67
|
+
verbose : {0, 1, 2}
|
|
68
|
+
0: Print nothing.
|
|
69
|
+
1: Print save message to stdout. (default)
|
|
70
|
+
2: Also print runtime info to stderr.
|
|
68
71
|
"""
|
|
69
72
|
filepath = Path(filename)
|
|
70
73
|
graphics_path = filepath.with_name(f'{filepath.name}.gfx.{format}')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.10.0.0.dev0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|