SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
Uso de LATEXpara Impressões em Aplicativos
Ole Peter Smith
ole@mat.ufg.br
http://www.ime.ufg.brt/docentes/olepeter
Instituto de Matemática e Estatística,
Universidade Federal de Goiás
Trinidade-GO
17/08/2013
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
LATEX
Um Software Livre dos mais Clássicos...
• Markup Languages
• HTML
• LATEX
• RichText
• ODT
• Doc. Structure
• Preamble
• Body
• Postamble
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
LATEX& Friends
• Kile, TexMaker
• BibTeX
• CTAN: http://www.ctan.org
• latexusersgroup@googlegroups.com
• latex-br@googlegroups.com
• abntex2
• Beamer - Slides
• Corretor gramatica, Vero:
http://www.broffice.org/verortografico
• Corretor ortografica, Cogroo:
http://cogroo.sourceforge.net
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
HTML
• Preamble:
<HTML>
<HEAD>
...
</HEAD>
<BODY>
• Body:
Dia que bosta vale ouro
Os pobres todos nascer~ao sem...
• Postamble:
</BODY>
</HTML>
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
LATEX
• Preamble:
documentype[opt-args]{comp-args}
...
...
begin{document}
• Body:
Se voc^e n~ao faz parte
da soluç~ao
Provavelmente faz do problema...
• Postamble:
end{document}
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
CGI
• CGI Headers:
print "Content-Type: text/htmlnn";
• Printable:
• Produce some LATEX
• Save in /tmp/$doc.$mtime.tex.
• $res=system(”cd /tmp;pdflatex
$doc.$mtime.tex”)
• If successfull ($res>0)
• print "Content-Type: application/pdfnn";
print readfile($doc.$mtime.’’.tex’’);
exit();
Elsewise (non-production):
• Show /tmp/latex.log
• Show ’nicely’: /tmp/$doc.$mtime.tex
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
WOOIDs
Webbased OO Interface on Databases
• SiDS, SiPE, SiVent, SAdE, SAdE2...
• CRUDs:
• Singular: Show, Edit, Add, Copy
• Plural: List, EditList, [AddList, CopyList]
• Print, PrintList
• Search
• $this->LatexDocs: Singular - Plural
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
Latex Setup
$this->SingularLatexDocs=array
(
//Global Options
"Landscape" => FALSE,
"Head" => "Head.tex",
"SkelPath" => "System/Latex",
"TmpPath" => "/tmp",
"Docs" => array
(
array
( //Specific Options
"Name" => "Horários",
"Name_UK" => "Schedule",
"Head" => "Head.Schedule.tex",
"Glue" => "Glue.Schedule.tex",
"Tail" => "Tail.Schedule.tex",
"AltHandler" => "PrintSchedule", //delegate
"Singular" => TRUE,
"Plural" => TRUE,
),
//....
),
);
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
Generate
• function PrintLatex($latex):
• function RunLatex($latexfile):
/usr/bin/pdflatex
-interaction nonstopmode
-output-directory
$1 $1/$2 > $1/latex.log 2>&1
• function Item2Latex($item,$doc)
• function PrintItem($item,$singulardoc)
• Items2Latex($items,$pluraldoc)
{
$latex="";
foreach ($items as $item)
{
$latex.=$this->Item2Latex($item,$pluraldoc)
}
}
• PrintItems($items,$pluraldoc)
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
My HTML ’Handies’
• function H($level,$text)
{
if ($this->LatexMode)
{
return "<H".$level.">".$text."</H".$level.">";
}
else
{
$types=array("Huge","huge","LARGE","Large","large");
return ’’.$types[ $level-1 ]."{".$text."}";
}
}
• Ignore FORMS & INPUTs
• HREFs: usepackage{href}: Linked Documents!
MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER
INTRO HTML/LATEX WEBAPPS & LATEX THE END
Vive como se fosse viver para sempre - Aprende como se
fosse morrer amanhã! Einstein
Life sure is a Mystery to be Lived
Not a Problem to be Solved
Please Always Enjoy!

Contenu connexe

Similaire à Using LaTeX for Web Applications and Printed Documents

Joomla Template Development
Joomla Template DevelopmentJoomla Template Development
Joomla Template DevelopmentLinda Coonen
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website OptimizationGerard Sychay
 
