{"generator":"Jekyll","link":[{"@attributes":{"href":"https:\/\/praveenv253.github.io\/feed.xml","rel":"self","type":"application\/atom+xml"}},{"@attributes":{"href":"https:\/\/praveenv253.github.io\/","rel":"alternate","type":"text\/html"}}],"updated":"2024-11-26T23:35:43-08:00","id":"https:\/\/praveenv253.github.io\/feed.xml","title":"Praveen\u2019s website","subtitle":"Praveen Venkatesh's personal website.","author":{"name":"Praveen Venkatesh"},"entry":[{"title":"Defining and Inferring Flows of Information in Neural Circuits","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/research\/2020\/08\/05\/info-flow-in-comp-sys.html","rel":"alternate","type":"text\/html","title":"Defining and Inferring Flows of Information in Neural Circuits"}},"published":"2020-08-05T16:06:00-07:00","updated":"2020-08-05T16:06:00-07:00","id":"https:\/\/praveenv253.github.io\/research\/2020\/08\/05\/info-flow-in-comp-sys","content":"<p>While studying existing methods for inferring information flow in neuroscience, we recognized that Granger Causality <a href=\"\/publications#Venkatesh2015Direction\">does not always<\/a> capture information flow <em>about a specific message or stimulus<\/em>. We were able to construct a counterexample wherein Granger Causality inferred the incorrect flow of a message, <em>even when all nodes were observed and when there was no measurement noise<\/em>. This counterexample also applied to generalizations of Granger Causality, such as Transfer Entropy and Directed Information. We believe that an important reason for the failure of Granger Causality-based tools in this context was the lack of a <em>formal definition for information flow<\/em> pertaining to a specific <em>message<\/em> (which could be the stimulus or response in a neuroscientific experiment). The development of such a definition, in turn, was impeded by the absence of a concrete theoretical framework that linked information flow about a message to empirical measurements. <a href=\"\/publications#Venkatesh2018Information\">We addressed this fundamental gap<\/a> in our understanding by proposing a new computational model of the brain, and by providing a new definition for information flow about a message within this model.<\/p>\n\n<p>A central contribution of our work lies in recognizing that tracking the flow of information about a specific message <em>requires<\/em> that we also account for <em>synergistic<\/em> flows of information. To understand why, note that a message $M$ may be represented, in combination with some independent \u201cnoise\u201d variable $Z$, as $M{+}Z$ and $Z$, across two different brain areas. Represented in this form, if the noise $Z$ is large, it can be very hard to ascertain the presence of information flow about $M$ in the combination $[M{+}Z, Z]$, unless we account for possible synergy between these two brain areas. Accounting for synergy, using conditional mutual information for instance, is thus crucial for tracking information flow in arbitrary computational systems. Relatedly, I have also begun exploring how synergy, along with other partial information measures such as uniqueness and redundancy, arise and interact in neural encoding using entorhinal grid cells as a case study (<a href=\"\/publications#Venkatesh2020Understanding\">Venkatesh and Grover, <em>Cosyne<\/em>, 2020<\/a>).<\/p>\n\n<p><img src=\"\/assets\/img\/xor-counterexample.png\" alt=\"Cannot track information flow without accounting for synergy\" width=\"400px\" class=\"align-center\" \/><\/p>\n\n<p>Our new measure of information flow does not have the same pitfalls as Granger Causality, while satisfying our intuition in several canonical examples of computational systems. The full impact of this work continues to be realized, as <a href=\"\/publications#Venkatesh2020Define\">we explore new measures in greater depth<\/a>, demonstrate and validate these methods on artificial neural networks, and examine the causal implications of making interventions based on information flow inferences.<\/p>\n\n<p><a href=\"\/publications#Venkatesh2018Information\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Main paper in Transactions on Info Theory<\/a>\n<a href=\"\/publications#Venkatesh2015Direction_Allerton\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u20022015 Granger Causality Counterexample paper<\/a>\n<a href=\"\/publications#Venkatesh2020Define\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u20022020 ISIT paper on alternative definitions<\/a><\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"research"}},{"@attributes":{"term":"Information flow"}},{"@attributes":{"term":"Message"}},{"@attributes":{"term":"Computational system"}},{"@attributes":{"term":"Granger Causality"}},{"@attributes":{"term":"Synergy"}},{"@attributes":{"term":"Partial information decomposition"}}],"summary":"While studying existing methods for inferring information flow in neuroscience, we recognized that Granger Causality does not always capture information flow about a specific message or stimulus. We were able to construct a counterexample wherein Granger Causality inferred the incorrect flow of a message, even when all nodes were observed and when there was no measurement noise. This counterexample also applied to generalizations of Granger Causality, such as Transfer Entropy and Directed Information. We believe that an important reason for the failure of Granger Causality-based tools in this context was the lack of a formal definition for information flow pertaining to a specific message (which could be the stimulus or response in a neuroscientific experiment). The development of such a definition, in turn, was impeded by the absence of a concrete theoretical framework that linked information flow about a message to empirical measurements. We addressed this fundamental gap in our understanding by proposing a new computational model of the brain, and by providing a new definition for information flow about a message within this model."},{"title":"Encoding in Grid Cells: Uniqueness, Redundancy and Synergy","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/research\/2020\/08\/05\/pid-grid-cells-cosyne.html","rel":"alternate","type":"text\/html","title":"Encoding in Grid Cells: Uniqueness, Redundancy and Synergy"}},"published":"2020-08-05T16:06:00-07:00","updated":"2020-08-05T16:06:00-07:00","id":"https:\/\/praveenv253.github.io\/research\/2020\/08\/05\/pid-grid-cells-cosyne","content":"<p>An important contribution of my earlier work on <a href=\"\/publications#Venkatesh2018Information\">information flow<\/a> lies in recognizing that accounting for synergy is essential if we want a measure of information flow that can guarantee the ability to track a message as it flows through a computational system. I presented a <a href=\"\/publications#Venkatesh2020Understanding\">poster at Cosyne<\/a> this year, which supports and extends my information flow result in several key directions:<\/p>\n\n<ol>\n  <li>First, it demonstrates how ideas such as uniqueness, redundancy and synergy are highly relevant in neural systems, through a case study on entorhinal grid cells;<\/li>\n  <li>Second, it shows how recent technical advances in information theory provide new ways to <em>quantify<\/em> uniqueness, redundancy and synergy in such systems, giving neuroscientists a new tool, and the ability to pose and answer experimental questions in a completely new way (e.g., how much of the information about an animal\u2019s location is redundantly encoded between grid cells and place cells?);<\/li>\n  <li>Thirdly, it shows that synergy can arise in unexpected ways\u2014indeed, synergy sometimes appears when we ask a different <em>question<\/em>. We show that each grid module encodes <em>unique<\/em> information about an animal\u2019s <em>precise<\/em> location; however, when we ask how these modules encode information about the animal\u2019s location at a very <em>coarse<\/em> spatial scale, the same modules encode coarse location information <em>synergistically<\/em>.<\/li>\n<\/ol>\n\n<p>This work thus highlights how synergy may be common, and that it depends on how one looks at the same information. I chose to highlight this work in spite of it being an abstract because it fits well into my future vision: I seek to discover, through collaborations, more examples of neural systems that are ripe for information-theoretic exploration.<\/p>\n\n<p><a href=\"\/assets\/doc\/abstracts\/2020--cosyne--abstract.pdf\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Cosyne 2020 Abstract<\/a>\n<a href=\"\/assets\/doc\/posters\/2020--cosyne--poster.pdf\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Cosyne 2020 Poster<\/a><\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"research"}},{"@attributes":{"term":"Grid cells"}},{"@attributes":{"term":"Partial information decomposition"}},{"@attributes":{"term":"Synergy"}}],"summary":"An important contribution of my earlier work on information flow lies in recognizing that accounting for synergy is essential if we want a measure of information flow that can guarantee the ability to track a message as it flows through a computational system. I presented a poster at Cosyne this year, which supports and extends my information flow result in several key directions:"},{"title":"Systematically questioning the self-fulfilling prophecy of EEG\u2019s low resolution","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/research\/2017\/08\/12\/eeg-self-fulfilling-prophecy.html","rel":"alternate","type":"text\/html","title":"Systematically questioning the self-fulfilling prophecy of EEG\u2019s low resolution"}},"published":"2017-08-12T09:01:00-07:00","updated":"2017-08-12T09:01:00-07:00","id":"https:\/\/praveenv253.github.io\/research\/2017\/08\/12\/eeg-self-fulfilling-prophecy","content":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Electroencephalography\">Electroencephalography<\/a>\n(EEG) has long been believed to be a low-resolution brain imaging modality.\nThere is a pervasive view in the community of EEG users that increasing the\nnumber of EEG electrodes will not improve imaging resolution. We have worked\ntowards systematically understanding the reasons this view exists, and towards\nchanging perceptions about EEG.<\/p>\n\n<p>The heart of our argument is explained in our <a href=\"\/publications#Grover2017Information\">recent\npaper<\/a> titled \u201cAn Information-theoretic\nView of EEG Sensing\u201d. We examined previous estimates of the number of sensors\nneeded to recover the EEG signal. These estimates relied on computing the\n\u201cspatial Nyquist rate\u201d of scalp EEG, and it turned out that they underestimated\nthe number of sensors required to reliably recover the <em>continuous scalp\npotential<\/em>. We also showed, through simulations and intuitive arguments, that\nthe number of EEG sensors required to recover the <em>signal within the brain<\/em>\ncould be even higher than the number prescribed by the spatial Nyquist rate.<\/p>\n\n<p>Naturally, the follow-up question is: \u201cWhat are the fundamental theoretical\nlimits of the imaging resolution achievable by EEG, and how does this\nresolution improve with increasing numbers of sensors?\u201d While this paper gives\na first-pass at understanding these limits, we followed up with <a href=\"\/publications#Venkatesh2017Lower\">a\npaper<\/a> that gave the first analytical results\nshowing that EEG\u2019s imaging resolution could improve with an increase in the\nnumber of EEG sensors.<\/p>\n\n<p>We also gave information-theoretic techniques to help save power in a future\nimplementation of an ultra-high-density EEG system. This last point, which\nfocuses on the practical aspects of instrumenting such a high-density EEG\nsystem was first discussed in <a href=\"\/publications#Grover2015Information\">Allerton\n2015<\/a>, where we introduced a \u201chierarchical\nreferencing mechanism\u201d to save power and circuit area.<\/p>\n\n<p>Towards showing experimentally and practically that high density EEG, and\nspecifically, super-Nyquist sampling is more informative than conventional EEG,\nwe recently conducted some experiments in collaboration with Amanda Robinson,\nMarlene Behrmann and Mike Tarr at CMU\u2019s Psychology department, which <a href=\"\/publications#Robinson2017Very\">show\nthat<\/a> high-density EEG has better\nclassification accuracy than low-density EEG in classifying between visual\nstimuli of different spatial frequencies.<\/p>\n\n<p><a href=\"\/publications#Grover2017Information\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Link to paper<\/a>\n<a href=\"\/publications#Venkatesh2017High\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Link to poster<\/a><\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"research"}},{"@attributes":{"term":"EEG"}},{"@attributes":{"term":"Nyquist rate"}},{"@attributes":{"term":"Fundamental limits"}},{"@attributes":{"term":"Experimental validation"}}],"summary":"Electroencephalography (EEG) has long been believed to be a low-resolution brain imaging modality. There is a pervasive view in the community of EEG users that increasing the number of EEG electrodes will not improve imaging resolution. We have worked towards systematically understanding the reasons this view exists, and towards changing perceptions about EEG."},{"title":"Directions of information flow and Granger Causality","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/research\/2017\/08\/11\/gc-info-flows.html","rel":"alternate","type":"text\/html","title":"Directions of information flow and Granger Causality"}},"published":"2017-08-11T18:06:00-07:00","updated":"2017-08-11T18:06:00-07:00","id":"https:\/\/praveenv253.github.io\/research\/2017\/08\/11\/gc-info-flows","content":"<p>Granger causality is an established measure of the \u201ccausal influence\u201d that\none statistical process has on another. It has been used extensively in\nneuroscience to infer statistical causal influences. Recently, however,\nmany works in the neuroscience literature have begun to compare Granger\ncausal influences along forward and reverse links of a feedback network in\norder to determine the direction of information flow in this network.<\/p>\n\n<p><img src=\"\/assets\/img\/gc-vs-message.jpg\" alt=\"Greater GC can be opposite the direction of Info flow\" width=\"400px\" class=\"align-center\" \/><\/p>\n\n<p>We asked whether comparing Granger causal influences correctly captures the\ndirection of information flow in a simple feedback network. We discovered,\nusing simple theoretical experiments, that comparison of Granger causal\ninfluences can, in fact, yield an answer that is opposite to the true\ndirection of information flow.<\/p>\n\n<p><a href=\"\/publications#Venkatesh2015Direction_Allerton\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Link to paper<\/a>\n<a href=\"\/publications#Venkatesh2015Direction_SfN\" class=\"btn btn--light\"><i class=\"fa fa-file-text-o fa-lg\" aria-hidden=\"true\"><\/i>\u2002Link to poster<\/a><\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"research"}},{"@attributes":{"term":"Granger Causality"}},{"@attributes":{"term":"Directed Information"}},{"@attributes":{"term":"Information flow"}},{"@attributes":{"term":"Message"}}],"summary":"Granger causality is an established measure of the \u201ccausal influence\u201d that one statistical process has on another. It has been used extensively in neuroscience to infer statistical causal influences. Recently, however, many works in the neuroscience literature have begun to compare Granger causal influences along forward and reverse links of a feedback network in order to determine the direction of information flow in this network."},{"title":"Link for Python logging","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-1.html","rel":"alternate","type":"text\/html","title":"Link for Python logging"}},"published":"2017-06-14T23:40:45-07:00","updated":"2017-06-14T23:40:45-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-1","content":"<p>Note to self: when you get time, figure out how to do logging, as a general practice: <a href=\"https:\/\/fangpenlin.com\/posts\/2012\/08\/26\/good-logging-practice-in-python\/\">here<\/a> is a nice link to get you started.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"python"}},{"@attributes":{"term":"logging"}}],"summary":"Note to self: when you get time, figure out how to do logging, as a general practice: here is a nice link to get you started."},{"title":"Log Message","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-3.html","rel":"alternate","type":"text\/html","title":"Log Message"}},"published":"2017-06-14T23:40:45-07:00","updated":"2017-06-14T23:40:45-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-3","content":"<p>Note to self: when you get time, figure out how to do logging, as a general practice: <a href=\"https:\/\/fangpenlin.com\/posts\/2012\/08\/26\/good-logging-practice-in-python\/\">here<\/a> is a nice link to get you started.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"python"}},{"@attributes":{"term":"logging"}}],"summary":"Note to self: when you get time, figure out how to do logging, as a general practice: here is a nice link to get you started."},{"title":"Debugging python deadlocks","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-2.html","rel":"alternate","type":"text\/html","title":"Debugging python deadlocks"}},"published":"2017-06-14T23:38:01-07:00","updated":"2017-06-14T23:38:01-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/14\/log-message-2","content":"<p>Sometimes, a python script just gives up and hangs. Even Ctrl-C does not exit the program. You do not have to have a loop with a catch-all <code class=\"language-plaintext highlighter-rouge\">except<\/code> command or anything. Apparently, this can happen because of what is known as a \u201cdeadlock\u201d, which refers to some kind of race condition when running a threaded program. I was not running a threaded program, except I <em>was<\/em>, because I was using BLAS. In this case, OpenBLAS, which appears to have had a history with deadlocks, and maybe still does, or maybe it was due to my having accidentally installed numpy with MKL and scipy with OpenBLAS. In any event, the only reason I found out that the issue was with blas.py is thanks to <a href=\"https:\/\/pypi.python.org\/pypi\/hanging_threads\/2.0.3\">this excellent little piece of software<\/a>, which shows you a stack trace if your program is inactive for more than 10 seconds. It is a python package called <a href=\"https:\/\/github.com\/niccokunzmann\/hanging_threads\"><code class=\"language-plaintext highlighter-rouge\">hanging_threads<\/code><\/a> and works like a charm. This invaluable tool was found after I finally figured out what to google for, and landed on <a href=\"https:\/\/stackoverflow.com\/q\/3443607\/525169\">this SO page<\/a>, and then scrolled down a lot after the top answer (<code class=\"language-plaintext highlighter-rouge\">trace<\/code>) did not work for me. <a href=\"https:\/\/docs.python.org\/3.4\/library\/trace.html\"><code class=\"language-plaintext highlighter-rouge\">trace<\/code><\/a> is a python module and is also really useful. It prints out the commands currently being executed. This is really neat because if your program suddenly (and hopefully deterministically) gives up, you get a full history of all the commands executed. The <code class=\"language-plaintext highlighter-rouge\">--ignore-dir<\/code> flag is extremely useful, since you can avoid printing out various internal modules. I was lucky, since my packages of interest (<code class=\"language-plaintext highlighter-rouge\">sht<\/code>, <code class=\"language-plaintext highlighter-rouge\">cross_validation<\/code>, etc.) were under <code class=\"language-plaintext highlighter-rouge\">$HOME\/.local<\/code>, so I could just supply <code class=\"language-plaintext highlighter-rouge\">--ignore-dir=\/usr<\/code> and prevent tracing through imports like <code class=\"language-plaintext highlighter-rouge\">sys<\/code> and <code class=\"language-plaintext highlighter-rouge\">numpy<\/code>.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"python"}},{"@attributes":{"term":"deadlock"}},{"@attributes":{"term":"hanging"}},{"@attributes":{"term":"stuck"}},{"@attributes":{"term":"trace"}}],"summary":"Sometimes, a python script just gives up and hangs. Even Ctrl-C does not exit the program. You do not have to have a loop with a catch-all except command or anything. Apparently, this can happen because of what is known as a \u201cdeadlock\u201d, which refers to some kind of race condition when running a threaded program. I was not running a threaded program, except I was, because I was using BLAS. In this case, OpenBLAS, which appears to have had a history with deadlocks, and maybe still does, or maybe it was due to my having accidentally installed numpy with MKL and scipy with OpenBLAS. In any event, the only reason I found out that the issue was with blas.py is thanks to this excellent little piece of software, which shows you a stack trace if your program is inactive for more than 10 seconds. It is a python package called hanging_threads and works like a charm. This invaluable tool was found after I finally figured out what to google for, and landed on this SO page, and then scrolled down a lot after the top answer (trace) did not work for me. trace is a python module and is also really useful. It prints out the commands currently being executed. This is really neat because if your program suddenly (and hopefully deterministically) gives up, you get a full history of all the commands executed. The --ignore-dir flag is extremely useful, since you can avoid printing out various internal modules. I was lucky, since my packages of interest (sht, cross_validation, etc.) were under $HOME\/.local, so I could just supply --ignore-dir=\/usr and prevent tracing through imports like sys and numpy."},{"title":"Visualizing the output of python\u2019s cprofile","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/13\/log-message-1.html","rel":"alternate","type":"text\/html","title":"Visualizing the output of python\u2019s cprofile"}},"published":"2017-06-13T01:21:16-07:00","updated":"2017-06-13T01:21:16-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2017\/06\/13\/log-message-1","content":"<p>To better visualize the call tree after profiling a python script, first save your output from cProfile using <code class=\"language-plaintext highlighter-rouge\">python -m cProfile -o &lt;myscript.profile&gt; &lt;myscript.py&gt;<\/code>. You will need to install <a href=\"https:\/\/pypi.python.org\/pypi\/pyprof2calltree\/\"><code class=\"language-plaintext highlighter-rouge\">pyprof2calltree<\/code><\/a> via pip and <code class=\"language-plaintext highlighter-rouge\">kcachegrind<\/code> via apt. Then, visualize the profile data with <code class=\"language-plaintext highlighter-rouge\">pyprof2calltree -i &lt;myscript.profile&gt; -k<\/code>. Reference: <a href=\"https:\/\/stackoverflow.com\/a\/3561512\/525169\">this<\/a> SO answer.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"python"}},{"@attributes":{"term":"profiling"}},{"@attributes":{"term":"visualization"}},{"@attributes":{"term":"kcachegrind"}}],"summary":"To better visualize the call tree after profiling a python script, first save your output from cProfile using python -m cProfile -o &lt;myscript.profile&gt; &lt;myscript.py&gt;. You will need to install pyprof2calltree via pip and kcachegrind via apt. Then, visualize the profile data with pyprof2calltree -i &lt;myscript.profile&gt; -k. Reference: this SO answer."},{"title":"Export syntax-highlighted pdf files from vim","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2016\/09\/13\/log-message.html","rel":"alternate","type":"text\/html","title":"Export syntax-highlighted pdf files from vim"}},"published":"2016-09-13T11:07:40-07:00","updated":"2016-09-13T11:07:40-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2016\/09\/13\/log-message","content":"<p>If you want to export from vim to a pdf file with syntax highlighting, hardcopy does not seem to use the correct syntax highlighting file. Or rather, it uses GUI settings, which means that unless your syntax highlighting file takes care of looking good on gvim, it will not give you a good result. For you to get syntax highlighting <em>at all<\/em>, you must first <code class=\"language-plaintext highlighter-rouge\">:set term=xterm-256color-italic<\/code> even if it is already set. Do it even if <code class=\"language-plaintext highlighter-rouge\">:set term<\/code> returns <code class=\"language-plaintext highlighter-rouge\">xterm-256color-italic<\/code>. Then, to actually get <em>terminal colours<\/em>, use <code class=\"language-plaintext highlighter-rouge\">:TOhtml<\/code>, which converts the file into an html page, which you can then print from your browser. For a good print colorscheme, run <code class=\"language-plaintext highlighter-rouge\">:colorscheme print<\/code>, which is is a custom light-background colorscheme I made for printing. Do this before running <code class=\"language-plaintext highlighter-rouge\">:TOhtml<\/code>, obviously.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"vim"}},{"@attributes":{"term":"print"}},{"@attributes":{"term":"hardcopy"}},{"@attributes":{"term":"syntax-highlighting"}},{"@attributes":{"term":"colorscheme"}}],"summary":"If you want to export from vim to a pdf file with syntax highlighting, hardcopy does not seem to use the correct syntax highlighting file. Or rather, it uses GUI settings, which means that unless your syntax highlighting file takes care of looking good on gvim, it will not give you a good result. For you to get syntax highlighting at all, you must first :set term=xterm-256color-italic even if it is already set. Do it even if :set term returns xterm-256color-italic. Then, to actually get terminal colours, use :TOhtml, which converts the file into an html page, which you can then print from your browser. For a good print colorscheme, run :colorscheme print, which is is a custom light-background colorscheme I made for printing. Do this before running :TOhtml, obviously."},{"title":"Making vim display italicised text","link":{"@attributes":{"href":"https:\/\/praveenv253.github.io\/logs\/2016\/09\/12\/log-message.html","rel":"alternate","type":"text\/html","title":"Making vim display italicised text"}},"published":"2016-09-12T15:23:07-07:00","updated":"2016-09-12T15:23:07-07:00","id":"https:\/\/praveenv253.github.io\/logs\/2016\/09\/12\/log-message","content":"<p>To make vim display italicised text, see <a href=\"http:\/\/www.nerdyweekly.com\/posts\/enable-italic-text-vim-tmux-gnome-terminal\/\">this<\/a> wonderful blog entry. Essentially, we need to manually map the escape sequences to the keywords <code class=\"language-plaintext highlighter-rouge\">sitm<\/code> and <code class=\"language-plaintext highlighter-rouge\">ritm<\/code>, which are used by vim to set and remove italic mode respectively. The file in question, <code class=\"language-plaintext highlighter-rouge\">xterm-256color-italic.terminfo<\/code>, has been added to the <code class=\"language-plaintext highlighter-rouge\">misc<\/code> repository as well. It contains all relevant install info. Note that <code class=\"language-plaintext highlighter-rouge\">TERM<\/code> must be set to <code class=\"language-plaintext highlighter-rouge\">xterm-256color-italic<\/code> by <code class=\"language-plaintext highlighter-rouge\">gnome-terminal<\/code> for this to take effect. <a href=\"http:\/\/askubuntu.com\/questions\/233280\/gnome-terminal-reports-term-to-be-xterm\">This<\/a> askubuntu question tells you how to do it. Set the command executed by <code class=\"language-plaintext highlighter-rouge\">gnome-terminal<\/code> to be <code class=\"language-plaintext highlighter-rouge\">env TERM=xterm-256color-italic \/bin\/bash<\/code>.<\/p>","author":{"name":"Praveen Venkatesh"},"category":[{"@attributes":{"term":"logs"}},{"@attributes":{"term":"log message"}},{"@attributes":{"term":"vim"}},{"@attributes":{"term":"italics"}},{"@attributes":{"term":"comments"}}],"summary":"To make vim display italicised text, see this wonderful blog entry. Essentially, we need to manually map the escape sequences to the keywords sitm and ritm, which are used by vim to set and remove italic mode respectively. The file in question, xterm-256color-italic.terminfo, has been added to the misc repository as well. It contains all relevant install info. Note that TERM must be set to xterm-256color-italic by gnome-terminal for this to take effect. This askubuntu question tells you how to do it. Set the command executed by gnome-terminal to be env TERM=xterm-256color-italic \/bin\/bash."}]}