I'm only talking about using pythhon
for my experiments, but I think the data can be read by python
. On top of that, when I tried to create a pdf, I wish I could automate the following things.
Regarding the last figure, honestly, I think that it is effective when the parameters that affect the figure change at a high rate or when using several similar figures with only the parameters changed.
python
and compiling tex
Since python
will be executed every time tex
is compiled, it is not possible to regenerate the figure to be inserted by just elaborating one character. (When commands such as platex
, dvipdfmx
and pythontex
are executed together in a build script)
Texpad · Smoothest way to write LaTeX
There is a charge, but is it 2 weeks for a trial? You can use it.
The reason why it is Texpad
is that I wanted to be introduced to it by a friend and use it. We are considering an editor for tex
, including paid ones. (For now, do you do your best by writing gulp
in TexShop
or ʻatom`? Reference)
I couldn't create the / usr / textbin
folder with ʻEl Capitan, so I referred to [here](http://qiita.com/hideaki_polisci/items/3afd204449c6cdd995c9), but
TexLive PythonTex
is included in` from the beginning.
Also, I need the Pygments module.
pip install pygments
To do.
There is also a Download MacTex
button on the Distribution
tab of the Texpad
preferences.
In TexPad
, you can select as follows.
You can also run the build script under the project folder with bash
by checkingUse
.tpbuild script`.
※ bib
If you check References
, it seems that biber
will also be done.
I haven't written a dissertation yet, so I'm not sure how to manage it with bib
.
Texpad · Help · Custom Typesetting in Texpad OS X using Build Scripts
A sample is here.
I'm using pyenv
, but the pythontex
command I wrote in the build script didn't work.
The cause was an error that the pygments
module that should have been installed is missing.
I wasn't sure if it was a problem of the user who executed the build script, but for the time being, I added PYTHONPATH
in the build script and it was quite good.
Hello PythonTex!
Basically, you can define a function of python
etc. in the{pycode}
environment and output it on tex
with the \ py
command.
The following tex
is <img height =" 48px "src =" https://qiita-image-store.s3.amazonaws.com/0/32636/3c371aee-c390-f459-c8a5-fb9daf88f1cd.png " > Becomes.
\begin{pycode}
# -*- coding: UTF-8 -*-
def hello():
msg = r"Hello \textbf{PythonTex}!"
return msg
\end{pycode}
\py{hello() + " via py"}
A Gentle Introduction to PythonTeX
In the slide above, a formula using sympy, a diagram using matplotlib, [webkit2png] ](Https://github.com/adamn/python-webkit2png) is used to insert a web page and automatically generate a table
.
However, I used print
to output directly in the pycode
environment, but I couldn't do it in my own environment. By the way, I am 2.7
.
In the slide above, it is combined with \ newcommand
and sympy
.
There is a latex
command in sympy
, but it would be great if you could automatically generate it from the formula you are actually using without having to create a formula with sympy
.
I'm thinking of using a Theano
based library, so I felt like it might convert the graph structure of the Theano
formula to sympy
or latex
, but I found it. did not.
(Look for more, and if you don't have one, you can either write it yourself or write it normally with sympy
, but if you write it with sympy
, I wonder if you should write it normally with tex
. I don't know what the simplication
of the differential formula is. Reference )
This seems easy to do.
It's already done with data, but it's about how to actually manage the experimental results before making it into a pdf. There is a strong theory that it is saved in Excel (not plain text), but in that case, I'm thinking of using tabfileio. I would like to write a memorandum again after using it. (For csv, even if there is a module as standard.)
PythonTeX and Matplotlib-Something to write down
\begin{pycode}
・ ・ ・
pylab.savefig('myplot.pdf')
\end{pycode}
\begin{figure}
\includegraphics{myplot.pdf}
\end{figure}
I feel said.
For this, I think that you should save the image once and load it normally with tex
.
If you use rodeo, the hurdle for saving graph images will be lowered with python
(it seems to be possible graphically), so I would like to use it. An editor that runs in a browser based on ʻipython`. It seems that the data structure of pandas is displayed in the view.
TikZ
Plot of the Brillouin Function | TikZ example
The above page is luatex
and the function is defined by lua
and TikZ
is made, but isn't it possible to use the python
version of this? And sweat
It seems that you should finish the experiment as soon as possible before investigating the writing environment. ..
Recommended Posts