Hello…

In this post I will teach you how to find files in Linux using the Console… It’s easy, just use the following commnad:

\mathrm{find~<parent\_directory>~-<search\_criterion>~<file>}

where \mathrm{<parent\_directory>} is the folder where you want to start searching, \mathrm{<search\_criterion>} is the criterion you will use to narrow the search space (name, size, etc.), \mathrm{<file>} is the folder or file that you are looking for… you can write the full name of the file with the extension, or you can look for files containing certain words at the beginning, in the middle or at the end of the file’s name… or even you can search for extensions….

Look at these examples:

1. \mathrm{/home/user/Documents~-name~article.pdf}

This example is looking for the file named \mathrm{article.pdf} in the folder \mathrm{/home/user/Documents}.

2.  \mathrm{/~-name~article*}

This example is looking for files containing the word \mathrm{article} at the beginning of the file’s name in the root’s folder (\mathrm{/}).

3. \mathrm{/usr/share~-name~*article}

This example is looking for files containing the word \mathrm{article} at the end of the file’s name in the folder \mathrm{/usr/share}.

4. \mathrm{/etc~-name~*article*}

This example is looking for files containing the word \mathrm{article} in the file’s name in the folder \mathrm{/etc}.

5. \mathrm{/usr/share~-name~*.txt}

This example is looking for plain text files (\mathrm{*.txt}) in the folder \mathrm{/usr/share}.

6. \mathrm{/home/user~-size~+1000k}

This example is looking for files whose size is greater or equal than \mathrm{1000kb} in the folder \mathrm{/home/user}.

7. \mathrm{/home/user~-size~-1000k}

This example is looking for files whose size is lower or equal than \mathrm{1000kb} in the folder \mathrm{/home/user}.

Well.. there are other options, and you can read the \mathrm{man} pages of the command \mathrm{find} in the console… Hope this will be useful… See you then.

How to print images in MATLAB as PDF

Posted: February 18, 2012 in MATLAB

Hello… In this post I will explain how to save MATLAB figures as PDF from the Command Window, with good quality and without leaving unnecessary white spaces between the margins and the border of the figure….

Just plot your figure as usual… then I recommend to maximize the figure, and then copy the following commands:

Now your figure is ready to be saved as PDF, and that is performed with the following command:

\verb+print -dpdf -r400 file.pdf+

where \verb+file.pdf+ is the name you give to your file, and \verb+-r400+ is the resolution you want your figure has…

Well, that’s it for today… see you later…

Maths in the Table of Contents of LaTeX…

Posted: February 10, 2012 in LaTeX

Hello… here’s this post where I am going to explain how to add math symbols in the Table of Contents (TOC) in \LaTeX without warnings….

If you try to add math symbols in the TOC you will get warnings, the TOC will be generated but the annoying warnings will appear… The solution to turn off those warnings is easy….

Suppose you have a section with the following title:

if you want that the symbol appears in the TOC, just modify the section title with the following command:

where \verb+\textorpdfstring{...}{...}+ has two arguments, the first one is the symbol you want to appear in the TOC, the second argument is a string which will represent the symbol in the ‘Bookmarks’ of the final PDF file….

Well… that’s it… See you then…

Hello… here’s this useful command that let us sort alphabetically any plain text using the command-line in Linux… Just open a new Terminal in the folder where is located the file you want to sort (I called that file: \verb+unordered_file+)… Then type the following command:

\verb+cat unordered_file | sort > ordered_file+

where \verb+ordered_file+ is the file sorted alphabetically, and that’s it….

How to write with LaTeX in Inkscape?….

Posted: January 29, 2012 in LaTeX

Here’s a tool that my tutor show me in order to write with \LaTeX in Inkscape… Just go to this website… The application is called “TeXtext”, and is an extension for Inkscape that let me use \LaTeX inside Inkscape…. Just download the latest version (at the moment is the 0.4.4)…

You have to install the following packages before uncompress the package:

- PDFLaTeX (is automatically installed with your \LaTeX distribution).

- ‘Pstoedit’ or ‘PDFtoSVG’ (one of these packages – or both if you want)…

Now you can install the extensions…. If you have Inkscape 0.47 or newer (I recommend Inkscape 0.48), just uncompress the package TeXtext.tar.gz and copy or move all the files to the following folder:

