LaTeX equations generator for Jupyter Notebooks
For examples of use view the Tests.ipynb
file
For ease of use, run the CMD_gen.py
file, that will open a GUI window helping in the generation of the command, outputting it to the clipboard
- Download the repo.
- Open a new Jupyter Notebook file and import the repo.
an example of how to import the repo exists in the
Tests.ipynb
file, however you will need to either have the current file in the same dir, or import the repo from the different dir of which the file currently is in. - Run the
CMD_gen.py
file in a different window. - Enter the relevant inputs:
-
var
: the output of the equation {string}. -
eq
: the actual equation {string}.if there are variables in the equation, you should put them as a string inside the eq string. meaning:
eq=f'A+B'
. for more info open theTests.ipynb
file. -
copy
: should the equation be copied to the clipboard {True/False}. -
auto_units
: should the script automatically add scientific units to the final answer {True/False}.for example, if the
var
is$V_0$ , it will add$[V]$ . auto units work only if the number is to the power bigger than$-12$ and smaller than$12$ . -
units
: manual units {string}.only works if
auto_units
is false. -
eng
: should the script automatically add engineering notation to the final answer {True/False}.for example, if the final answer is
$1000 [V]$ , it will add$1 [kV]$ . -
phasor
: should the script automatically format all of the numbers as phasors {True/False}.phasor, units and eng do not work together.
-
two_line
: should the script make each step it's own line {True/False}.for calculations with only numbers and no variables, this must be False. for example for the following equation:
$1 + 2 + 3$ , this will not work if it is True. -
declare
: declare a new variable {True/False}.only mark True if the variable has not been set yet in the script.
-
fin_ans
: should the script automatically add a box marking the answer {True/False}.mainly for marking an import / the final calculation of a question.
-
temp
: temporary caculation {0/1/2}.for use examples check the
Tests.ipynb
file. -
out
: should the output be markdown or latex {Markdown/String}.String is latex output.
-
- Press
OK
the entire command will be entered in your clipboard.
- Go to the Jupyter Notebook and paste the command in a python cell.
- Run the cell.
of course after running the cell importing the repo.
For the numpy package, just import it as np
, and use the np.
in the string of eq
.
Work partially.
Work for simple cases (add/sub/multiply).
Does not work well, however dividing by the number instead works as expected.
meaning instead of multiplying by
$10^-6$ just divide by$10^6$