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

PyTikZ3D
Uma sociedade sera - sempre - avaliado
Pelo jeito que trata seus mais fracos.
Mahatma
< 2022 | $\LaTeX$ | Python >
$\LaTeX$
  1. Beautiful (Scientific) Docs.
  2. 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}
  3. Programmable: Turing Complete.
    More:
    1. 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}
    2. Redefining a command - must prexist!
      \renewcommand{\mynewcommand}%%You can't change number of parameters
    3. Include source files:
      \input{Chapter01/main.tex}
      \input{Chapter02/main.tex}
      ...
      \input{Chapter8/main.tex}
    4. For loop (requires TikZ/PGF packages):
      \foreach \n in {01,02,03,04,05,06,07,08}
      {
         \input{Chapter\n/main.tex}
      }
    5. 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}
         }
         {}
      }
    6. 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}
  4. $\LaTeX$ on the web: MathJax.
  5. pdflatex: PDF.
    More:
    1. Not open... Adobe.
    2. Ancestor Postscript.
    3. Vectorial: Scalable!!!!
    4. PDF unrecognized as an image (HTML)...
    5. On the web, convert to SVG: pdf2svg.
    6. Command Line Interface, CLI: Scriptable!!!!
    7. Web printing sucks!! Generate PDF using pdflatex
      Howto:
      1. Generate latex body.
      2. Add preambles: systemic and institucional data.
      3. Save to temporary tex-file (/tmp):
        Unique file name (concurrency).
      4. Execute pdflatex on temporary file:
        cd to temporary dir (/tmp).
      5. Send CGI header then content of PDF file:
        echo "Content-Type: application/pdf\n\n";
        echo $this->Read_File("/tmp/tempfile.pdf");
      6. Latex_Item, Latex_Items, CRUDs:$\LaTeX$ Skeletons.
LaTeX Listing: Plan.tex. PDF   ZIP*  
\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
< 2022 | $\LaTeX$ | Python >
Messages:
0 secs.