Showing posts with label style code. Show all posts
Showing posts with label style code. Show all posts

Monday, 7 October 2013

Export variable Java Linux! I see the light!

Why you don't find java or javac command in my terminal? I suppose  you have installed it, then because you don't find it? Maybe some malignant entities into your computer has removed java or maybe not.....where is the light in all of this?

It is simple! YOU MUST EXPORT JAVA_HOME! Java has an home? cool! 

Let's do it!

(This process set permantely your java variable into your computer)

  1. Open terminal in linux.
  2. If you don't know where is java is located, write in terminal: whereis java. A possible set of results can be:
    Save path that ending with ..../bin/java
  3. Now, write in your console: sudo nano /etc/profile and write at finsh of file these line:
    and instead of /home/lorenzo/Documenti/jdk1.7.0_25/bin insert the path, without the final words /java, that you have saved it before.
  4. Hit ctrl+o and press enter and hit ctrl+x.
  5. Write in console source /etc/profile 
  6. And work is complete!
FINISH HIM! (ehmm take out MortalKombat...)

Saturday, 5 October 2013

Damn! How to set image in a landscape mode into Lyx.

Ok. Finally i've discovered the magic formula to set a image in landscape mode into lyx, with custom margin.

The ingredients are these: 
  1. Modify Document preamble: go to Document->Settings->LaTextPreamble and add: 
    \usepackage{pdflscape}
    \usepackage{changepage}
    \usepackage{anysize}
  2. Before you insert the image, add a LaText box code (or hit CTRL+L) and insert: \marginsize{3cm}{2cm}{0cm}{1cm} % left rigth top bottom
    \begin{landscape}
  3.  Add Image (Insert->Image or Insert ->Floating Object and after, Insert->Image).
  4. Set image size: mouse right click on image and select Settings.
  5. After Image add another  LaText box code and insert: \end{landscape}
  6. Optionally: if you want change margin, add another time  \marginsize{3cm}{2cm}{0cm}{1cm} % left rigth top bottom with your preffered values.
This is the result: 

Friday, 27 September 2013

Lyx Program Listing cool style

Hello! While I was writing my thesis with lyx, I found myself to insert(to see to insert a box code, visit: http://stackoverflow.com/questions/2116944/insert-programming-code-in-a-lyx-document) a box contains a program code ( Java). Without options, the box code is very good, like:
It is nice, but if I want more style? In this document there are a lots of tricks to get our code box nicest http://ftp.uniroma2.it/TeX/macros/latex/contrib/listings/listings.pdf. To insert option configuration into box code, click with right click mouse into box code, and going to Settings->Advanced insert your options.

For example, to get this result : 






 


I have inserted these option: 

caption={Classe java Tripla}
emph={subject,predicate,object}
emphstyle={\color{blue}}
frame=shadowbox
keywordstyle={\color{violet}}
rulesepcolor={\color{gray}}

Try to believe!!

P.S. To enable all color into lyn, do this: go in Document->Settings->Latext Preamble and insert
\usepackage{xcolor}