TeX Community Aggregator

Category LaTeX and Miscellaneous (Chen Future)

One simple way to do simple floating point arithmetics in shell

#!/bin/tcsh set n = 128 set beta = `echo “(-0.6)*($n)*($n)” | bc -l` set ppn = 16 set np = 31 set nodes = `echo “if ($np%$ppn==0) {$np/$ppn;} else {$np/$ppn+1}” | bc`

Fantastic LaTeX Drawings

http://texample.net http://pgfplots.net

Three articles that inspire me lately

An Aspiring Scientist’s Frustration with Modern-Day Academia: A Resignation On Leaving Academe Machine Learning that Matters

Useful Linux command—paste

I have for long ignored blogging, but today I came across the useful linux command “paste” and I thought I should write it down. In the past I have used quite a few smart tricks to handle data or output… Continue Reading →

The cases environment in latex

The cases environment defined by the amsmath package sets each case to be inline math style. This will look ugly when the formulas in the cases are complicated, such as fractions or integrals. Consider the following sample code: usepackage{amsmath} [… Continue Reading →

Syracuse PSTricks Page

http://melusine.eu.org/syracuse/pstricks/ Many fantastic PSTricks examples.

Mess up Matlab codes and outputs in LaTeX

You do not want to mess up, right? When writing a LaTeX document, you may once in a while want to include some Matlab codes and/or outputs (preferably typeset using typewriter font if you have the same taste as me)… Continue Reading →

Call by value or call by reference?

In C, if you pass in a pointer to a function, the content of the involved variable may be changed. In Matlab, however, if you pass in an array as an argument, the content of the array will never be… Continue Reading →

A sample MATLAB code for defining functions with cases

The code should be self-explaning.. function y = f(x) y1 = x.* (x<0); y2 = x.^2 .* (x>=0) .* (x<2); y3 = 4 .* (x>=2); y = y1 + y2 + y3;

© 2025 TeX.social