You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2019-07-31-high-quality-supplement-supporting-information.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,27 @@
1
1
---
2
2
layout: post
3
-
title: High quality vector graphics in Microsoft Word for Supplementary / Supporting Information
3
+
title: High quality vector graphics in Microsoft Word
4
4
image: images/vector_vs_raster.svg
5
5
image-alt: Comparing vector and raster formats
6
6
last_modified_at: 2020-12-12 10:43:06 -0800
7
7
comments: false
8
+
description: Use Enhanced MetaFile (.emf) format to embed high quality vector graphics in Microsoft Word
8
9
---
9
10
10
11
## Background
12
+
11
13
To maintain quality, integrity, and aesthetics, vector graphic formats such as PDF or EPS are generally preferred for artwork and data visualizations over raster (pixel-based) formats such as png, gif, or jpeg. The reason becomes especially apparent at high magnification. As shown in the extreme example below, vector formats maintain smooth curves (left), while raster formats become pixelated (right).
12
14
13
15
<imgclass="centered_img"src="/images/vector_vs_raster.svg"alt="[img] Vector graphic compared to raster graphic" />
14
16
15
17
There are many reasons to want high quality graphics embedded in a document; my issue was that unlike the main article of a peer-reviewed scientific publication, the Supplementary / Supporting Information is often not edited for style or typeset by the journal. This leaves the author responsible for incorporating supplementary figures as high quality graphics.
18
+
16
19
## Challenge
20
+
17
21
Microsoft Word does not allow PDF or ([as of April 11, 2017](https://support.office.com/en-us/article/support-for-eps-images-has-been-turned-off-in-office-a069d664-4bcf-415e-a1b5-cbb0c334a840)) EPS files to be embedded in a document.
18
22
19
23
## Solutions
24
+
20
25
The most appealing solution for users of Microsoft Word: Export graphics in the Enhanced MetaFile `.emf` format using Adobe Illustrator or Inkscape and `Insert` them as Pictures in Word. When the Word document is then saved as a PDF, the graphics are rendered appropriately in a high-quality, vector format.
21
26
22
27
Alternatively, LaTeX can be used to generate a PDF that contains the supplementary text, figures, and captions. For an idea of how this can be done, see my GitHub [Stanford LaTeX thesis template](https://github.com/dcroote/stanford-thesis-example) repository. Understandably, however, this may be too much effort and may not be compatible with an iterative revision process with coauthors unfamiliar with LaTeX.
Copy file name to clipboardExpand all lines: _posts/2019-08-31-cleaning-a-garlic-press.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ I have a cheap garlic press, which means that after each use garlic is stuck in
17
17
18
18
## CAD model
19
19
20
-
This is a simple design consisting of an extruded base and an array of posts (extruded circles). There are 7 rows of 9 posts, with alternating rows offset from one another. The full model is [available on Onshape](https://cad.onshape.com/documents/cb2f7780bde13603780e855c/w/8bb77d57f5a67c7b4d3e95ad/e/037f1c0159a5ebba17e23b8f), which is a free online service if you don't mind your designs being public.
20
+
This is a simple design consisting of an extruded base and an array of posts (extruded circles). There are 7 rows of 9 posts, with alternating rows offset from one another. The full model is [available on Onshape](https://cad.onshape.com/documents/cb2f7780bde13603780e855c/w/8bb77d57f5a67c7b4d3e95ad/e/037f1c0159a5ebba17e23b8f), which is a free online service if you don't mind your designs being public.
21
21
22
22
[](/images/garlic_press/cad_combined.png)
Copy file name to clipboardExpand all lines: _posts/2020-05-09-cold-brew.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ Yes, I caved and bought an actual chemistry stir plate. The cold brew coffee had
37
37
Finally, on to the cold brew coffee itself. There are an enormous number of variables at play here, including the bean varietal, country of origin, roast, grind size, coffee to water ratio, and brew time. While Design of Experiments techniques could have lent statistical rigor to the evaluation of input variability, my global optimization approach better resembled explore and exploit,<sup>2</sup> where the former took precedence initially as I sampled somewhat randomly (finely ground light roast not advised!) and the latter takes precedence today now that I've reached somewhere near a local optimum. I suggest medium to dark roast Arabica beans, 12 hours of brewing, a coarse grind with a burr grinder, and a ratio of 15:1 water to beans. Filter and enjoy on ice!
38
38
39
39
### Footnotes
40
+
40
41
<olstyle="font-size: 0.9em">
41
42
<li>Moroney, K. M., Lee, W. T., Suijver, F., & Marra, J. (2015). Modelling of coffee extraction during brewing using multiscale methods: An experimentally validated model. Chemical Engineering Science, 137, 216-234. doi: 10.1016/j.ces.2015.06.003</li>
42
43
<li>Explore / exploit is highlighted in the fascinating read Algorithms to Live By, which, amusingly, also provides 'caching' as justification for not throwing laundry in the laundry basket.</li>
Copy file name to clipboardExpand all lines: _posts/2020-09-06-github-actions-from-travis.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,29 +12,35 @@ GitHub Actions should simplify continuous integration (CI) for public repositori
12
12
<imgsrc="/images/github_actions/travis_to_github_actions.png"alt="Migrate to GitHub Actions from Travis CI"class="centered_img"width="606"height="303" />
13
13
14
14
## The test repository
15
+
15
16
After writing my PhD thesis in LaTeX, I published a thesis template designed to help others save time. In this [Stanford LaTeX Thesis Example repository](https://github.com/dcroote/stanford-thesis-example), I use CI to compile a PDF and upload it as a Release asset so that the PDF available for download from the README always corresponds to the latest Release version.
16
17
17
18
## Previous implementation
19
+
18
20
[Previously](https://github.com/dcroote/stanford-thesis-example/blob/aa4d62bb17849f89c460a47ce88b5c5f05586054/.travis.yml), I used Travis CI to pull a Docker image and compile a PDF from LaTeX source files. For tagged commits, a distinct GitHub account with write privileges to the repository (a [Machine user](https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users)) then uploaded the compiled PDF as a Release asset. Using Docker within Travis CI to compile the PDF worked well, but having to create a new GitHub account for the sole purpose of deploying to GitHub Releases, as is [recommended for security purposes](https://docs.travis-ci.com/user/deployment-v2/providers/releases/#authenticating-with-an-oauth-token), was not ideal and further required the [Travis gem to encrypt a personal access token](https://docs.travis-ci.com/user/environment-variables#defining-encrypted-variables-in-travisyml).
19
21
20
22
## Current implementation (2020/09/06)
23
+
21
24
You can view the [full workflow on GitHub](https://github.com/dcroote/stanford-thesis-example/blob/2f89058fbc73e9887c659ed1197b73fce7d9333a/.github/workflows/build.yml) (note that this URL points to the current commit as of this writing and not the master branch). Currently, two sequential jobs within a single GitHub Actions workflow mirror the two steps in the previous implementation: compilation and Release asset upload. Using two jobs within one workflow rather than two distinct workflows avoids performing the compilation step twice; however, an `if` conditional within the second job is necessary to limit its execution to only when the workflow is triggered by a tagged commit (rather than, for example, a PR). The two jobs consist of the following steps:
22
25
23
26
**(1)** Triggered by a push or pull request (PR), the first workflow job compiles the PDF from source and uploads it as a build artifact. The job's four steps are:
27
+
24
28
1. Checkout source code using the [Checkout](https://github.com/marketplace/actions/checkout) GitHub Action.
25
-
2. Compile the LaTeX PDF file using the Marketplace Action: [GitHub Action for LaTeX](https://github.com/marketplace/actions/github-action-for-latex) by `xu-cheng`.
29
+
2. Compile the LaTeX PDF file using the Marketplace Action: [GitHub Action for LaTeX](https://github.com/marketplace/actions/github-action-for-latex) by `xu-cheng`.
26
30
3. Rename the compiled PDF using a bash shell. Note that this isn't strictly necessary, but retaining the PDF filename allowed me to maintain backwards compatibility.
27
31
4. Upload the PDF as an artifact using the [Upload a Build Artifact](https://github.com/marketplace/actions/upload-a-build-artifact) GitHub Action. This Action allows data to persist beyond the lifetime of the job and in my case allows the PDF to be inspected, for example to evaluate changes from a PR.
28
32
29
33
**(2)** For a PR or an untagged commit, the GitHub Actions workflow ends here with success or failure. If instead the commit is tagged and the tag starts with `v` (i.e. uses semantic versioning of the form `v#.#.#`), then this job downloads the previously uploaded artifact, creates a draft Release, and uploads the PDF as a Release asset. The three steps are:
34
+
30
35
1. Download the artifact from the previous job using the [Download a Build Artifact](https://github.com/marketplace/actions/download-a-build-artifact) GitHub Action.
31
36
2. Create a draft Release using the [Create a Release](https://github.com/marketplace/actions/create-a-release) GitHub Action. The benefit of GitHub Actions over Travis CI is particularly apparent in this step as the Action automatically provides the appropriate GitHub Token for authentication.
32
37
3. Upload the PDF as a Release asset. After this succeeds I can add a changelog to the draft Release and publish. The repository's README will then automatically point to this new PDF because the URL uses `latest`: [https://github.com/dcroote/stanford-thesis-example/releases/latest/download/thesis-example.pdf](https://github.com/dcroote/stanford-thesis-example/releases/latest/download/thesis-example.pdf).
33
38
34
39
If you have suggestions for improving the workflow, let me know!
35
40
36
41
## Helpful resources:
42
+
37
43
- GitHub Docs on: [Workflow syntax reference for GitHub Actions](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions), especially the job [if conditional](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif)
38
44
- GitHub Docs on: [Persisting workflow data using artifacts](https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts)
39
45
- GitHub Docs on: [Context and expression syntax for GitHub Actions](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions)
40
-
- Stack Overflow: [github actions: how to check if current push has new tag (is new release)?](https://stackoverflow.com/a/58478262)
46
+
- Stack Overflow: [github actions: how to check if current push has new tag (is new release)?](https://stackoverflow.com/a/58478262)
description: "I recently transitioned my site from GitHub's freely hosted github.io domain to https://www.derekcroote.com after seeing how quick and inexpensive it was for my sister to create a beautiful portfolio website. This short post walks through the process."
description: Build and host a custom domain website for free using Hugo, GitHub, and Render. This step-by-step guide walks through creating a professional static website with zero hosting costs.
7
8
---
8
9
9
-
Free hosting of custom domain websites? Many companies advertise “free website hosting” and it can be frustrating to finally find, buried in a FAQ, that custom domain hosting is an additional charge.
10
+
Free hosting of custom domain websites? Many companies advertise "free website hosting" and it can be frustrating to finally find, buried in a FAQ, that custom domain hosting is an additional charge.
10
11
11
12
This abbreviated tutorial describes the set of tools and services that allows you to build and host a custom domain website for free (beyond the cost of the domain name itself).
12
13
I applied this flow to quickly launch a website for my wife, but note that it does assume some familiarity with `git`, `docker`, and web development owing to use of the following services:
image-alt: Vector illustration of the outline of two credit cards
6
6
last_modified_at: 2024-04-25 22:12:00 -0700
7
7
comments: false
8
+
description: A practical guide to maximizing credit card rewards with just two cards. Learn how prioritizing simplicity and profitability can optimize your cashback without the complexity of points systems.
8
9
---
9
10
10
11
The allure of quantitative analysis almost led me into a career in finance instead of biotech, and while I don't regret that road not taken, I still enjoy the occasional foray.
0 commit comments