\verb+~/.config/inkscape/extensions+

and that’s it… Oh, wait, there’s more… I tried to use it the first time and some warnings appeared, but the application worked… I hate warnings, so here’s how to avoid those warnings:

- open ‘textext.py’ with any editor (I use Kate)… and delete the library md5 (line 55).

- Now add the following lines from line 57:

#########################################################

#BEGIN *** This is done to avoid warnings related with md5 library ***


#END *** This is done to avoid warnings related with md5 library ***

#########################################################

and with that you avoid the annoying warnings…. Check the indentation because Python complaint about that… also check the quotes (” … “)

- One last tip… Write a basic preamble for \LaTeX, and copy that preamble to the same folder where you put the extensions. When using TeXtext specify this preamble to write your stuff… I use the following preamble:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}                  % mathematical symbols and fonts

%% Use one of the following encoding packages according to your system and needs
\usepackage[T1]{fontenc}                              % special characters and encoding
% \usepackage[utf8]{inputenc}                      % special characters and encoding (For UTF-8)
% \usepackage[latin1]{inputenc}                    % special characters and encoding (for ISO-8859-1)
\usepackage{fourier-orns}                                % several logos and ornaments
% Mathematical fonts using ‘mathrsfs’ (Usage: in math mode: \mathscr{<letter>}).
% I’m goning to use it to generate the symbol for Laplace transform (\mathscr{L}), Fourier transform (\mathscr{F}) and others:
\usepackage{mathrsfs}
\usepackage{mathtools}                                    % mathematical tools

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

You do not have to add \docummentclass{…} nor \begin{document}-\end{document}… Just add basic packages that let you write in LaTeX… I think that these packages are enough… I have the package ‘fontenc’ with option [T1], this package worked smoothly in the computer at the office, but in the computer at home I could not use normal text, just maths, so I changed the package fontenc, and used instead at home ‘inputenc’ with option ‘utf8′… for that reason I have commented those lines… that’s a problem of codification, so try one of those lines that let you use TeXtext without warnings or problems… Ok, now that’s it… See you then…

PS: I attached an image with an example (Example with TeXtext)… enjoy the application…

To install Flash Player on Google Chrome or Firefox in Linux, just download the latest version of the software from the official page of Adobe, select your distribution (Ubuntu, Fedora, OpenSuse, other distro) and uncompress the file downloaded…

Then, copy the files in the folder \verb+usr+ to the respective folders in your system… to do that you have to copy all the files as \verb+sudo+.

For instance, suppose you have downloaded the file to the ‘Downloads’ folder, and you have already uncompressed the file, so type in the terminal (Bash) the following command line:

\verb+sudo cp ~/Downloads/usr/<any_file> /usr/<location>+

After you have copied all files in the respective folders, is time to copy the plugin for Flash Player, so copy the file:

\verb+libflashplayer.so+

in the following direction:

\verb+/opt/google/chrome/plugins/+

in the case of Google Chrome, again, as \verb+sudo+. If the folder \verb+plugins+ does not exist, just create it with the command: \verb+mkdir+… That’s it… now Google Chrome has Flash Player installed

If you use Firefox, install the plugin in:

\verb+/usr/lib/firefox/plugins/+

and that’s it, now Firefox has Flash Player installed…

Also note that by the \emph{duality principle}

A test…

Posted: January 27, 2012 in LaTeX
Tags:

Here’s an example using \LaTeX, a powerful editor that displays beautiful texts, like this:

\boldsymbol{x}(t) = \begin{bmatrix} \boldsymbol{y}_{i}(t)& \boldsymbol{z}_{i}(t)\\ \boldsymbol{y}_{j}(t)& \boldsymbol{z}_{j}(t) \end{bmatrix}, \quad \boldsymbol{x}(t) \in \mathbb{R}^{2 \times 2}

To use \LaTeX code in WordPress, just go to this site and type your formulas there, copy the HTML code and paste it in your post (editing as HTML)… That’s it….

Other option is to use the \LaTeX support offered by WordPress.. go to this site and read how to add \LaTeX code in your post from WordPress…

Enjoy the applications and see you later.