Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: bold color text and export to file

by pvaldes (Chaplain)
on Sep 22, 2014 at 20:10 UTC ( #1101565=note: print w/replies, xml ) Need Help??


in reply to bold color text and export to file

color output was difficult to save in text file

You can do it. It depends of the desired output format... want a yummy pdf?

my $dna = "AAAAAACAAACAAACCCAATATATATATACGACATATATTATATATTATACCCCGGG"; my $preciouss = substr $dna, 15, 28; open (my $output, '>', "latex_file.tex"); print $output "\\documentclass{article}\n\\usepackage{color}\n"; print $output "\\begin{document}\n"; print $output "THIS IS MY BORING GENE: \\textcolor{red}{", $preciouss, + "}\\\\\\textcolor{blue}{OKAY, OKAY... \\textit{NOT SO BORING}, {\\bf + IS RED!}}"; print $output "\n\\end{document}"; close $output; system("pdflatex latex_file.tex"); system("xpdf latex_file.pdf &");

You will need to have installed a decent tex distro and xpdf. See texlive. You can also translate to html, dvi or postscript easily from here, as you will

Update: typo fixed in textit and new link

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1101565]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2019-10-17 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?