|
SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br
|
|
Uma sociedade sera - sempre - avaliado
Pelo jeito que trata seus mais fracos.
Mahatma
|
$\LaTeX$
-
Beautiful (Scientific) Docs.
-
Text: Markup Language.
\documentclass{article}[10pt]
%%%Preamble
...
...
\usepackage{graphicsx}
...
...
\begin{document}
O bem que a violência faz é no máximo passageira.
O mail que ela faz é permanente. Mahatma.
\endocument}
-
Programmable: Turing Complete.
More:
-
Define new command:
\newcommand{\mynewcommand}[3]%%Number of parameters
{
\textbf{#1}:%First argument
\textit{#2}:%Second argument
\textsc{#3}:%Third argument
}
...
\mynewcommand{Bold}{Italic}{Small Caps}
-
Redefining a command - must prexist!
\renewcommand{\mynewcommand}%%You can't change number of parameters
-
Include source files:
\input{Chapter01/main.tex}
\input{Chapter02/main.tex}
...
\input{Chapter8/main.tex}
-
For loop (requires TikZ/PGF packages):
\foreach \n in {01,02,03,04,05,06,07,08}
{
\input{Chapter\n/main.tex}
}
-
Create relative dir
list and fill with 1.tex, 2.tex,....
\foreach \n in {1,2,...,100}
{
\IfFileExist{List\n/main.tex}
{
\input{List\n/main.tex}
}
{}
}
-
Yes, you can use
\input
in preamble
\documentclass{article}[10pt]
%%%Preambles in parentdir
...
\input{../Common.tex}
\input{../TikZ.tex}
\input{../Listings.tex}
...
\input{../MyCommands.tex}
...
\begin{document}
Body of document here...
\endocument}
-
$\LaTeX$ on the web: MathJax.
-
pdflatex : PDF.
More:
-
Not open... Adobe.
-
Ancestor Postscript.
-
Vectorial: Scalable!!!!
-
PDF unrecognized as an image (HTML)...
-
On the web, convert to SVG:
pdf2svg .
-
Command Line Interface, CLI:
Scriptable!!!!
-
Web printing sucks!! Generate PDF using
pdflatex
Howto:
-
Generate latex body.
-
Add preambles: systemic and institucional data.
-
Save to temporary tex-file (
/tmp ):
Unique file name (concurrency).
-
Execute
pdflatex on temporary file:
cd to temporary dir (/tmp ).
-
Send CGI header then content of PDF file:
echo "Content-Type: application/pdf\n\n";
echo $this->Read_File("/tmp/tempfile.pdf");
-
Latex_Item, Latex_Items , CRUDs:$\LaTeX$ Skeletons.
\chead{
\textbf{
\begin{Large}
Universidade Federal de Goi\'as\\
\end{Large}
\begin{large}#Entity_Name\end{large}\\
Campus Samambaia - 74001-970 - Goi\^ania\\
#Entity_WWW - #Entity_Phone - #Entity_Email
}
}
\lfoot{
\small{
\textbf{#Teacher_Name}\\
\textbf{#Entity_Initials, #Unit_Initials, \today}
}
}
%%%! \newcommand{\PlanSection}[2]
%%%! {
%%%! \textbf{#1}
%%%! \nopagebreak
%%%! \begin{addmargin}[2em]{2em}
%%%! #2
%%%! \end{addmargin}
%%%!
%%%! \vspace{0.25cm}
%%%! }
\begin{center}
\LARGE{\textbf{Plano de Ensino}}
\end{center}
\PlanSection{01. Dados de Identificação da Disciplina:}
{
\begin{center}\begin{small}
\begin{tabular}{|l|l|l|l|}
\hline
\textbf{Semestre:} & #Semester_Name &
\textbf{Curso:} & #Course_Name
\\
\hline
\textbf{Turma:} & #Code
&
\textbf{Unidade Acadêmica:} & #Entity_Responsible_Initials
\\
\hline
\textbf{Componente:} & #Name
&
\textbf{Código Componente:} & #Discipline_Code
\\
\hline
\textbf{Carga Horário:} & #Discipline_CHT
&
\textbf{Unidade Solicitante:} & #Entity_Initials
\\
\hline
\textbf{Carga Horária, Teórica/Pratica:}
&
#Discipline_CH_Theoretical/#Discipline_CH_Practical
&
\textbf{Carga Horária, EAD/PCC:}
&
#Discipline_CH_EAD/#Discipline_CH_PCC
\\
\hline
\end{tabular}
\end{small}\end{center}
}
\PlanSection{02. Ementa:}
{
#Discipline_Contents
}
\PlanSection{03. Programa:}
{
#Discipline_Program
}
\PlanSection{04. Cronograma:}
{
#Cronogram
}
\PlanSection{05. Objetivos Gerais:}
{
#Objectives_General
}
\PlanSection{05. Objetivos Específicos:}
{
#Objectives_Specific
}
\PlanSection{07. Metodologia:}
{
#Methodology
}
\PlanSection{08. Avaliações:}
{
#Assessment
}
\PlanSection{09. Bibliografia:}
{
#Discipline_Bibliography
}
\PlanSection{10. Bibliografia Complementar:}
{
#Discipline_Bibliography_Complementary
}
\PlanSection{11. Livros Texto:}
{
#Books_Latex
}
\PlanSection{12. Horários:}
{
#Lessons_Latex
}
\PlanSection{13. Horário de Atendimento do(a)s Professor(a):}
{
#Attendances_Latex
}
\PlanSection{14. Professor(a):}
{
#Teachers_Latex
}
#Signatures_Latex
|
|
Messages:
0 secs.
|