Re: Sorting tables in LyX
On Wed, Nov 28, 2012 at 3:18 AM, Andrew Parsloe wrote: > I've used the same trick (exporting to an alternatively named LyX format, > but retaining the lyx file extension) for a number of other tasks (e.g. > sorting lists, expanding abbreviations) > Quick question: Would it be a good idea to turn Track Changes on before launching the script and modifying "built-in" the .lyx file? This way the user can check that nothing funny happened to her file (the parts that shouldn't have been modified), and visually check the changes that happened to the parts that should have been modified. Liviu
Re: Sorting tables in LyX
On 28/11/2012 1:13 p.m., Scott Kostyshak wrote: On Tue, Sep 18, 2012 at 7:01 PM, Andrew Parsloe wrote: I've attached a python script, tablesort.py, a module tablesort.module containing a custom inset (suggested by Liviu Andronic), and an explanatory document, SortingTablesInLyX.lyx detailing what goes where and how to use it. In this third incarnation of the script, by using the custom inset, adding three buttons to the table toolbar, and changing the Overwrite on export setting, it is possible to sort the rows of tables in LyX in a manner that avoids all nag/query/prompt messages and feels "built-in". Sorts may be alphabetical or numerical, ascending or descending. The default horizontal & vertical rules delineating table cells are not disturbed by the sort. ERT in table cells has no effect. Yellow (or other) notes by default also do not affect the sort, but this can be changed with the -y option when invoking the script, allowing fine-tuning of sort order. Finally, multiple tables in the same document can be sorted at one go. Andrew Thank you for this, Andrew. This work is very creative. I'm especially impressed by your excellent documentation. Is this on the wiki somewhere? Scott Thanks for the comments Scott. It's on the Wiki at http://wiki.lyx.org/Examples/SortingTablesInLyX ("Examples" seems to be something of a catch-all) which includes a link to the MARC archive where the files are: http://marc.info/?l=lyx-users&m=134800934727097&w=2 I've used the same trick (exporting to an alternatively named LyX format, but retaining the lyx file extension) for a number of other tasks (e.g. sorting lists, expanding abbreviations) and tried to sell the idea of a proper GUI for launching such scripts to the developers recently (see http://marc.info/?l=lyx-devel&m=135273675419027&w=2). Andrew
Re: Sorting tables in LyX
On Tue, Sep 18, 2012 at 7:01 PM, Andrew Parsloe wrote: > I've attached a python script, tablesort.py, a module tablesort.module > containing a custom inset (suggested by Liviu Andronic), and an explanatory > document, SortingTablesInLyX.lyx detailing what goes where and how to use > it. In this third incarnation of the script, by using the custom inset, > adding three buttons to the table toolbar, and changing the Overwrite on > export setting, it is possible to sort the rows of tables in LyX in a manner > that avoids all nag/query/prompt messages and feels "built-in". Sorts may be > alphabetical or numerical, ascending or descending. The default horizontal & > vertical rules delineating table cells are not disturbed by the sort. ERT in > table cells has no effect. Yellow (or other) notes by default also do not > affect the sort, but this can be changed with the -y option when invoking > the script, allowing fine-tuning of sort order. Finally, multiple tables in > the same document can be sorted at one go. > > Andrew > Thank you for this, Andrew. This work is very creative. I'm especially impressed by your excellent documentation. Is this on the wiki somewhere? Scott
Re: Relative path to bib source doesn't work in lyx (but does work when exported as .tex)
On Tue, Nov 27, 2012 at 5:34 PM, Roey Angel wrote: > Hi, > Not sure if it's a bug or I'm missing out on something but when I enter a > bib > source to the preamble it only works when the path to the bib source is > absolute > but doesn't in case I simply write the file name (yes, I double checked > the bib > file is in the same directory). > I don't get an error but simply a PDF with the reference fields > unrecognised (so > it's got to be that lyx can't find the bib file). > Since Lyx compiles the tex files in a temp directory, I doubt a relative path would ever work. Lyx would have to parse the preamble, extract the path, convert it to an absolute path (or a new path relative to the temp directory), and rewrite the preamble accordingly. In fact, if you add the bibliography with the Lyx inset (i..e using bibtex, not BibLateX) and then check the lyx source, you'll see that Lyx uses the absolute path. > If I export the file to LaTeX and compile it from command line everything > works > fine. > > This is because if you export to Latex and then compile, you are working in your local directory (the directory where your original lyx file is). And Latex (or rather, biber) is therefore able to find the file from the relative path. > my preamble line looks something like > > \usepackage[style=authoryear- >> >> comp, natbib=true, backend=biber]{biblatex} >> \addbibresource{/full/path/to/bib/file.bib} >> >> > This looks fine---as long as /full/path/to/bib/file.bib is really /absolute/path/to/file.bib > So, a bug or a 'feature'? > Feature, p/h? It has a great educational value: it forces you to understand how lyx uses the latex (and biber, texindy, etc) backends ;-) Cheers, Stefano -- __ Stefano Franchi Associate Research Professor Department of Hispanic StudiesPh: +1 (979) 845-2125 Texas A&M University Fax: +1 (979) 845-6421 College Station, Texas, USA stef...@tamu.edu http://stefano.cleinias.org
Relative path to bib source doesn't work in lyx (but does work when exported as .tex)
Hi, Not sure if it's a bug or I'm missing out on something but when I enter a bib source to the preamble it only works when the path to the bib source is absolute but doesn't in case I simply write the file name (yes, I double checked the bib file is in the same directory). I don't get an error but simply a PDF with the reference fields unrecognised (so it's got to be that lyx can't find the bib file). If I export the file to LaTeX and compile it from command line everything works fine. my preamble line looks something like \usepackage[style=authoryear-comp, natbib=true, backend=biber]{biblatex} \addbibresource{/full/path/to/bib/file.bib} So, a bug or a 'feature'? Roey using Lyx 2.05 and kubuntu 12.10 but i got the same problem on lyx2.1(dev)
Trouble with track changes appearing in pdflatex views
My problem is that if I want to show tracked changes in PDF view or output I get these errors: Package xcolor Error: Undefined color `LYXDELETED'. Package xcolor Error: Undefined color `LYXADDED'. ... +++ after a modest finite extent of the document is processed. If I delete changed and unchanged text from the document such that the document is small enough, then PDF output with tracked changes works. This is true whether I use Lyx PDF viewing, or run OS' pdflatex compiler on exported .tex file. If I disable 'show changes in output', then PDF output occurs without errors. Can anyone help me resolve this problem? I did some general Google and LyX wiki searching, but nothing popped up. - MY SET UP CONTEXT: I have Lyx 2.0.5 on a Suse 11.1 box. and: pdflatex -v pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 Header of .log file: This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=latex 2009.1.23) 27 NOV 2012 12:44 entering extended mode Header of .tex file: %% LyX 2.0.5 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[times]{nagauth} \usepackage[T1]{fontenc} \usepackage{xcolor} \usepackage{pdfcolmk} \usepackage{bm} \usepackage{amstext} \usepackage{graphicx} \PassOptionsToPackage{normalem}{ulem} \usepackage{ulem} \usepackage[unicode=true, bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1, breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false] {hyperref} \hypersetup{ colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red} \makeatletter %% LyX specific LaTeX commands. \providecolor{lyxadded}{rgb}{0,0,1} \providecolor{lyxdeleted}{rgb}{1,0,0} %% Change tracking with ulem \newcommand{\lyxadded}[3]{{\texorpdfstring{\color{lyxadded}{}}{}#3}} \newcommand{\lyxdeleted}[3]{{\texorpdfstring{\color{lyxdeleted}\sout{#3}}{}}} %% User specified LaTeX commands. % nagdoc.tex V2.0, 13 May 2010 %\documentclass[times,doublespace]{nagauth}%For paper submission \usepackage{moreverb} \usepackage{bm} \newcommand{\BibTeX}{{\rmfamily B\kern-.05em \textsc{i\kern-.025em b}% \kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \def\volumeyear{2012} Thanks for any help, Allen Address: Allen Wilkinson (cell) (216) 548-2349 1286 Yellowstone Road Cleveland Heights, OH 44121 USA (INTERNET) aw(at)chaff(dot)biz +++
Re: Input an Sweave/knitr chunk via command sequence
Thanks, I'll keep that in mind. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Tue, Nov 27, 2012 at 12:21 PM, Scott Kostyshak wrote: > On Tue, Nov 27, 2012 at 12:44 PM, Yihui Xie wrote: >> This is a solution instead of a question. Over a long I have been >> wondering how to input an Sweave chunk template in LyX, i.e. <<>>= and >> @. I just figured it out thanks to the hint from Liviu. We can add a >> shortcut (Preferences=>Editing=>Shortcuts) with this command sequence >> (be sure _not_ to include the possible line breaks introduced by >> Gmail): >> >> command-sequence ert-insert; unicode-insert 0x3C; unicode-insert >> 0x3C; unicode-insert 0x3E; unicode-insert 0x3E; unicode-insert 0x3D; >> break-paragraph; break-paragraph; unicode-insert 0x40; up; > > Thanks, Liviu and Yihui. This is indeed handy. Note that in master (to > become 2.1), "break-paragraph" is renamed to "paragraph-break". > > In master branch, the following works: > > command-sequence ert-insert; unicode-insert 0x3C; unicode-insert > 0x3C; unicode-insert 0x3E; unicode-insert 0x3E; unicode-insert 0x3D; > paragraph-break; paragraph-break; unicode-insert 0x40; up; > > The former LFUN was discordant with the LFUN naming rules, in > particular <<1) Use the object.event order. That is, use > `word-forward' instead of `forward-word'>> > > Scott
Re: Input an Sweave/knitr chunk via command sequence
On Tue, Nov 27, 2012 at 12:44 PM, Yihui Xie wrote: > This is a solution instead of a question. Over a long I have been > wondering how to input an Sweave chunk template in LyX, i.e. <<>>= and > @. I just figured it out thanks to the hint from Liviu. We can add a > shortcut (Preferences=>Editing=>Shortcuts) with this command sequence > (be sure _not_ to include the possible line breaks introduced by > Gmail): > > command-sequence ert-insert; unicode-insert 0x3C; unicode-insert > 0x3C; unicode-insert 0x3E; unicode-insert 0x3E; unicode-insert 0x3D; > break-paragraph; break-paragraph; unicode-insert 0x40; up; Thanks, Liviu and Yihui. This is indeed handy. Note that in master (to become 2.1), "break-paragraph" is renamed to "paragraph-break". In master branch, the following works: command-sequence ert-insert; unicode-insert 0x3C; unicode-insert 0x3C; unicode-insert 0x3E; unicode-insert 0x3E; unicode-insert 0x3D; paragraph-break; paragraph-break; unicode-insert 0x40; up; The former LFUN was discordant with the LFUN naming rules, in particular <<1) Use the object.event order. That is, use `word-forward' instead of `forward-word'>> Scott
Input an Sweave/knitr chunk via command sequence
This is a solution instead of a question. Over a long I have been wondering how to input an Sweave chunk template in LyX, i.e. <<>>= and @. I just figured it out thanks to the hint from Liviu. We can add a shortcut (Preferences=>Editing=>Shortcuts) with this command sequence (be sure _not_ to include the possible line breaks introduced by Gmail): command-sequence ert-insert; unicode-insert 0x3C; unicode-insert 0x3C; unicode-insert 0x3E; unicode-insert 0x3E; unicode-insert 0x3D; break-paragraph; break-paragraph; unicode-insert 0x40; up; We can assign it to, say, Ctrl+Alt+I (the same shortcut as RStudio). Then we will be able to input this quickly: <<>>= # cursor moved here automatically @ Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA
Re: Getting rid of "You cannot type two spaces this way" message?
8¬ | drawn upon them by White, payable to Clifford ;) then those of the > plaintiffs to the Is this the first reference to a smiley or what? Thx Alan! - Julio Rojas jcredbe...@gmail.com On Tue, Nov 27, 2012 at 12:53 AM, Alan L Tyree wrote: > On 26/11/12 23:14, Julio Rojas wrote: > > Alternatively, you might consider sponsoring a LyX developer to find and >> implement a solution that is acceptable to all. (Maybe a "hidden" switch >> to >> turn off the message that is described in the manual - so that a user that >> has read the manual also know how to avoid the message reappearing...) >> The lyx web page will tell how to sponsor a feature. > > > Here, here Günther. I believe this is the "right" solution. A simple > "switch", that I think, would appeal to everybody. > > On the other hand, and to keep the "soft flaming" going on (we still > have time to burn!), I refer all of you to this post: > http://www.heracliteanriver.com/?p=324 > > Regards. > > - > Julio Rojas > jcredbe...@gmail.com > > > You can see examples of this (extra spaces) in old law reports. I don't > know exactly when these were printed, but it was a long time ago. Here is > an example: > > http://www.commonlii.org/uk/cases/EngR/1765/40.html > > (To help burn up some of that excess time!) > > Cheers, > Alan > > > > > On Mon, Nov 26, 2012 at 10:11 AM, Guenter Milde wrote: > >> On 2012-11-24, Liviu Andronic wrote: >> > On Sat, Nov 24, 2012 at 11:17 AM, Trevor Jenkins >> wrote: >> >> >>> If the message itself is what bothers you, then try not to look at >> it. >> >>> With time you'll get used to ignoring it completely. >> >> To me (old time LaTeX/LyX user that has, of course, read the manual) the >> message is still "visual noise". It interferes with relevant information >> in the status line. >> >> > Then use fullscreen mode. >> >> Then I won't see the important messages (key-codes, lyxfuns, ...) in the >> status line. >> >> >> On the other hand, I don't think is is >> >> >> to no good purpose >> ... >> >> The purpose (preventing spurious bug reports that take up our time) is >> good. Maybe the means is not optimal (as it also leads to never-ending >> discussions). >> >> ... >> >> > But if this issue is such a deal breaker, then feel free to switch to >> > Scientific WorkPlace. It may cost you 1000$ or so, but you'll likely >> > be able type two spaces as you wish to. (Disclaimer: Before buying >> > that, check with the vendor that it indeed allows that.) >> >> Alternatively, you might consider sponsoring a LyX developer to find and >> implement a solution that is acceptable to all. (Maybe a "hidden" switch >> to >> turn off the message that is described in the manual - so that a user that >> has read the manual also know how to avoid the message reappearing...) >> The lyx web page will tell how to sponsor a feature. >> >> Günter >> >> > > > -- > Alan L Tyreehttp://www2.austlii.edu.au/~alan > Tel: 04 2748 6206sip:172...@iptel.org > >