Php My Sql Security 2007
Php My Sql Security 2007Php My Sql Security 2007
Php My Sql Security 2007Aung Khant
 
Introduction to Web Design
Introduction to Web DesignIntroduction to Web Design
Introduction to Web Designwebhostingguy
 
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...Jérôme Françoisse
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceElad Elrom
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP frameworkDinh Pham
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkNguyen Duc Phu
 
Free desktop XDG menu Specification
Free desktop XDG menu SpecificationFree desktop XDG menu Specification
Free desktop XDG menu Specificationrarsa
 
Pragmatic REST aka praxisnahes Schnittstellendesign
Pragmatic REST aka praxisnahes SchnittstellendesignPragmatic REST aka praxisnahes Schnittstellendesign
Pragmatic REST aka praxisnahes SchnittstellendesignOPEN KNOWLEDGE GmbH
 
The Semantic Web An Introduction
The Semantic Web An IntroductionThe Semantic Web An Introduction
The Semantic Web An Introductionshaouy
 
Employing Custom Fonts
Employing Custom FontsEmploying Custom Fonts
Employing Custom FontsPaul Irish
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminEve Lyons-Berg
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminAggregage
 

Similaire à Using LaTeX for Web Applications and Printed Documents (20)

Joomla Template Development
Joomla Template DevelopmentJoomla Template Development
Joomla Template Development
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
 
Php My Sql Security 2007
Php My Sql Security 2007Php My Sql Security 2007
Php My Sql Security 2007
 
Introduction to Web Design
Introduction to Web DesignIntroduction to Web Design
Introduction to Web Design
 
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...
No more Big Data Hacking—Time for a Complete ETL Solution with Oracle Data In...
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 Unconference
 
Structured writing - What's it Good For?
Structured writing - What's it Good For?Structured writing - What's it Good For?
Structured writing - What's it Good For?
 
How to learn to build your own PHP framework
How to learn to build your own PHP frameworkHow to learn to build your own PHP framework
How to learn to build your own PHP framework
 
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.frameworkHanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
Hanoi php day 2008 - 01.pham cong dinh - how.to.build.your.own.framework
 
Free desktop XDG menu Specification
Free desktop XDG menu SpecificationFree desktop XDG menu Specification
Free desktop XDG menu Specification
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
Php
PhpPhp
Php
 
Pragmatic REST aka praxisnahes Schnittstellendesign
Pragmatic REST aka praxisnahes SchnittstellendesignPragmatic REST aka praxisnahes Schnittstellendesign
Pragmatic REST aka praxisnahes Schnittstellendesign
 
The Semantic Web An Introduction
The Semantic Web An IntroductionThe Semantic Web An Introduction
The Semantic Web An Introduction
 
Employing Custom Fonts
Employing Custom FontsEmploying Custom Fonts
Employing Custom Fonts
 
How to Create and Submit an XML SItemap
How to Create and Submit an XML SItemapHow to Create and Submit an XML SItemap
How to Create and Submit an XML SItemap
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
SearchMonkey
SearchMonkeySearchMonkey
SearchMonkey
 

Plus de Ole Peter Smith (16)

Provas Algebra Linear, Gabaritos
Provas Algebra Linear, GabaritosProvas Algebra Linear, Gabaritos
Provas Algebra Linear, Gabaritos
 
Provas Algebra Linear
Provas Algebra LinearProvas Algebra Linear
Provas Algebra Linear
 
Formas quadraticas
Formas quadraticasFormas quadraticas
Formas quadraticas
 
Notas.al
Notas.alNotas.al
Notas.al
 
Compendio.algebra.linear
Compendio.algebra.linearCompendio.algebra.linear
Compendio.algebra.linear
 
Wi.ufpr
Wi.ufprWi.ufpr
Wi.ufpr
 
Tcp50.jatai
Tcp50.jataiTcp50.jatai
Tcp50.jatai
 
Tcp50.jatai.2
Tcp50.jatai.2Tcp50.jatai.2
Tcp50.jatai.2
 
Unesp
UnespUnesp
Unesp
 
Gc.d day
Gc.d dayGc.d day
Gc.d day
 
Ditados
DitadosDitados
Ditados
 
Frel.vv
Frel.vvFrel.vv
Frel.vv
 
Goias
GoiasGoias
Goias
 
Provas.gabaritos.2010
Provas.gabaritos.2010Provas.gabaritos.2010
Provas.gabaritos.2010
 
