Skip to content

Instantly share code, notes, and snippets.

View SHDShim's full-sized avatar

S.-H. Dan Shim SHDShim

View GitHub Profile
@SHDShim
SHDShim / dropbox-zotero-obsitian-1.md
Last active March 2, 2024 22:21
Dropbox-Zotero-Obsidian integration setup 1

How to Setup Dropbox-Zotero-Obsidian Workflow

Introduction

This document only shows the setups required for Zotero-Obsidian integration. Tutorial on workflow is given in an in-person meeting.

There are many different ways to setup workflow for coordinating Dropbox, Zotero, and Obsidian. The setup described in this post is for:

  • using Dropbox provided by my university for accessing PDF files in multiples of devices, including Apple computers and iOS devices. I did not own a PC or Android device but I am fairly sure the setup below should work in the eco system.
@SHDShim
SHDShim / Zotero-shortcut.md
Last active January 13, 2024 21:49
Zotero shortcut keys

How to Copy a Citation Item in Zotero and Paste to Overleaf

Import from Zotero to Overleaf

  • Highlight a Zotero citation item.
  • Hold down Ctrl + Shift (Windows/Linux) or Cmd + Option (Mac) while dropping to Overleaf.

(Note) On macOS, it may be necessary to allow the Zotero window to come to the front before letting go for the modifier key to take effect.

Export bibtex item

@SHDShim
SHDShim / latex_track_change.md
Last active June 9, 2024 03:24
Clean-up latex track changes

Clean-up LaTeX Track Changes

Remove TrackChanges

If you have track change commands from the TrackChanges package (not the changes package), the commands can be removed by:

  1. Copy the entire Overleaf (or latex) folder to PythonPackge under trackchanges folder. For the command above to work, copy entire latex folder under /trackchanges-0.7.0/PythonPackage/ folder. Confirm you have acceptchanges.py in a folder above your latex files.
  2. Run Terminal and activate python v 2.7. Note that acceptchanges.py works only with python v2.7.
  3. Compile main tex file and make pdf to keep an original tracked version in PDF file.
  4. Rename all the tex files to be cleaned up. acceptchanges.py does not automatically deal with \input{} or \include{} files. So I have to process with acceptchanges.py all associated files individually.
@SHDShim
SHDShim / latex2word.md
Last active November 13, 2024 08:16
Pandoc - LaTeX to WORD conversion

LaTeX to WORD conversion

In most cases, it is simpler to (1) read a PDF file directly in WORD, or (2) use save as function in Acrobat Reader to save as a DOC file.

Install Pandoc

Pandoc can be installed in anaconda by

conda install pandoc
@SHDShim
SHDShim / san_serif_latex.md
Last active January 13, 2024 21:53
San Serif font for LaTeX

LaTeX Setup for San Serif fonts

The following works also for txfonts and pxfonts.

%%%%%%%%%%%%%%%%%%%
% fonts
%\usepackage{pxfonts}
%\usepackage{helvet}
@SHDShim
SHDShim / grep_b_a_line.md
Last active January 13, 2024 22:47
Grep before and after a line

Grep in Agave

To find around keywords

After

grep -A 10 magnetic output-FM-20GPa.txt

Before

@SHDShim
SHDShim / depth-pressure_conv.md
Last active January 13, 2024 21:55
PREM depth-pressure conversion

Python code to convert depth to pressure in PREM

from scipy.interpolate import UnivariateSpline

# from depth to pressure
tck = (np.asarray([ 660.,  660.,  660.,  660., 2900., 2900., 2900., 2900.]), 
       np.asarray([ 23.3585891 ,  56.70896396,  91.92747561, 136.58456648,
         0.        ,   0.        ,   0.        ,   0.        ]), 3)
d2p = UnivariateSpline._from_tck(tck)
@SHDShim
SHDShim / libxc.md
Created January 2, 2021 05:07
Install libxc

How to install libxc in agave.

mkdir -p $MYLIBXCDIR
cd $MYLIBXCDIR
wget -O libxc-5.0.0.tar.gz http://www.tddft.org/programs/libxc/down.php?file=5.0.0/libxc-5.0.0.tar.gz
tar xzf libxc-5.0.0.tar.gz
cd libxc-5.0.0
mkdir install
./configure --prefix=PATH/TO/LIBXC
@SHDShim
SHDShim / local_module.md
Last active January 13, 2024 22:48
Adding local python modules to the path to read

How to Add local python files to the path to read

import sys
sys.path.append('../../peakpo/')
sys.path.append('../local_modules/')