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.
Files changed (23) hide show
  1. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/PKG-INFO +6 -13
  2. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/README.md +5 -12
  3. matplatex-0.10.2/src/matplatex/__about__.py +1 -0
  4. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/ui.py +25 -22
  5. matplatex-0.10.0.0.dev0/src/matplatex/__about__.py +0 -1
  6. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/.github/workflows/publish-to-pypi.yml +0 -0
  7. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/.gitignore +0 -0
  8. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/COPYING +0 -0
  9. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/doc/example.py +0 -0
  10. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/docs/example/example.py +0 -0
  11. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/pyproject.toml +0 -0
  12. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/__init__.py +0 -0
  13. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/extensions.py +0 -0
  14. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/journal_settings.py +0 -0
  15. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/latex_input.py +0 -0
  16. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/settings.py +0 -0
  17. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/string_replacements.py +0 -0
  18. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/src/matplatex/tools.py +0 -0
  19. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/__init__.py +0 -0
  20. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/latex_test_code.py +0 -0
  21. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/test_cmyk_conversion.py +0 -0
  22. {matplatex-0.10.0.0.dev0 → matplatex-0.10.2}/tests/test_extraction.py +0 -0
  23. {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.0.0.dev0
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 document, define the width of the figure with
50
+ In your LaTeX preamble, add the following
51
51
  ```
52
52
  \newlength{\figurewidth}
53
- \setlength{\figurewidth}{<your desired width>}
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
- _Note: this is still under development and may change in future versions._
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 document, define the width of the figure with
29
+ In your LaTeX preamble, add the following
30
30
  ```
31
31
  \newlength{\figurewidth}
32
- \setlength{\figurewidth}{<your desired width>}
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
- _Note: this is still under development and may change in future versions._
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 The matplotlib Figure to save
45
- filename The name to use for the files, without extention. This
46
- will create the files:
47
- - <filename>.tex
48
- - <filename>.gfx.<format>
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 The format in which to save the no-text figure.
53
- widthcommand The LaTeX length command which will be used to
54
- define the width of the figure.
55
- scale_fontsize Map the fontsizes in the figure to LaTeX font sizes.
56
- If a float is given, the fontsizes are scaled by
57
- that value before mapping.
58
- If False, no LaTeX font size commands are used.
59
- draw_anchors If True, mark the text anchors on the figure.
60
- Useful for debugging.
61
- externalize Set to True if you want to use manual tikz
62
- externalization.
63
- trim Trim LaTeX bounding box to figure size, ignore
64
- overflowing text.
65
- verbose: int 0: Print nothing.
66
- 1: Print save message to stdout. (default)
67
- 2: Also print runtime info to stderr.
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