Svetha Venkatesh on Svetha Venkatesh https://svethav.github.io/ Recent content in Svetha Venkatesh on Svetha Venkatesh Hugo -- gohugo.io en-us &copy; 2017 svetha venkatesh Sun, 15 Oct 2017 00:00:00 +1100 Example Talk https://svethav.github.io/talk/example-talk/ Sun, 01 Jan 2017 00:00:00 +1100 https://svethav.github.io/talk/example-talk/ <p>Embed your slides or video here using <a href="https://sourcethemes.com/academic/post/writing-markdown-latex/" target="_blank">shortcodes</a>. Further details can easily be added using <em>Markdown</em> and $\rm \LaTeX$ math code.</p> Adaptive Experimental Design using Bayesian Optimisation https://svethav.github.io/project/bayesopt/ Tue, 27 Dec 2016 00:00:00 +0000 https://svethav.github.io/project/bayesopt/ <p>This project aims to optimise processes for manufacturing new materials, from short fibres, to alloys, to cosmetics, to food, or, in fact, any material for industry or consumer use. By using machine learning and Bayesian mathematics (a sophisticated form of probability), we have developed an abstract framework and software that achieves a faster, cheaper and more effective approach to optimising products and manufacturing processes.</p> <p>The computational challenge in optimisation of novel processes arises because the mathematical relationship between the control variables and the target is often unknown - it is a classic “Black-Box Function”. Experimental data is expensive to acquire, so achieving an optimal setting with a minimum of experiments is desirable. Our framework - Adaptive Experimental Design uses machine learning to navigate complex problems with many variables. It interprets measurements and suggests settings for the next group of experiments, guiding the experimenter to the goal in fewer steps.</p> <p>We have applied our method successfully to the following case studies.</p> <ul> <li>Short fibre production</li> <li>Alloy manufacturing</li> <li>Alloy heat treatment</li> <li>3D printing</li> </ul> Early Intervention for Autism https://svethav.github.io/project/early-intervention-for-autism/ Wed, 27 Apr 2016 00:00:00 +0000 https://svethav.github.io/project/early-intervention-for-autism/ <p>There is a growing gap between the number of children with autism requiring early intervention and available therapy. In this project we seek to produce the following outcomes: * Flexible frameworks for stimulus presentation and recording, for early intervention in social and cognitive/visual areas, * Open source infrastructures to leverage content and metadata from social media, constructing foundations for reusable content in early intervention, * Assistive Technologies for finding appropriate information from forums and blogs, focusing on autism, * Early warning systems of mental wellbeing, measuring affect in text-based social media (forums, blogs, etc.) and appropriate triggers for social support. * New tools for assistive support for communication and social function.</p> <p>Our partners are: <a href="http://www.autismwest.org.au/" target="_blank">Autism West</a>, <a href="http://www.gateways.com.au/" target="_blank">Gateways</a>, <a href="http://www.barwonhealth.org.au/" target="_blank">Barwon health</a>. We do this project jointly with our colleagues at Curtin University.</p> <p>Our Contributions: We present a portable platform for pervasive delivery of early intervention therapy using multi-touch interfaces and principled ways to deliver stimuli of increasing complexity and adapt to a child&rsquo;s performance. Our implementation weaves Natural Environment Tasks with iPad tasks, facilitating a learning platform that integrates early intervention in the child&rsquo;s daily life. The system&rsquo;s construction of stimulus complexity relative to task is evaluated by therapists, together with field trials for evaluating both the integrity of the instructional design and goal of stimulus presentation and adjustment relative to performance for learning tasks. We show overwhelmingly positive results across all our stakeholders, children, parents and therapists. Our results have implications for other early learning fields that require principled ways to construct lessons across skills and adjust stimuli relative to performance. See <a href="http://tobyplaypad.com/" target="_blank">Toby Playpad</a>. The Technology won the 2011 Curtin University Commercialization award.</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe src="//www.youtube.com/embed/OGmwE67RnTc" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allowfullscreen title="YouTube Video"></iframe> </div> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe src="//www.youtube.com/embed/xubqQ74aPyI" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allowfullscreen title="YouTube Video"></iframe> </div> Health Analytics https://svethav.github.io/project/health-analytics/ Wed, 27 Apr 2016 00:00:00 +0000 https://svethav.github.io/project/health-analytics/ <p>With our partner <a href="http://www.barwonhealth.org.au/" target="_blank">Barwon Health</a> we are embarking on questions that arise in examination of large, disparate and multimodal hospital data sets. Can we impact and inform the formation of dynamic health intervention and improved safety and care through:</p> <ul> <li>Predicting hospital visitation patterns of patients with chronic disease,</li> <li>Detection of sub-populations that have coherent patterns of disease, causal factors, and typical medical responses</li> <li>Identify data driven characteristics of chronic patients to enable personalized care plans</li> <li>Detect indicators that serve as early warning of chronic disease</li> <li>Monitor key factors that deliver value to patients in the areas of care experiences, care coordination and patient safety.</li> </ul> <p>Our work led to the formation of an app that allows hospital administrators and clinicians to see at a glance what’s happening in the hospital, on the ward or to their patients. This was developed over several years of research, using machine learning to mine medical and hospital data to provide hospital cost efficiencies and better predictive patient support.</p> Large Scale Surveillance https://svethav.github.io/project/large-scale-surveillance/ Wed, 27 Apr 2016 00:00:00 +0000 https://svethav.github.io/project/large-scale-surveillance/ <p>We are interested in the problems that arise when we examine hundreds of cameras. This big data problem opens up many new questions: Given limited operator capacity, how can select which camera I should look at? How do I select models and parameters for heterogeneous stream data - example, video feeds in varying environmental conditions? How do I evaluate algorithms in big data - training sets may exceeds 2 weeks of video data, and no realistic ground truth can be obtained from operators. How do we compare algorithms?</p> <p>Our Contributions: Focusing on issues of large scale surveillance we have developed new techniques to model &ldquo;normal&rdquo; data from static video cameras. This allows us to detect real time &ldquo;abnormal events&rdquo; and thus enable operators to focus on the 1% of events in a video feed. Our algorithms drive the start-up iCetana&rsquo;s innovative anomaly detection software. The software uses ideas from Compressed Sensing to enable simultaneous surveillance of many cameras deployed in diverse settings. A local city council has used our algorithms to detect loitering, anti-social behaviour and traffic violations. For more information see <a href="https://icetana.com/" target="_blank">iCetana</a>. The technology was: Winner, The Broadband Innovation Award Tech23,2010; Winner, 2011 WA Innovator of the Year.</p> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe src="//www.youtube.com/embed/kYJvDA4gDKY" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allowfullscreen title="YouTube Video"></iframe> </div> <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"> <iframe src="//www.youtube.com/embed/ZJzIGUfZN1M" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allowfullscreen title="YouTube Video"></iframe> </div> Social Media Analysis https://svethav.github.io/project/social-media-analysis/ Wed, 27 Apr 2016 00:00:00 +0000 https://svethav.github.io/project/social-media-analysis/ <p>We study patterns in social media data; who is talking to who? What are they talking about? What is their sentiment? We discover latent community structures, their topics and trends. We explore not only text in blogs but also connectivity through comments. For personal media management it could be argued that social context contains the set of conceptions most often brought to bear on their contents: Where was this? Who is that? What activity were we all doing there? Who do I want to share this with? This project aims to use signals obtained from unobtrusive data sources available with today&rsquo;s devices, such as location information (e.g. GPS), to extract socially meaningful indices for personal media. Social spheres are locations of significance, such as Home, Work and Recreational Area. Social networks of social ties capture the dynamic web of relationships in which we are embedded. Social rhythms arise as patterns across these former elements and allow even finer resolution categorization of activities that occur within them in space and time. All of this information can then be used, at the very least, to provide new ways to index and interact with our own, or others&rsquo;, media collections. Initial work in this area focused on discovering the social spheres Work, Home and Other from raw, noisy GPS traces of everyday life, and used this information together with the presence of known persons to provide a novel personal media exploration environment called Socio-Graph. The interface aimed to allow simple search and filtering on the concepts most people innately bring to their personal media. We do this project jointly with our colleagues at Curtin University.</p> Getting started with the Academic framework for Hugo https://svethav.github.io/post/getting-started/ Wed, 20 Apr 2016 00:00:00 +1000 https://svethav.github.io/post/getting-started/ <p>The Academic framework enables you to easily create a beautifully simple personal or academic website using the <a href="https://gohugo.io" target="_blank">Hugo</a> static site generator.</p> <p>Key features:</p> <ul> <li>Easily manage your homepage, blog posts, publications, talks, and projects</li> <li>Configurable widgets available for Biography, Publications, Projects, News/Blog, Talks, and Contact</li> <li>Need a different section? Just use the Custom widget!</li> <li>Write in <a href="https://svethav.github.io/post/writing-markdown-latex/" target="_blank">Markdown</a> for easy formatting and code highlighting, with <a href="https://en.wikibooks.org/wiki/LaTeX/Mathematics" target="_blank">LaTeX</a> for mathematical expressions</li> <li>Social/academic network linking, <a href="https://analytics.google.com" target="_blank">Google Analytics</a>, and <a href="https://disqus.com" target="_blank">Disqus</a> comments</li> <li>Responsive and mobile friendly</li> <li>Simple and refreshing one page design</li> <li>Multilingual and easy to customize</li> </ul> <h2>Table of Contents</h2> <nav id="TableOfContents"> <ul> <li> <ul> <li><a href="#installation">Installation</a></li> <li><a href="#getting-started">Getting Started</a> <ul> <li><a href="#core-parameters">Core parameters</a></li> <li><a href="#introduce-yourself">Introduce yourself</a></li> <li><a href="#customize-the-homepage">Customize the homepage</a></li> <li><a href="#add-your-content">Add your content</a></li> <li><a href="#remove-unused-widgets-and-pages">Remove unused widgets and pages</a></li> <li><a href="#themes">Themes</a></li> <li><a href="#customization-updating">Customization &amp; updating</a></li> </ul></li> <li><a href="#advanced-customization">Advanced customization</a> <ul> <li><a href="#navigation-menu">Navigation menu</a></li> <li><a href="#website-icon">Website icon</a></li> <li><a href="#analytics">Analytics</a></li> <li><a href="#third-party-and-local-scripts-js">Third party and local scripts (JS)</a></li> <li><a href="#language-and-translation">Language and translation</a></li> <li><a href="#permalinks">Permalinks</a></li> <li><a href="#advanced-style-customization-css">Advanced style customization (CSS)</a></li> </ul></li> <li><a href="#updating">Updating</a></li> <li><a href="#feedback-contributing">Feedback &amp; Contributing</a></li> <li><a href="#license">License</a></li> </ul></li> </ul> </nav> <h2 id="installation">Installation</h2> <ol> <li><p><a href="https://georgecushen.com/create-your-website-with-hugo/#installing-hugo" target="_blank">Install Hugo</a> and create a new website by typing the following commands in your <em>Terminal</em> or <em>Command Prompt</em> app:</p> <pre><code>hugo new site my_website cd my_website </code></pre></li> <li><p>Install Academic with <a href="https://help.github.com/articles/set-up-git/" target="_blank">git</a>:</p> <pre><code>git clone https://github.com/gcushen/hugo-academic.git themes/academic </code></pre> <p>Or alternatively, <a href="https://github.com/gcushen/hugo-academic/archive/master.zip" target="_blank">download Academic</a> and extract it into a <code>themes/academic</code> folder within your Hugo website.</p></li> <li><p>If you are creating a new website, copy the contents of the <code>exampleSite</code> folder to your website root folder, overwriting existing files if necessary. The <code>exampleSite</code> folder contains an example config file and content to help you get started.</p> <pre><code>cp -av themes/academic/exampleSite/* . </code></pre></li> <li><p>Start the Hugo server from your website root folder:</p> <pre><code>hugo server </code></pre> <p>Now you can go to <a href="http://localhost:1313" target="_blank">localhost:1313</a> and your new Academic powered website should appear.</p></li> <li><p>Customize your website - refer to the <em>Getting Started</em> section below</p></li> <li><p>Build your site by running the <code>hugo</code> command. Then <a href="https://georgecushen.com/create-your-website-with-hugo/" target="_blank">host it for free using Github Pages</a>. Or alternatively, copy the generated <code>public/</code> directory (by FTP, Rsync, etc.) to your production web server (such as your university&rsquo;s hosting service).</p></li> </ol> <h2 id="getting-started">Getting Started</h2> <p>Assuming you created a new website with the example content following the installation steps above, this section explores just a few more steps in order to customize it.</p> <h3 id="core-parameters">Core parameters</h3> <p>The core parameters for the website can be edited in the <code>config.toml</code> configuration file:</p> <ul> <li>Set <code>baseurl</code> to your website URL (we recommend <a href="https://georgecushen.com/create-your-website-with-hugo/" target="_blank">GitHub Pages</a> for free hosting)</li> <li>Set <code>title</code> to your desired website title such as your name</li> <li>The example Disqus commenting variable should be cleared (e.g. <code>disqusShortname = &quot;&quot;</code>) or set to your own <a href="https://disqus.com/" target="_blank">Disqus</a> shortname to enable commenting</li> <li>Edit your details under <code>[params]</code>; these will be displayed mainly in the homepage <em>about</em> and <em>contact</em> widgets (if used). To disable a contact field, simply clear the value to <code>&quot;&quot;</code>.</li> <li>Place a square cropped portrait photo named <code>portrait.jpg</code> into the <code>static/img/</code> folder, overwriting any defaults. Note that you can edit the <code>avatar</code> filepath to point to a different image name or clear the value to disable the avatar feature. Alternatively, set <code>gravatar</code> to <code>true</code> to use the Gravatar/Wordpress avatar associated with your <code>email</code> address.</li> <li>To enable LaTeX math for your site, set <code>math = true</code></li> <li>Social/academic networking links are defined as multiples of <code>[[params.social]]</code>. They can be created or deleted as necessary.</li> </ul> <h3 id="introduce-yourself">Introduce yourself</h3> <p>Edit your biography in the <em>about</em> widget <code>content/home/about.md</code> that you copied across from the <code>themes/academic/exampleSite/</code> folder. The research interests and qualifications are stored as <code>interests</code> and <code>education</code> variables. The academic qualifications are defined as multiples of <code>[[education.courses]]</code> and can be created or deleted as necessary. It&rsquo;s possible to completely hide the interests and education lists by deleting their respective variables.</p> <h3 id="customize-the-homepage">Customize the homepage</h3> <p>Refer to our guide on using <a href="https://svethav.github.io/post/widgets/" target="_blank">widgets</a> to customize your homepage.</p> <h3 id="add-your-content">Add your content</h3> <p>Refer to our guide on <a href="https://svethav.github.io/post/managing-content/" target="_blank">managing content</a> to create your own publications, blog posts, talks, and projects.</p> <h3 id="remove-unused-widgets-and-pages">Remove unused widgets and pages</h3> <p><a href="https://svethav.github.io/post/managing-content/#removing-content" target="_blank">How to remove unused widgets and content pages</a>.</p> <h3 id="themes">Themes</h3> <p>The following color themes are available and can be set by the <code>color_theme</code> option in <code>config.toml</code>:</p> <table> <thead> <tr> <th><code>default</code></th> <th><code>ocean</code></th> </tr> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-default.png" alt="default theme" /></td> <td><img src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-ocean.png" alt="ocean theme" /></td> </tr> </tbody> </table> <table> <thead> <tr> <th><code>forest</code></th> <th><code>coffee</code> + <code>playfair</code> font</th> </tr> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-forest.png" alt="forest theme" /></td> <td><img src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png" alt="coffee theme" /></td> </tr> </tbody> </table> <table> <thead> <tr> <th><code>dark</code></th> </tr> </thead> <tbody> <tr> <td><img src="https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-dark.png" alt="dark theme" /></td> </tr> </tbody> </table> <p>The following font styles are available and can be set by the <code>font</code> option in <code>config.toml</code>:</p> <ul> <li>default (modern)</li> <li>classic (original Academic v1 style)</li> <li>playfair (serif)</li> </ul> <h3 id="customization-updating">Customization &amp; updating</h3> <p>Continue reading below for advanced customization tips and instructions for keeping the framework up-to-date with any improvements that become available.</p> <h2 id="advanced-customization">Advanced customization</h2> <p>It is possible to carry out many customizations without touching any files in <code>themes/academic</code>, making it easier to update the framework in the future.</p> <h3 id="navigation-menu">Navigation menu</h3> <p>The <code>[[menu.main]]</code> entries towards the bottom of <code>config.toml</code> define the navigation links at the top of the website. They can be added or removed as desired.</p> <p>To create a dropdown sub-menu, add <code>identifier = &quot;something&quot;</code> to the parent item and <code>parent = &quot;something&quot;</code> to the child item.</p> <h3 id="website-icon">Website icon</h3> <p>Save your main icon and mobile icon as square PNG images named <code>icon.png</code> and <code>apple-touch-icon.png</code>, respectively. Place them in your root <code>static/img/</code> folder.</p> <h3 id="analytics">Analytics</h3> <p>To enable <a href="http://www.google.com/analytics" target="_blank">Google Analytics</a>, add your tracking code in <code>config.toml</code> similarly to <code>googleAnalytics = &quot;UA-12345678-9&quot;</code>.</p> <h3 id="third-party-and-local-scripts-js">Third party and local scripts (JS)</h3> <p>To add a third party script, create a file named <code>head_custom.html</code> in a <code>layouts/partials/</code> folder at the root of your website (not in the <code>themes</code> folder). Any HTML code added to this file will be included within your website&rsquo;s <code>&lt;head&gt;</code>. Therefore, it&rsquo;s suitable for adding custom metadata or third party scripts specified with the <em>async</em> attribute.</p> <p>Whereas for your own local scripts, you can link your local JS assets (relative to your root <code>static/js</code>) from your <code>config.toml</code> using <code>custom_js = [&quot;custom.js&quot;]</code>.</p> <h3 id="language-and-translation">Language and translation</h3> <p>The interface text (e.g. buttons) is stored in language files which are collected from Academic&rsquo;s <code>themes/academic/i18n/</code> folder, as well as an <code>i18n/</code> folder at the root of your project.</p> <p>To edit the interface text, copy <code>themes/academic/i18n/en.yaml</code> to <code>i18n/en.yaml</code> (relative to the root of your website). Open the new file and make any desired changes to the text appearing after <code>translation:</code>. Note that the language files are formatted in YAML syntax.</p> <p>To translate the interface text to another language, follow the above instructions, but name the new file in the form <code>i18n/X.yaml</code> where <code>X</code> is the appropriate <a href="http://www.w3schools.com/tags/ref_language_codes.asp" target="_blank">ISO/RFC5646 language identifier</a> for the translation. Then follow the brief instructions in the <em>Language</em> section at the bottom of your <code>config.toml</code>. To change the default language used by Academic, set <code>defaultContentLanguage</code> to the desired language identifier in your configuration file.</p> <p>To translate the navigation bar, you can edit the default <code>[[menu.main]]</code> instances in <code>config.toml</code>. However, for a multilingual site, you will need to duplicate all of the <code>[[menu.main]]</code> instances and rename the new instances from <code>[[menu.main]]</code> to <code>[[Languages.X.menu.main]]</code>, where <code>X</code> is the language identifier (e.g. <code>[[Languages.zh.menu.main]]</code> for Simplified Chinese). Thus, the navigation bar can be displayed in multiple languages.</p> <p>To translate a content file in your <code>content/</code> folder into another language, copy the file to <code>filename.X.md</code> where <code>filename</code> is your existing filename and <code>X</code> is the appropriate <a href="http://www.w3schools.com/tags/ref_language_codes.asp" target="_blank">ISO/RFC5646 language identifier</a> for the translation. Then translate the content in the new file to the specified language.</p> <p>For further details on Hugo&rsquo;s internationalization and multilingual features, refer to the <a href="https://gohugo.io/content/multilingual/" target="_blank">associated Hugo documentation</a>.</p> <h3 id="permalinks">Permalinks</h3> <p><em>Permalinks</em>, or <em>permanent links</em>, are URLs to individual pages and posts on your website. They are permanent web addresses which can be used to link to your content. Using Hugo&rsquo;s <em>permalinks</em> option these can be easily customized. For example, the blog post URL can be changed to the form <em>yourURL/2016/05/01/my-post-slug</em> by adding the following near the top of your <code>config.toml</code> (before <code>[params]</code> settings):</p> <pre><code>[permalinks] post = &quot;/:year/:month/:day/:slug&quot; </code></pre> <p>Where <code>:slug</code> defaults to the filename of the post, excluding the file extension. However, slug may be overridden on a per post basis if desired, simply by setting <code>slug = &quot;my-short-post-title&quot;</code> in your post preamble.</p> <p><strong>Example 2:</strong> let&rsquo;s consider changing the URL path of posts from <code>post/</code> to <code>blog/</code>. First, add the following parameters right above the <code>[params]</code> section of your <code>config.toml</code>:</p> <pre><code>[permalinks] post = &quot;/blog/:slug&quot; </code></pre> <p>Then add <code>aliases = [&quot;/blog/&quot;]</code> to your post archive page <code>post/_index.md</code> so that it can be accessed from the <em>/blog/</em> URL.</p> <h3 id="advanced-style-customization-css">Advanced style customization (CSS)</h3> <p>For advanced customization of the style, you can link custom CSS assets (relative to your root <code>static/css</code>) from your <code>config.toml</code> using <code>custom_css = [&quot;custom.css&quot;]</code>.</p> <p>For example, let&rsquo;s override some of Academic&rsquo;s default styles. First, define <code>custom_css = [&quot;override.css&quot;]</code> in <code>config.toml</code>. Then we can create the file <code>static/css/override.css</code>, relative to your website root (i.e. <strong>not</strong> in the <code>themes</code> directory). Add your custom CSS to this file.</p> <h2 id="updating">Updating</h2> <p>Feel free to <em>star</em> the project on <a href="https://github.com/gcushen/hugo-academic/" target="_blank">Github</a> to help keep track of updates and check out the <a href="https://sourcethemes.com/academic/tags/updates" target="_blank">release notes</a> prior to updating your site.</p> <p>Before updating the framework, it is recommended to make a backup of your entire website directory, or at least your <code>themes/academic</code> directory.</p> <p>Before updating for the first time, the remote <em>origin</em> repository should be renamed to <em>upstream</em>:</p> <pre><code>$ cd themes/academic $ git remote rename origin upstream </code></pre> <p>To list available updates:</p> <pre><code>$ cd themes/academic $ git fetch upstream $ git log --pretty=oneline --abbrev-commit --decorate HEAD..upstream/master </code></pre> <p>Then, update by running:</p> <pre><code>$ git pull upstream </code></pre> <p>If you have modified files in <code>themes/academic</code>, git will attempt to auto-merge changes. If conflicts are reported, you will need to manually edit the files with conflicts and add them back (<code>git add &lt;filename&gt;</code>).</p> <p>If there are any issues after updating, you may wish to compare your site with the latest <a href="https://github.com/gcushen/hugo-academic/tree/master/exampleSite" target="_blank">example site</a> to check if any settings changed in <code>config.toml</code> or the <code>+++</code> frontmatter of content files.</p> <h2 id="feedback-contributing">Feedback &amp; Contributing</h2> <p>Please use the <a href="https://github.com/gcushen/hugo-academic/issues" target="_blank">issue tracker</a> to let me know about any bugs or feature requests, or alternatively make a pull request.</p> <p>For general questions about Hugo, there is a <a href="http://discuss.gohugo.io" target="_blank">Hugo discussion forum</a>.</p> <h2 id="license">License</h2> <p>Copyright 2017 <a href="https://georgecushen.com" target="_blank">George Cushen</a>.</p> <p>Released under the <a href="https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md" target="_blank">MIT</a> license.</p> Customizing the homepage with widgets https://svethav.github.io/post/widgets/ Tue, 19 Apr 2016 00:00:00 +1000 https://svethav.github.io/post/widgets/ <p>Homepage widgets display as sections on the homepage. They can be enabled/disabled and configured as desired. Academic has the following widgets available to use:</p> <ul> <li>About/biography</li> <li>Selected publications</li> <li>Recent publications</li> <li>Recent news/blog posts</li> <li>Projects</li> <li>Selected talks</li> <li>Recent talks</li> <li>Contact</li> <li>Tag cloud</li> <li>Hero (introduction)</li> <li>Custom widget (demonstrated with the <em>teaching</em> example)</li> </ul> <p>The example site that you copied to create your site uses all the different types of widget (except talks), so you can generally just delete the widgets you don&rsquo;t need and customize the parameters of the widgets you wish to keep.</p> <p>The parameters for each widget vary. They can be found in the preamble/frontmatter (between the pair of <code>+++</code>) for each widget installed in the <code>content/home/</code> folder.</p> <div class="alert alert-note"> <p>By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting <code>list_format = 2</code> in <code>content/home/publications.md</code>.</p> </div> <h2 id="add-a-widget-to-the-homepage">Add a widget to the homepage</h2> <p>To add a widget manually, copy the relevant widget from <code>themes/academic/exampleSite/content/home/</code> to your <code>content/home/</code> folder.</p> <p>Widget identifiers are set to their respective filenames, so a <code>content/home/about.md</code> widget can be linked from the navigation bar by setting the relevant URL as <code>&quot;#about&quot;</code> in <code>config.toml</code>.</p> <p>This means that if you want to use multiple instances of a widget, each widget will be assigned a unique ID based on the filename that you set. You can then use that ID for linking, like in the above example.</p> <h2 id="using-the-custom-widget">Using the custom widget</h2> <p>You can use the custom widget to create your own home page sections.</p> <p>Simply duplicate (copy/paste) and rename the example <em>teaching</em> file at <code>content/home/teaching.md</code>. Then edit the section title, weight (refer to <em>Ordering sections</em> below), and content as desired.</p> <p>You may also wish to add a navigation link to the top of the page that points to the new section. This can be achieved by adding something similar to the following lines to your <code>config.toml</code>, where the URL will consist of the first title word in lowercase:</p> <pre><code>[[menu.main]] name = &quot;Research&quot; url = &quot;#research&quot; weight = 10 </code></pre> <h2 id="remove-a-widget-from-the-homepage">Remove a widget from the homepage</h2> <p>If you do not require a particular widget, you can simply delete any associated files from the <code>content/home/</code> folder.</p> <p>To remove a navigation link from the top of the page, remove the associated <code>[[menu.main]]</code> entry in <code>config.toml</code>.</p> <h2 id="ordering-widgets">Ordering widgets</h2> <p>The order that the homepage widgets are displayed in is defined by the <code>weight</code> parameter in each of the files in the <code>content/home/</code> directory. The widgets are displayed in ascending order of their <code>weight</code>, so you can simply edit the <code>weight</code> parameters as desired.</p> Managing content https://svethav.github.io/post/managing-content/ Mon, 18 Apr 2016 00:00:00 +1000 https://svethav.github.io/post/managing-content/ <p>This is a brief guide to managing content with the Academic framework. Content can include publications, projects, talks, news/blog articles, and widget pages. After you have read this guide about creating and managing content, you may also be interested to learn about <a href="https://svethav.github.io/post/writing-markdown-latex/" target="_blank">writing content with Markdown, LaTeX, and Shortcodes</a>.</p> <p>To enable LaTeX math rendering for a page, you should include <code>math = true</code> in the page&rsquo;s <code>+++</code> preamble, as demonstrated in the included example site. Otherwise, to enable math on the homepage or for all pages, you must globally set <code>math = true</code> in <code>config.toml</code>.</p> <p>To disable source code highlighting by default for all pages, set <code>highlight = false</code> in <code>config.toml</code>. You can then enable source code highlighting only on pages that need it by setting <code>highlight = true</code> in that page&rsquo;s preamble. See the <a href="https://svethav.github.io/post/writing-markdown-latex/#code-highlighting" target="_blank">code-highlighting docs</a> for more details.</p> <p>To display a featured image in content page headers, the parameters below can be inserted towards the end of a page&rsquo;s <code>+++</code> preamble. It is assumed that the image is located in your <code>static/img/</code> folder, so the full path in the example below will be <code>static/img/headers/getting-started.png</code>. The <code>caption</code> parameter can be used to write an image caption or credit.</p> <pre><code class="language-toml">[header] image = &quot;headers/getting-started.png&quot; caption = &quot;Image credit: [**Academic**](https://github.com/gcushen/hugo-academic/)&quot; </code></pre> <div class="alert alert-note"> <p>If you wish to prevent a featured image automatically being used for a post&rsquo;s thumbnail on the homepage, the <code>preview = false</code> parameter can be added to <code>[header]</code>.</p> </div> <h2>Table of Contents</h2> <nav id="TableOfContents"> <ul> <li> <ul> <li><a href="#create-a-publication">Create a publication</a></li> <li><a href="#create-a-blog-post">Create a blog post</a></li> <li><a href="#create-a-project">Create a project</a></li> <li><a href="#create-a-talk">Create a talk</a></li> <li><a href="#create-a-widget-page">Create a widget page</a></li> <li><a href="#create-other-pages-e-g-cv">Create other pages (e.g. CV)</a></li> <li><a href="#manage-archive-pages">Manage archive pages</a></li> <li><a href="#removing-content">Removing content</a></li> <li><a href="#view-your-updated-site">View your updated site</a></li> <li><a href="#deploy-your-site">Deploy your site</a></li> </ul></li> </ul> </nav> <h2 id="create-a-publication">Create a publication</h2> <p>To create a new publication:</p> <pre><code>hugo new publication/my-paper-name.md </code></pre> <p>Then edit the default variables at the top of <code>content/publication/my-paper-name.md</code> to include the details of your publication. The <code>url_</code> variables are used to generate links associated with your publication, such as for viewing PDFs of papers. Here is an example:</p> <pre><code>+++ title = &quot;A publication title, such as title of a paper&quot; # Date first published. date = &quot;2013-07-01&quot; # Authors. Comma separated list, e.g. `[&quot;Bob Smith&quot;, &quot;David Jones&quot;]`. authors = [&quot;First author's name&quot;, &quot;Second author's name&quot;] # Publication type. # Legend: # 0 = Uncategorized # 1 = Conference proceedings # 2 = Journal # 3 = Work in progress # 4 = Technical report # 5 = Book # 6 = Book chapter publication_types = [&quot;1&quot;] # Publication name and optional abbreviated version. publication = &quot;In *International Conference on Academic*. You may use *Markdown* for italics etc.&quot; publication_short = &quot;In *ICA*&quot; # Abstract and optional shortened version. abstract = &quot;The abstract. Markdown and math can be used (note that math may require escaping as detailed in the red alert box below).&quot; abstract_short = &quot;A short version of the abstract.&quot; # Featured image thumbnail (optional) image_preview = &quot;&quot; # Is this a selected publication? (true/false) selected = true # Projects (optional). # Associate this publication with one or more of your projects. # Simply enter the filename (excluding '.md') of your project file in `content/project/`. # E.g. `projects = [&quot;deep-learning&quot;]` references `content/project/deep-learning.md`. projects = [] # Links (optional). url_pdf = &quot;pdf/my-paper-name.pdf&quot; url_preprint = &quot;&quot; url_code = &quot;&quot; url_dataset = &quot;&quot; url_project = &quot;&quot; url_slides = &quot;&quot; url_video = &quot;&quot; url_poster = &quot;&quot; url_source = &quot;&quot; # Custom links (optional). # Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`. # url_custom = [{name = &quot;Custom Link&quot;, url = &quot;http://example.org&quot;}] # Does the content use math formatting? math = true # Does the content use source code highlighting? highlight = true # Featured image # Place your image in the `static/img/` folder and reference its filename below, e.g. `image = &quot;example.jpg&quot;`. [header] image = &quot;headers/bubbles-wide.jpg&quot; caption = &quot;My caption 😄&quot; +++ Further details on your publication can be written here using *Markdown* for formatting. This text will be displayed on the Publication Detail page. </code></pre> <p>The <code>url_</code> links can either point to local or web content. Associated local publication content, such as PDFs, may be copied to a <code>static/pdf/</code> folder and referenced like <code>url_pdf = &quot;pdf/my-paper-name.pdf&quot;</code>.</p> <p>You can also associate custom link buttons with the publication by adding the following block within the variable preamble above, which is denoted by <code>+++</code>:</p> <pre><code>url_custom = [{name = &quot;Custom Link 1&quot;, url = &quot;http://example.org&quot;}, {name = &quot;Custom Link 2&quot;, url = &quot;http://example.org&quot;}] </code></pre> <p>If you set <code>list_format=2</code> to enable a detailed listing of publications in the Publication Widget (<code>home/publications.md</code>) or Publication Archive (<code>publication/_index.md</code>), then there are a few more optional variables that you can include in the publication page preamble. You may use <code>abstract_short = &quot;friendly summary of abstract&quot;</code> and <code>publication_short = &quot;abbreviated publication details&quot;</code> to display a friendly summary of the abstract and abbreviate the publication details, respectively. Furthermore, there is the option to display a different image on the homepage to the publication detail page by setting <code>image_preview = &quot;my-image.jpg&quot;</code>. This can be useful if you wish to scale down the image for the homepage or simply if you just wish to show a different image for the preview.</p> <div class="alert alert-warning"> <p>Any double quotes (<code>&quot;</code>) or backslashes (e.g. LaTeX <code>\times</code>) occurring within the value of any frontmatter parameter (such as the <em>abstract</em>) should be escaped with a backslash (<code>\</code>). For example, the symbol <code>&quot;</code> and LaTeX text <code>\times</code> become <code>\&quot;</code> and <code>\\times</code>, respectively. Refer to the <a href="https://github.com/toml-lang/toml#user-content-string" target="_blank">TOML documentation</a> for more info.</p> </div> <h2 id="create-a-blog-post">Create a blog post</h2> <p>To create a blog/news article:</p> <pre><code>hugo new post/my-article-name.md </code></pre> <p>Then edit the newly created file <code>content/post/my-article-name.md</code> with your full title and content.</p> <p>Hugo will automatically generate summaries of posts that appear on the homepage. If you are dissatisfied with an automated summary, you can either limit the summary length by appropriately placing <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> in the article body, or completely override the automated summary by adding a <code>summary</code> parameter to the <code>+++</code> preamble such that:</p> <pre><code>summary = &quot;Summary of my post.&quot; </code></pre> <p>To disable commenting for a specific post, you can add <code>disable_comments = true</code> to the post <code>+++</code> preamble. Or to disable commenting for all posts, you can either set <code>disqusShortname = &quot;&quot;</code> or <code>disable_comments = true</code> in <code>config.toml</code>.</p> <h2 id="create-a-project">Create a project</h2> <p>To create a project:</p> <pre><code>hugo new project/my-project-name.md </code></pre> <p>Then edit the newly created file <code>content/project/my-project-name.md</code>. Either you can link the project to an external project website by setting the <code>external_link = &quot;http://external-project.com&quot;</code> variable at the top of the file, or you can add content (below the final <code>+++</code>) in order to render a project page on your website.</p> <h2 id="create-a-talk">Create a talk</h2> <p>To create a talk:</p> <pre><code>hugo new talk/my-talk-name.md </code></pre> <p>Then edit the newly created file <code>content/talk/my-talk-name.md</code> with your full talk title and details. Note that many of the talk parameters are similar to the publication parameters.</p> <h2 id="create-a-widget-page">Create a widget page</h2> <p>So you would like to create a page which utilizes Academic&rsquo;s widget system, similar to the homepage?</p> <p>Create a new folder in your <code>content</code> folder, naming it with your new page name. In this example, we will create a <em>courses</em> page by creating a <code>content/courses/</code> folder.</p> <p>Within your new <code>content/courses/</code> folder, create a file named <code>_index.md</code> containing the following parameters:</p> <pre><code>+++ title = &quot;Courses&quot; date = 2017-01-01 widgets = true +++ </code></pre> <p>Install widgets into your <code>content/courses/</code> folder. To achieve this, widgets can be copied from your <code>content/home/</code> folder or downloaded from <a href="https://github.com/gcushen/hugo-academic/tree/master/exampleSite/content/home" target="_blank">Github</a>.</p> <h2 id="create-other-pages-e-g-cv">Create other pages (e.g. CV)</h2> <p>For other types of content, it is possible to create your own custom pages. For example, let&rsquo;s create a <code>cv.md</code> page for your Curriculum Vitae in your <code>content</code> folder. Copy across the frontmatter from the top of one of your post files, adapting it as necessary, and editing your Markdown content below. You can then link to your new page by adding the code <code>[My CV]{{&lt; ref &quot;cv.md&quot; &gt;}}</code> to any of your existing content.</p> <p>Alternatively, for the above example, we could use a PDF of your Curriculum Vitae. For this purpose, create a folder called <code>files</code> within your <code>static</code> folder and move a PDF file named <code>cv.pdf</code> to that location, so we have a <code>static/files/cv.pdf</code> file path. The PDF can then be linked to from any content by using the code: <code>{{% staticref &quot;files/cv.pdf&quot; %}}Download my CV{{% /staticref %}}</code>.</p> <h2 id="manage-archive-pages">Manage archive pages</h2> <p>The archive (or <em>node index</em>) pages (e.g. <code>/post/</code>) are the special pages which list all of your content. They can exist for blog posts, publications, and talks. The homepage widgets will automatically link to the archive pages when you have more items of content than can be displayed in the widget. Therefore, if you don&rsquo;t have much content, you may not see the automatic links yet - but you can also manually link to them using a normal Markdown formatted link in your content.</p> <p>You can edit the title and add your own content, such as an introduction, by copying the following content <code>_index.md</code> files from the example site to the same structure within your <code>content/</code> folder:</p> <pre><code>/themes/academic/exampleSite/content/post/_index.md /themes/academic/exampleSite/content/publication/_index.md /themes/academic/exampleSite/content/talk/_index.md </code></pre> <p>Then edit the <code>title</code> parameter in each <code>_index.md</code> as desired and add any content after the <code>+++</code> preamble/frontmatter ends. You will notice that the <code>_index.md</code> files differ slightly, with some having special options available for the associated content type. For example, <code>publication/_index.md</code> contains an option for setting the citation style of the listings which appear on the publication archive page.</p> <h2 id="removing-content">Removing content</h2> <p>Generally, to remove content, simply delete the relevant file from your <code>content/post</code>, <code>content/publication</code>, <code>content/project</code>, or <code>content/talk</code> folder.</p> <h2 id="view-your-updated-site">View your updated site</h2> <p>After you have made changes to your site, you can view it by running the <code>hugo server</code> command and then opening <a href="http://localhost:1313" target="_blank">localhost:1313</a> in your web browser.</p> <h2 id="deploy-your-site">Deploy your site</h2> <p>Finally, you can build the static website to a <code>public/</code> folder ready for deployment using the <code>hugo</code> command.</p> <p>You may then deploy your site by copying the <code>public/</code> directory (by FTP, SFTP, WebDAV, Rsync, git push, etc.) to your production web server.</p> <p>Note that running <code>hugo</code> does not remove any previously generated files before building. Therefore, it&rsquo;s best practice to delete your <code>public/</code> directory prior to running <code>hugo</code> to ensure no old or interim files are deployed to your server.</p> Writing content with Markdown, LaTeX, and Shortcodes https://svethav.github.io/post/writing-markdown-latex/ Sun, 17 Apr 2016 00:00:00 +1000 https://svethav.github.io/post/writing-markdown-latex/ <p>Content can be written using <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">Markdown</a>, <a href="https://en.wikibooks.org/wiki/LaTeX/Mathematics" target="_blank">LaTeX math</a>, and <a href="http://gohugo.io/extras/shortcodes/" target="_blank">Hugo Shortcodes</a>. Additionally, HTML may be used for advanced formatting. This article gives an overview of the most common formatting options.</p> <h2>Table of Contents</h2> <nav id="TableOfContents"> <ul> <li> <ul> <li><a href="#sub-headings">Sub-headings</a></li> <li><a href="#emphasis">Emphasis</a></li> <li><a href="#ordered-lists">Ordered lists</a></li> <li><a href="#unordered-lists">Unordered lists</a></li> <li><a href="#images">Images</a></li> <li><a href="#links">Links</a></li> <li><a href="#emojis">Emojis</a></li> <li><a href="#blockquote">Blockquote</a></li> <li><a href="#footnotes">Footnotes</a></li> <li><a href="#code-highlighting">Code highlighting</a> <ul> <li><a href="#highlighting-options">Highlighting options</a> <ul> <li><a href="#option-highlight">Option <code>highlight</code></a></li> <li><a href="#option-highlight-languages">Option <code>highlight_languages</code></a></li> <li><a href="#option-highlight-style">Option <code>highlight_style</code></a></li> </ul></li> </ul></li> <li><a href="#twitter-tweet">Twitter tweet</a></li> <li><a href="#youtube">Youtube</a></li> <li><a href="#vimeo">Vimeo</a></li> <li><a href="#github-gist">GitHub gist</a></li> <li><a href="#speaker-deck">Speaker Deck</a></li> <li><a href="#rm-latex-math">$\rm \LaTeX$ math</a> <ul> <li><a href="#multiline-equations">Multiline equations</a></li> <li><a href="#publication-abstracts">Publication abstracts</a></li> </ul></li> <li><a href="#table">Table</a></li> <li><a href="#alerts">Alerts</a></li> <li><a href="#table-of-contents">Table of Contents</a></li> </ul></li> </ul> </nav> <h2 id="sub-headings">Sub-headings</h2> <pre><code>## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 </code></pre> <h2 id="emphasis">Emphasis</h2> <pre><code>Italics with *asterisks* or _underscores_. Bold with **asterisks** or __underscores__. Combined emphasis with **asterisks and _underscores_**. Strikethrough with ~~two tildes~~. </code></pre> <h2 id="ordered-lists">Ordered lists</h2> <pre><code>1. First item 2. Another item </code></pre> <h2 id="unordered-lists">Unordered lists</h2> <pre><code>* First item * Another item </code></pre> <h2 id="images">Images</h2> <p>Images may be added to a page by placing them in your <code>static/img/</code> folder and referencing them using one of the following two notations:</p> <p>A general image:</p> <pre><code>![alternative text for search engines](/img/screenshot.png) </code></pre> <p>A numbered figure with caption:</p> <pre><code>{{&lt; figure src=&quot;/img/screenshot.png&quot; title=&quot;Figure Caption&quot; &gt;}} </code></pre> <h2 id="links">Links</h2> <pre><code>[I'm a link](https://www.google.com) [A post]({{&lt; ref &quot;post/hi.md&quot; &gt;}}) [A publication]({{&lt; ref &quot;publication/hi.md&quot; &gt;}}) [A project]({{&lt; ref &quot;project/hi.md&quot; &gt;}}) [Another section]({{&lt; relref &quot;hi.md#who&quot; &gt;}}) </code></pre> <p>To enable linking to a file, such as a PDF, first place the file in your <code>static/files/</code> folder and then link to it using the following form:</p> <pre><code>{{% staticref &quot;files/cv.pdf&quot; &quot;newtab&quot; %}}Download my CV{{% /staticref %}} </code></pre> <p>The optional <code>&quot;newtab&quot;</code> argument for <code>staticref</code> will cause the link to be opened in a new tab.</p> <h2 id="emojis">Emojis</h2> <p>See the <a href="http://www.webpagefx.com/tools/emoji-cheat-sheet/" target="_blank">Emoji cheat sheet</a> for available emoticons. The following serves as an example, but you should remove the spaces between each emoji name and pair of semicolons:</p> <pre><code>I : heart : Academic : smile : </code></pre> <p>I ❤️ Academic 😄</p> <h2 id="blockquote">Blockquote</h2> <pre><code>&gt; This is a blockquote. </code></pre> <blockquote> <p>This is a blockquote.</p> </blockquote> <h2 id="footnotes">Footnotes</h2> <pre><code>I have more [^1] to say. [^1]: Footnote example. </code></pre> <p>I have more <sup class="footnote-ref" id="fnref:1"><a href="#fn:1">1</a></sup> to say.</p> <h2 id="code-highlighting">Code highlighting</h2> <p>Pass the <em>language</em> of the code, such as <code>python</code>, as a parameter after three backticks:</p> <pre><code>```python # Example of code highlighting input_string_var = input(&quot;Enter some data: &quot;) print(&quot;You entered: {}&quot;.format(input_string_var)) ``` </code></pre> <p>Result:</p> <pre><code class="language-python"># Example of code highlighting input_string_var = input(&quot;Enter some data: &quot;) print(&quot;You entered: {}&quot;.format(input_string_var)) </code></pre> <h3 id="highlighting-options">Highlighting options</h3> <p>The Academic theme uses <a href="https://highlightjs.org" target="_blank">highlight.js</a> for source code highlighting, and highlighting is enabled by default for all pages. However, several configuration options are supported that allow finer-grained control over highlight.js.</p> <p>The following table lists the supported options for configuring highlight.js, along with their expected type and a short description. A &ldquo;yes&rdquo; in the <strong>config.toml</strong> column means the value can be set globally in <code>config.toml</code>, and a &ldquo;yes&rdquo; in the <strong>preamble</strong> column means that the value can be set locally in a particular page&rsquo;s preamble.</p> <table> <thead> <tr> <th>option</th> <th>type</th> <th>description</th> <th>config.toml</th> <th>preamble</th> </tr> </thead> <tbody> <tr> <td><code>highlight</code></td> <td>boolean</td> <td>enable/disable highlighting</td> <td>yes</td> <td>yes</td> </tr> <tr> <td><code>highlight_languages</code></td> <td>slice</td> <td>choose additional languages</td> <td>yes</td> <td>yes</td> </tr> <tr> <td><code>highlight_style</code></td> <td>string</td> <td>choose a highlighting style</td> <td>yes</td> <td>no</td> </tr> </tbody> </table> <h4 id="option-highlight">Option <code>highlight</code></h4> <p>The <code>highlight</code> option allows enabling or disabling the inclusion of highlight.js, either globally or for a particular page. If the option is unset, it has the same effect as if you had specified <code>highlight = true</code>. That is, the highlight.js javascript and css files will be included in every page. If you&rsquo;d like to only include highlight.js files on pages that actually require source code highlighting, you can set <code>highlight = false</code> in <code>config.toml</code>, and then override it by setting <code>highlight = true</code> in the preamble of any pages that require source code highlighting. Conversely, you could enable highlighting globally, and disable it locally for pages that do not require it. Here is a table that shows whether highlighting will be enabled for a page, based on the values of <code>highlight</code> set in <code>config.toml</code> and/or the page&rsquo;s preamble.</p> <table> <thead> <tr> <th>config.toml</th> <th>page preamble</th> <th>highlighting enabled for page?</th> </tr> </thead> <tbody> <tr> <td>unset or true</td> <td>unset or true</td> <td>yes</td> </tr> <tr> <td>unset or true</td> <td>false</td> <td>no</td> </tr> <tr> <td>false</td> <td>unset or false</td> <td>no</td> </tr> <tr> <td>false</td> <td>true</td> <td>yes</td> </tr> </tbody> </table> <h4 id="option-highlight-languages">Option <code>highlight_languages</code></h4> <p>The <code>highlight_languages</code> option allows you to specify additional languages that are supported by highlight.js, but are not considered &ldquo;common&rdquo; and therefore are not supported by default. For example, if you want source code highlighting for Go and clojure in all pages, set <code>highlight_languages = [&quot;go&quot;, &quot;clojure&quot;]</code> in <code>config.toml</code>. If, on the other hand, you want to enable a language only for a specific page, you can set <code>highlight_languages</code> in that page&rsquo;s preamble.</p> <p>The <code>highlight_languages</code> options specified in <code>config.toml</code> and in a page&rsquo;s preamble are additive. That is, if <code>config.toml</code> contains, <code>highlight_languages = [&quot;go&quot;]</code> and the page&rsquo;s preamble contains <code>highlight_languages = [&quot;ocaml&quot;]</code>, then javascript files for <em>both</em> go and ocaml will be included for that page.</p> <p>If the <code>highlight_languages</code> option is set, then the corresponding javascript files will be served from the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs server</a>. To see a list of available languages, visit the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs page</a> and search for links with the word &ldquo;languages&rdquo;.</p> <p>The <code>highlight_languages</code> option provides an easy and convenient way to include support for additional languages to be severed from a CDN. If serving unmodified files from cdnjs doesn&rsquo;t meet your needs, you can include javascript files for additional language support via one of the methods described in the <a href="https://svethav.github.io/post/getting-started/#third-party-and-local-scripts-js" target="_blank">getting started guide</a>.</p> <h4 id="option-highlight-style">Option <code>highlight_style</code></h4> <p>The <code>highlight_style</code> option allows you to select an alternate css style for highlighted code. For example, if you wanted to use the solarized-dark style, you could set <code>highlight_style = &quot;solarized-dark&quot;</code> in <code>config.toml</code>.</p> <p>If the <code>highlight_style</code> option is unset, the default is to use the file <code>/css/highlight.min.css</code>, either the one provided by the Academic theme, or else the one in your local <code>static</code> directory. The <code>/css/highlight.min.css</code> file provided by Academic is equivalent to the <code>github</code> style from highlight.js.</p> <p>If the <code>highlight_style</code> option <em>is</em> set, then <code>/css/highlight.min.css</code> is ignored, and the corresponding css file will be served from the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs server</a>. To see a list of available styles, visit the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs page</a> and search for links with the word &ldquo;styles&rdquo;.</p> <p>See the <a href="https://highlightjs.org/static/demo/" target="_blank">highlight.js demo page</a> for examples of available styles.</p> <div class="alert alert-note"> <p>Not all styles listed on the <a href="https://highlightjs.org/static/demo/" target="_blank">highlight.js demo page</a> are available from the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs server</a>. If you want to use a style that is not served by cdnjs, just leave <code>highlight_style</code> unset, and place the corresponding css file in <code>/static/css/highlight.min.css</code>.</p> </div> <div class="alert alert-note"> <p>If you don&rsquo;t want to change the default style that ships with Academic but you do want the style file served from the <a href="https://cdnjs.com/libraries/highlight.js/" target="_blank">cdnjs server</a>, set <code>highlight_style = &quot;github&quot;</code> in <code>config.toml</code>.</p> </div> <p>The <code>highlight_style</code> option is only recognized when set in <code>config.toml</code>. Setting <code>highlight_style</code> in your page&rsquo;s preamble has no effect.</p> <h2 id="twitter-tweet">Twitter tweet</h2> <p>To include a single tweet, pass the tweet’s ID from the tweet&rsquo;s URL as parameter to the shortcode:</p> <pre><code>{{&lt; tweet 666616452582129664 &gt;}} </code></pre> <h2 id="youtube">Youtube</h2> <pre><code>{{&lt; youtube w7Ft2ymGmfc &gt;}} </code></pre> <h2 id="vimeo">Vimeo</h2> <pre><code>{{&lt; vimeo 146022717 &gt;}} </code></pre> <h2 id="github-gist">GitHub gist</h2> <pre><code>{{&lt; gist USERNAME GIST-ID &gt;}} </code></pre> <h2 id="speaker-deck">Speaker Deck</h2> <pre><code>{{&lt; speakerdeck 4e8126e72d853c0060001f97 &gt;}} </code></pre> <h2 id="rm-latex-math">$\rm \LaTeX$ math</h2> <pre><code class="language-TeX">$$\left [ – \frac{\hbar^2}{2 m} \frac{\partial^2}{\partial x^2} + V \right ] \Psi = i \hbar \frac{\partial}{\partial t} \Psi$$ </code></pre> <p>$$\left [ – \frac{\hbar^2}{2 m} \frac{\partial^2}{\partial x^2} + V \right ] \Psi = i \hbar \frac{\partial}{\partial t} \Psi$$</p> <p>Alternatively, inline math can be written by wrapping the formula with only a single <code>$</code>:</p> <pre><code>This is inline: $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ </code></pre> <p>This is inline: $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$</p> <p>Note that Markdown special characters need to be escaped with a backslash so they are treated as math rather than Markdown. For example, <code>*</code> and <code>_</code> become <code>\*</code> and <code>\_</code> respectively.</p> <h3 id="multiline-equations">Multiline equations</h3> <p>The standard LaTeX line break consisting of 2 backslashes needs to be replaced with 6 backslashes:</p> <pre><code class="language-TeX">$$f(k;p\_0^\*) = \begin{cases} p\_0^\* &amp; \text{if }k=1, \\\\\\ 1-p\_0^\* &amp; \text {if }k=0.\end{cases}$$ </code></pre> <p>$$f(k;p_0^*) = \begin{cases} p_0^* &amp; \text{if }k=1, \\<br /> 1-p_0^* &amp; \text {if }k=0.\end{cases}$$</p> <h3 id="publication-abstracts">Publication abstracts</h3> <p>As Hugo and Academic attempt to parse TOML, Markdown, and LaTeX content in the abstract, the following guidelines should be followed just for the publication <code>abstract</code> and <code>abstract_short</code> fields:</p> <ul> <li>escape each LaTeX backslash (<code>\</code>) with an extra backslash, yielding <code>\\</code></li> <li>escape each LaTeX underscore (<code>_</code>) with two backslashes, yielding <code>\\_</code></li> </ul> <p>Hence, <code>abstract = &quot;${O(d_{\max})}$&quot;</code> becomes <code>abstract = &quot;${O(d\\_{\\max})}$&quot;</code>.</p> <h2 id="table">Table</h2> <p>Code:</p> <pre><code class="language-Markdown">| Command | Description | | ------------------| ------------------------------ | | `hugo` | Build your website. | | `hugo serve -w` | View your website. | </code></pre> <p>Result:</p> <table> <thead> <tr> <th>Command</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>hugo</code></td> <td>Build your website.</td> </tr> <tr> <td><code>hugo serve -w</code></td> <td>View your website.</td> </tr> </tbody> </table> <h2 id="alerts">Alerts</h2> <p>Alerts are a useful feature that add side content such as tips, notes, or warnings to your articles. They are especially handy when writing educational tutorial-style articles. Use the corresponding shortcodes to enable alerts inside your content:</p> <pre><code>{{% alert note %}} Here's a tip or note... {{% /alert %}} </code></pre> <p>This will display the following <em>note</em> block:</p> <div class="alert alert-note"> <p>Here&rsquo;s a tip or note&hellip;</p> </div> <pre><code>{{% alert warning %}} Here's some important information... {{% /alert %}} </code></pre> <p>This will display the following <em>warning</em> block:</p> <div class="alert alert-warning"> <p>Here&rsquo;s some important information&hellip;</p> </div> <h2 id="table-of-contents">Table of Contents</h2> <p>A table of contents may be particularly useful for long posts or tutorial/documentation type content. Use the <code>{{% toc %}}</code> shortcode anywhere you wish within your Markdown content to automatically generate a table of contents.</p> <div class="footnotes"> <hr /> <ol> <li id="fn:1">Footnote example. <a class="footnote-return" href="#fnref:1"><sup>^</sup></a></li> </ol> </div> Frequently Asked Questions (FAQ) https://svethav.github.io/post/faq/ Sun, 10 Apr 2016 00:00:00 +1000 https://svethav.github.io/post/faq/ <p>Common questions and answers will be listed here.</p> <p><strong>I cloned/downloaded Academic but Hugo produces errors when using it with my existing Hugo site</strong></p> <p>Academic is a website <em>framework</em> rather than just a <em>theme</em>. Therefore, you must follow the full installation guide found on the Demo/Documentation website or in the Github Readme. If you still have problems, first try running Hugo on the Academic Example Site found in the <code>themes/academic/exampleSite</code> folder and then compare the configuration parameters in the Example Site&rsquo;s <code>config.toml</code> and content files with the files in your existing site.</p> <p><strong>Hosting your site with Netlify or Cloudflare and experience strange behavior such as filters not working?</strong></p> <p>Disable post-processing steps such as <em>minification</em> in your Netlify/Cloudflare admin panel.</p> <p><strong>Publications and other content are not sorted by newest first</strong></p> <p>Hugo/TOML require that the value for the <code>date</code> field should be in <a href="https://github.com/toml-lang/toml#local-date-time" target="_blank">TOML format</a>, as per frontmatter of the <code>content/publication/</code> files in the example site. If you want to use a partial date, such as year, you should still complete a full date to make a valid TOML date format.</p> <p><strong>Issue parsing LaTeX in publication abstract</strong></p> <p>Let&rsquo;s consider the following LaTeX which fails to parse correctly:</p> <pre><code>abstract = &quot;${O(d_{\max})}$&quot; </code></pre> <p>This is a side effect of Academic and Hugo attempting to parse TOML, Markdown and LaTeX content in the abstract. The solution is to:</p> <ul> <li>escape each LaTeX backslash (<code>\</code>) with an extra backslash, yielding <code>\\</code></li> <li>escape each LaTeX underscore (<code>_</code>) with two backslashes, yielding <code>\\_</code>.</li> </ul> <p>Hence, editing the above example, we get:</p> <pre><code>abstract = &quot;${O(d\\_{\\max})}$&quot; </code></pre> <p><strong>Cannot achieve line break in multiline equation (LaTeX/Mathjax)</strong></p> <p><code>\\</code> usually achieves a line break in a multiline LaTeX/Mathjax equation, but due to Hugo&rsquo;s Markdown parser it doesn&rsquo;t.</p> <p>Solution: use 6 backslashes for a line break, for example:</p> <pre><code>$$\begin{eqnarray} y &amp;=&amp; 1+1 \\\\\\ &amp;=&amp; 2 \end{eqnarray}$$ </code></pre> Bayesian nonparametric multilevel clustering with group-level contexts https://svethav.github.io/publication/bayesian-nonparametric/ Tue, 01 Jul 2014 00:00:00 +0000 https://svethav.github.io/publication/bayesian-nonparametric/ Risk stratification using data from electronic medical records better predicts suicide risks than clinician assessments https://svethav.github.io/publication/risk-stratification/ Tue, 01 Jul 2014 00:00:00 +0000 https://svethav.github.io/publication/risk-stratification/ Migrate from Jekyll to Hugo https://svethav.github.io/post/migrate-from-jekyll/ Mon, 10 Mar 2014 00:00:00 +1100 https://svethav.github.io/post/migrate-from-jekyll/ <p>Here are a few tips for migrating an existing website from Jekyll to Hugo. These tips can be applied in conjunction with following Hugo Academic&rsquo;s <a href="https://svethav.github.io/post/getting-started/" target="_blank">getting started guide</a>.</p> <h2 id="move-static-content-to-static">Move static content to <code>static</code></h2> <p>Jekyll has a rule that any directory not starting with <code>_</code> will be copied as-is to the <code>_site</code> output. Hugo keeps all static content under <code>static</code>. You should therefore move it all there. With Jekyll, something that looked like</p> <pre><code>▾ &lt;root&gt;/ ▾ images/ logo.png </code></pre> <p>should become</p> <pre><code>▾ &lt;root&gt;/ ▾ static/ ▾ images/ logo.png </code></pre> <p>Additionally, you&rsquo;ll want any files that should reside at the root (such as <code>CNAME</code>) to be moved to <code>static</code>.</p> <h2 id="fix-content">Fix content</h2> <p>Depending on the amount of customization that was done for each post in Jekyll, this step will require more or less effort. There are no hard and fast rules here except that <code>hugo server --watch</code> and the Hugo Academic example site are your friends. Test your changes and fix errors as needed.</p> <h2 id="publish">Publish</h2> <p>The default is for Jekyll to publish the website to a <code>_site</code> directory, whereas Hugo publishes to a <code>public</code> directory.</p> <h2 id="a-practical-example">A practical example</h2> <p>Alexandre Normand migrated his website from Jekyll to Hugo in less than a day. You can see all his changes by looking at this GitHub <a href="https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610" target="_blank">diff</a>. However, bear in mind that this example is <strong>not specific to the Academic theme nor does it use the latest version of Hugo</strong>.</p> TOBY: Early intervention in autism through technology https://svethav.github.io/publication/toby/ Mon, 01 Jul 2013 00:00:00 +0000 https://svethav.github.io/publication/toby/