Posts Tagged ‘align’

Struct sizes in C++

Posted: 24th March 2012 by Tim in C++
Tags: , , , , , , , , , , ,

Consider the following program: #include <iostream> struct A {     char a;     long b;     char c; }; struct B {     char a;     char c;     long b; }; int main() {     A a;     B b;     std::cout << “sizeof(a): ” << sizeof(a) << std::endl;     std::cout << “sizeof(b): ” << sizeof(b) << std::endl;     return 0; } To summarize, it […]

LaTeX align right or left

Posted: 24th April 2011 by Tim in LaTeX
Tags: , , , , , ,

Occasionally you may want to have text right-aligned in a LaTeX document. Other times you may want a block of left-aligned text next to a block of right-aligned text. LaTeX provides this functionality with the \hfill keyword. \hfill is a horizontal fill keyword. It tells LaTeX that you want to expand the space between the […]

Lining up equations in LaTeX

Posted: 16th August 2009 by Tim in LaTeX
Tags: , , , , , ,

When writing up math equations, it looks much nicer if all of the equals signs are under each other. This cannot be done in the default LaTeX environment, but can be done with the amsmath package included. In order to get the equations lined up, place the group of equations between align* tags. Then, simply […]