Eu estou fazendo um Makefile que eu corro regularmente pelo Crontab todos os dias às 0230
crontab -e; 30 2 * * * /bin/thePseudocode
Pseudocódigo semelhante a Python
directories = ["Cardiology", "Rheumatology", "Surgery"]
for directory in directories
files = directory.files(); % not sure if such a parameter exists
files = files.match(.*tex); % trying to get only tex files; not sure if match exists
summaryFile = "";
for texFile in files
summaryFile.add( ...
textFile.match( (?s)\begin{question}.*?\end{question} ) ...
)
% Solution based on this thread
% Problem in writing this Regex in Perl http://unix.stackexchange.com/questions/159307/to-match-only-innermost-environment-by-regex
end
end
save this 'summaryFile' as /Users/Masi/Dropbox/QuestionSummary.tex
onde files
é a lista de todos os arquivos no diretório, e summaryFile
é o arquivo que lista todas as questões em todos os arquivos tex.
Esses arquivos, eu quero finalmente compilar por pdflatex e ler todas as manhãs pelo pdf-reader.
Arquivo de exemplo localizado na pasta Reumatologia
\section{Takayasu arteritis}
\begin{question}
{You get a patient.
What do you notice first in this patient?}
Absence of peripheral pulse.
\end{question}
\begin{question}
{What was the first Takayasu case?}
Young woman in Asia with red vessels in the eye.
So special eye diagnosis done.
Affects eye.
\end{question}
Fever of unknown origin can be used when you do not know what is causing the disease.
% Show cases in MedScape and ask class.
Aneurysms.
\subsection{Treatment}
\begin{question}
{What you should always include in Takayasu treatment?
What are the symptoms?}
Blood pressure.
Aneurysms which will burst without treatment.
So blood pressure decreasing drugs like beta blockers along in combination with other drugs.
\end{question}
\begin{question}
{When is the checkup of the Takayasu arteritis?}
Only once per year.
You could expect every month like normally in this kind of diseases.
But only once per year.
\end{question}
onde a saída deve ser para todos os arquivos na pasta
\section{Rheumatology}
\begin{question}
{You get a patient.
What do you notice first in this patient?}
Absence of peripheral pulse.
\end{question}
\begin{question}
{What was the first Takayasu case?}
Young woman in Asia with red vessels in the eye.
So special eye diagnosis done.
Affects eye.
\end{question}
\begin{question}
{What you should always include in Takayasu treatment?
What are the symptoms?}
Blood pressure.
Aneurysms which will burst without treatment.
So blood pressure decreasing drugs like beta blockers along in combination with other drugs.
\end{question}
\begin{question}
{When is the checkup of the Takayasu arteritis?}
Only once per year.
You could expect every month like normally in this kind of diseases.
But only once per year.
\end{question}
Makefile
all:
pdflatex /Users/Masi/Dropbox/QuestionsSummary.tex /Users/Masi/Dropbox/QuestionsSummary.pdf
pdflatex /Users/Masi/Dropbox/QuestionsSummary.tex /Users/Masi/Dropbox/QuestionsSummary.pdf % to compile a few times to be successful
pdflatex
% I am not sure if I should have some error management, since often the pdflatex crashes
% So pdflatex is not probably the right tool to go
Como você pode pseudocodificar em qualquer ferramenta preferida por você?
Eu gosto de Python, mas não faria tudo por ele.