Posts

Showing posts with the label Programming

How to download Optica's LaTeX template in Overleaf

Image
Fig. 1. Overleaf's user interface for the Optica journal template. The menu button is at the upper left corner.  Newsletter: Volume 1, Issue 1 (Feb 2023)  Topic: Research Contents: Optica's directions for downloading LaTeX files Overleaf's menu button for downloading source files My rendered LaTeX code using pdflatex in TeXworks I was using the free Overleaf account and one of its deal-breaking restrictions is the one-minute compile time. I can increase the compile time to 4 min if I get the Personal (USD 129), Standard (USD 199), and or Professional (  USD 399) Overleaf plan .  If your project has too many figures and style files, Overleaf would need more time to compile it, which can exceed the 1 minute mark.  One way to go around these restrictions is to compile your LaTeX code in your computer using the journal style files from Overleaf. Optica, for example, states that this manual compilation is possible: Choose the journal-specific "Access on Overleaf" link

How to draw lines and circles in HTML5 Canvas using JavaScript

Image
I like drawing. I can do freehand sketch in 2 minutes. I can also draw perspectives using the principle of projective geometry. That's why, whenever I try to learn a computer language, I always check out first its drawing tools and commands. So far, my expertise in drawing is limited to MS Paint, Open Office Draw, BRL CAD, AutoDesk, LATEX, and MS Excel. Now, I want to add to my repertoire of skills by learning how to draw in HTML5 Canvas. Just for fun, I made a tutorial below on how to draw lines and circles in order to draw a music sheet, because I also love music. The subheadings of the article are from the lyrics of  You Decorated my Life  by Kenny Rogers: 1. All my life was a paper / Once plain, pure and white  Let us first draw a canvas with dimensions 400 px by 300 px, and let us define the border to be black.  We modify the W3C Schools code a bit: <canvas height="300" id="Canvas1" style="border: 1px solid #000000;" width="400&q