Provas.2010
Provas.2010Provas.2010
Provas.2010
 
Frel.vv
Frel.vvFrel.vv
Frel.vv
 

Dernier

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Dernier (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Using LaTeX for Web Applications and Printed Documents

  • 1. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END Uso de LATEXpara Impressões em Aplicativos Ole Peter Smith ole@mat.ufg.br http://www.ime.ufg.brt/docentes/olepeter Instituto de Matemática e Estatística, Universidade Federal de Goiás Trinidade-GO 17/08/2013
  • 2. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END LATEX Um Software Livre dos mais Clássicos... • Markup Languages • HTML • LATEX • RichText • ODT • Doc. Structure • Preamble • Body • Postamble
  • 3. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END LATEX& Friends • Kile, TexMaker • BibTeX • CTAN: http://www.ctan.org • latexusersgroup@googlegroups.com • latex-br@googlegroups.com • abntex2 • Beamer - Slides • Corretor gramatica, Vero: http://www.broffice.org/verortografico • Corretor ortografica, Cogroo: http://cogroo.sourceforge.net
  • 4. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END HTML • Preamble: <HTML> <HEAD> ... </HEAD> <BODY> • Body: Dia que bosta vale ouro Os pobres todos nascer~ao sem... • Postamble: </BODY> </HTML>
  • 5. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END LATEX • Preamble: documentype[opt-args]{comp-args} ... ... begin{document} • Body: Se voc^e n~ao faz parte da soluç~ao Provavelmente faz do problema... • Postamble: end{document}
  • 6. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END CGI • CGI Headers: print "Content-Type: text/htmlnn"; • Printable: • Produce some LATEX • Save in /tmp/$doc.$mtime.tex. • $res=system(”cd /tmp;pdflatex $doc.$mtime.tex”) • If successfull ($res>0) • print "Content-Type: application/pdfnn"; print readfile($doc.$mtime.’’.tex’’); exit(); Elsewise (non-production): • Show /tmp/latex.log • Show ’nicely’: /tmp/$doc.$mtime.tex
  • 7. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END WOOIDs Webbased OO Interface on Databases • SiDS, SiPE, SiVent, SAdE, SAdE2... • CRUDs: • Singular: Show, Edit, Add, Copy • Plural: List, EditList, [AddList, CopyList] • Print, PrintList • Search • $this->LatexDocs: Singular - Plural
  • 8. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END Latex Setup $this->SingularLatexDocs=array ( //Global Options "Landscape" => FALSE, "Head" => "Head.tex", "SkelPath" => "System/Latex", "TmpPath" => "/tmp", "Docs" => array ( array ( //Specific Options "Name" => "Horários", "Name_UK" => "Schedule", "Head" => "Head.Schedule.tex", "Glue" => "Glue.Schedule.tex", "Tail" => "Tail.Schedule.tex", "AltHandler" => "PrintSchedule", //delegate "Singular" => TRUE, "Plural" => TRUE, ), //.... ), );
  • 9. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END Generate • function PrintLatex($latex): • function RunLatex($latexfile): /usr/bin/pdflatex -interaction nonstopmode -output-directory $1 $1/$2 > $1/latex.log 2>&1 • function Item2Latex($item,$doc) • function PrintItem($item,$singulardoc) • Items2Latex($items,$pluraldoc) { $latex=""; foreach ($items as $item) { $latex.=$this->Item2Latex($item,$pluraldoc) } } • PrintItems($items,$pluraldoc)
  • 10. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END My HTML ’Handies’ • function H($level,$text) { if ($this->LatexMode) { return "<H".$level.">".$text."</H".$level.">"; } else { $types=array("Huge","huge","LARGE","Large","large"); return ’’.$types[ $level-1 ]."{".$text."}"; } } • Ignore FORMS & INPUTs • HREFs: usepackage{href}: Linked Documents!
  • 11. MADE IN LATEX OLE PETER SMITH, IME, UFG: OLE@MAT.UFG.BR - HTTP://WWW.IME.UFG.BR/DOCENTES/OLEPETER INTRO HTML/LATEX WEBAPPS & LATEX THE END Vive como se fosse viver para sempre - Aprende como se fosse morrer amanhã! Einstein Life sure is a Mystery to be Lived Not a Problem to be Solved Please Always Enjoy!