I am really new to the whole LaTeX thing, but it really interests me, so I'd like to learn more about it. I am also looking mostly to do just words, maybe a picture here and there but i just want words on the pages. I found http://blog.mattj.me/latex-page-a-day-calendar# this tutorial type thing on how to do so, I copied the LaTeX file onto the back page, and i finally got that working, a PDF with just the outline of a page-a-day sized calendar. But it is blank, the website says that the next thing needed is a Python script to run and generate the \daypages, but that doesn't make any sense to me, how will doing a python program(if i even knew how) even be inputted into LaTeX? So i guess i have 2 questions, does anyone know how to write up this python program, and how am i supposed to use it in LaTeX? thanks so much.
1 Answer
Steps for this to work:
Create the latex code, which you have compiled correctly
Have python, which you have done
Create a file called, generate_daypage.py
Copy the contents of the python code into generate_daypage.py
Type this exact command to run the python code
python generate_daypage.py 2012 tex-days.tex
The script will create a file called tex-days.tex, place this file in the same directory as your latex calendar code
Compile the latex calendar again
If you do not have any images to use right now, the line in the latex code that says:
\usepackage[final]{graphicx}
change it to
\usepackage[demo]{graphicx}
and it will provide a black box.
I have confirmed the entire script works and generates the pdf correctly.
-
That was an extremely well laid out answer, thank you very much. Although, when i open the terminal (im on a mac) and type python, it gives me confirmation that is understood that, i copy the exact python code onto it and it says Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'f' is not defined– DustinAug 31, 2012 at 3:47
-
@Dustin you didn't follow the directions. I didn't say copy the script into the terminal. I said save it in a file called generate_daypage.py, then call python on that file. I promise if you follow those instructions exactly it will work. That error is because when you call the python file, it needs two parameters, which are in the command I gave you above. The year you want and the name of the output file. Follow the instructions EXACTLY and it will work– J MAug 31, 2012 at 13:12
-
I am very sorry, that was my fault. So i went into notepad, pasted that python code, and saved it as generate_daypage.py. it is now saved as a python file. I open up my Python (command line) and type in exactly what you put, and it gives me "File "<stdin>", line 1, syntax error: invalid syntax.– DustinAug 31, 2012 at 14:09
-
p.s. i did switch to doing this on my pc, i wasnt sure how to save .py files on my mac, and my LaTeX file is on my PC too.– DustinAug 31, 2012 at 14:13
-
datatool
to read in a CSV file of dates (+ wording) and usestikz
to display the content. No Python required...\include{tex-days}