Guillaume Munch | 5 Aug 03:18 2015
Picon

-std=c++11 and [PATCH] Improve the display of the source (bugs #6501,#7359)

Hello,

Here is a patch that I would like to discuss. It brings some 
improvements to the source view panel and it fixes 
<http://www.lyx.org/trac/ticket/6501> (Cursor in "LaTeX Source" pane 
does not follow cursor in Editor window).

I use a unique_ptr because it was the best way to do. Because of this, 
the patch has to be compiled with CXXFLAGS="-std=c++11". Fortunately it 
was easy to fix the LyX source to have a compilation with c++11.

Is there a reason for not using c++11? I don't mind rewriting the patch 
in such a way that it works in the current environment. Just tell me 
what you prefer instead. (auto_ptr is too limited here and I don't want 
to put a raw pointer in the interface. shared_ptr would certainly work 
but on the other hand I don't see why we would forbid ourselves from 
using c++11 features.) Anyway it would be good to fix the source code 
for c++11 compilation even if we don't make c++11 mandatory.

As for the improvements themselves, please have a look at the 
description of the patch below if you would like to test the new 
features. Note that the patch is independant of my earlier patch adding 
QTimers.

Also is there an expert of TexRow? I am thinking of a further 
improvement along the lines of 
<http://www.lyx.org/trac/ticket/4725#comment:1> (ability to view source 
of only the current selection) which seems quite simple to do at least 
partially.

(Continue reading)

PhilipPirrip | 4 Aug 20:39 2015
Picon

\input <at> path - two slashes, quotation marks

Why does \input <at> path end with two slashes, as in
/home/user/directory//
and why is its output
"/home/user/dir ectory/"/
(note quotation marks, and two separate ending slashes) when the folder 
name contains spaces?

aparsloe | 5 Aug 07:40 2015
Picon

\jobname again

Around six weeks ago I enquired about making the document-wide \jobname available to preview insets. This is difficult, presumably because previews are needed before LyX invokes latex for whole-document compilation. At present in a preview inset \jobname gives the name of the preview, which is of little interest or use. Enrico offered a way around this by using info-insets, but it meant manually including the info-inset in each preview inset, rather than something that worked 'out of the box'.

Some further experimenting provides a step forward. If a one-line text file containing the job name is created with a fixed name, like jobname.txt,  and placed either in the document directory or the temporary directory for that LyX document, then it is perfectly possible to write tex code so that each preview inset that needs the job name can read this file and thus learn of (the document-wide) \jobname. Data generated by the preview can then be saved to a file using this name as a basis. 

Placing jobname.txt in the document directory becomes a problem if there is more than one LyX file in that directory. Hence placing it in the temporary directory for the document seems the better suggestion. How difficult would it be when the temporary buffer for a new or newly opened document is created for LyX to also insert into it the one-line file jobname.txt containing the document name (preferably without file extension)?

I realise there would be some further housekeeping involved on the initial save of a new file, or use of "Save as", but this doesn't seem burdensome. Making the job name available in a document's temporary directory like this would fill a hole that currently exists in the preview mechanism. Once preview is used for more onerous tasks than simply displaying characters on screen, the ability to save data from a preview inset becomes a natural consideration and the use of the document-wide job name desirable.

Andrew


This email has been checked for viruses by Avast antivirus software.
www.avast.com


Liviu Andronic | 3 Aug 11:49 2015
Picon

How to Require a package with options in module?

Dear all,
I'm working on a module that needs to load a package with options.
What I currently do is:
Preamble
    \usepackage[usenames,dvipsnames]{xcolor}
EndPreamble

But the above is I suspect not recommended. I can see how I can
require the xcolor package via:
    Requires                xcolor

But how can I make sure that it is loaded with the
[usenames,dvipsnames] options? I've scoured the docs but only got
lost.

Thank you and regards,
Liviu

--

-- 
Do you think you know what math is?
http://www.ideasroadshow.com/issues/ian-stewart-2013-08-02
Or what it means to be intelligent?
http://www.ideasroadshow.com/issues/john-duncan-2013-08-30
Think again:
http://www.ideasroadshow.com/library

Guillaume Munch | 1 Aug 12:34 2015
Picon

[PATCH] minor improvements to mathed

Here are again two very small patches if you agree.

1. Add \ensuremath to the list of math completions.
2. math-mode inserts \text instead of \mbox when already in math mode.

For the latter, \mbox is meant as a way to switch to text mode, but 
\text from amstext is more appropriate for this purpose. This forces 
amstext to be automatically included, but we already include 
automatically amstext for \textrm, \textit, etc. even though it's not 
required.

Also, a bug: I noticed that the "Insert regular expression" menu is 
always visible in master (+qt5) even though it's only useful for 
Advanced search (afaik). Is this on purpose?

Guillaume
Scott Kostyshak | 1 Aug 00:38 2015

Re: Tutorial first step - creating PDF

Hi Brian,

As Richard asked above, please always respond to the list.

On Fri, Jul 31, 2015 at 6:27 PM, Brian Bulger <brianbulger <at> gmail.com> wrote:
> I've never heard of it but will try it and write back.  Do you have any
> comments on Ghostscript?

I don't.

Best,

Scott

Scott Kostyshak | 31 Jul 23:21 2015

Re: Tutorial first step - creating PDF

On Fri, Jul 31, 2015 at 4:07 PM, Brian Bulger <brianbulger <at> gmail.com> wrote:
> Exporting works fine.  LyX creates the pdf file and I can open it in
> Acrobat.  For some reason the preview doesn't work properly.
>
> Thanks.
>
> On Fri, Jul 31, 2015 at 1:00 PM, Richard Heck <rgheck <at> lyx.org> wrote:
>>
>> On 07/31/2015 01:15 PM, Brian Bulger wrote:
>>
>>
>> On Fri, Jul 31, 2015 at 8:59 AM, Richard Heck <rgheck <at> lyx.org> wrote:
>>>
>>> On 07/30/2015 06:22 PM, Brian Bulger wrote:
>>>>
>>>> Problem description located at the bottom.
>>>>
>>>> Version of LyX: 2.1.3
>>>> System: Windows 7
>>>> Other software: Acrobat version 2015.008.20082
>>>> I don't know what is meant by listing libraries installed on the system.
>>>>
>>>> I followed the beginning instructions to the Tutorial to create my first
>>>> LyX document.  I did everything it says trying each of the CTRL+R options
>>>> (the toolbar button, the menu option and the shortcut keys).  None of them
>>>> work properly; Acrobat opens but does nothing visible and I find no files
>>>> named newfile1.* other than my LyK document, newfile1.lyk.
>>>>
>>>> Any assitance would be appreciated.
>>>
>>>
>>> Please open the messages pane (View> Messages Pane) and then try
>>> previewing using whatever method you like. Copy and paste the output from
>>> the messages pane into a reply to this message.
>>>
>>> Maybe it's best to try previewing the Tutorial itself. Then we know we
>>> have a valid document.
>>>
>>> Richard
>>>
>>
>> 12:13:42.139: Previewing ...
>>
>> 12:13:42.167: (buffer-view: Ctrl+R)
>>
>> 12:13:42.206: pdflatex "newfile1.tex"
>>
>> 12:13:42.833: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)
>>
>> 12:13:42.834: entering extended mode
>>
>> 12:13:42.836:
>>
>> 12:13:42.837:
>> (C:\Users\BCBulger\AppData\Local\temp\lyx_tmpdir.ycBAmSDyv608\lyx_tmpbuf0\newfi
>>
>> 12:13:42.838: le1.tex
>>
>> 12:13:42.840: LaTeX2e <2011/06/27>
>>
>> 12:13:42.842: Babel <v3.8m> and hyphenation patterns for english,
>> afrikaans, ancientgreek, ar
>>
>> 12:13:42.844: abic, armenian, assamese, basque, bengali, bokmal,
>> bulgarian, catalan, coptic,
>>
>> 12:13:42.846: croatian, czech, danish, dutch, esperanto, estonian, farsi,
>> finnish, french, ga
>>
>> 12:13:42.849: lician, german, german-x-2013-05-26, greek, gujarati, hindi,
>> hungarian, iceland
>>
>> 12:13:42.851: ic, indonesian, interlingua, irish, italian, kannada,
>> kurmanji, latin, latvian,
>>
>> 12:13:42.853: lithuanian, malayalam, marathi, mongolian, mongolianlmc,
>> monogreek, ngerman, n
>>
>> 12:13:42.855: german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin,
>> polish, portuguese, roman
>>
>> 12:13:42.857: ian, russian, sanskrit, serbian, slovak, slovenian, spanish,
>> swedish, swissgerm
>>
>> 12:13:42.859: an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian,
>> uppersorbian, usengl
>>
>> 12:13:42.861: ishmax, welsh, loaded.
>>
>> 12:13:42.863:
>>
>> 12:13:42.944: pdfview "newfile1.pdf"
>>
>>
>> This all looks correct, though I'm not sure about the last line. That
>> doesn't look like a Windows command. So it appears to me as if the problem
>> is with how Acrobat is being called.
>>
>> Please try exporting instead of previewing: File> Export> PDF (pdflatex).
>> This should create the file newfile1.pdf in the same directory as
>> newfile1.lyx. See if you can view it. If so, that will confirm that Acrobat
>> is the issue.
>>
>> Richard
>>
>> PS Please reply to the list. I'm not on Windows and so may run out of
>> ideas.

Hi Brian,

Does sumatraPDF work for you? Many Windows users prefer to use that
with LyX over Acrobat.

Scott

Richard Heck | 31 Jul 20:00 2015

Re: Tutorial first step - creating PDF

On 07/31/2015 01:15 PM, Brian Bulger wrote:

On Fri, Jul 31, 2015 at 8:59 AM, Richard Heck <rgheck <at> lyx.org> wrote:
On 07/30/2015 06:22 PM, Brian Bulger wrote:
Problem description located at the bottom.

Version of LyX: 2.1.3
System: Windows 7
Other software: Acrobat version 2015.008.20082
I don't know what is meant by listing libraries installed on the system.

I followed the beginning instructions to the Tutorial to create my first LyX document.  I did everything it says trying each of the CTRL+R options (the toolbar button, the menu option and the shortcut keys).  None of them work properly; Acrobat opens but does nothing visible and I find no files named newfile1.* other than my LyK document, newfile1.lyk.

Any assitance would be appreciated.

Please open the messages pane (View> Messages Pane) and then try previewing using whatever method you like. Copy and paste the output from the messages pane into a reply to this message.

Maybe it's best to try previewing the Tutorial itself. Then we know we have a valid document.

Richard


12:13:42.139: Previewing ...

12:13:42.167: (buffer-view: Ctrl+R)

12:13:42.206: pdflatex "newfile1.tex"

12:13:42.833: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9)

12:13:42.834: entering extended mode

12:13:42.836:

12:13:42.837: (C:\Users\BCBulger\AppData\Local\temp\lyx_tmpdir.ycBAmSDyv608\lyx_tmpbuf0\newfi

12:13:42.838: le1.tex

12:13:42.840: LaTeX2e <2011/06/27>

12:13:42.842: Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar

12:13:42.844: abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,

12:13:42.846: croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga

12:13:42.849: lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland

12:13:42.851: ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,

12:13:42.853: lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n

12:13:42.855: german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman

12:13:42.857: ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm

12:13:42.859: an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl

12:13:42.861: ishmax, welsh, loaded.

12:13:42.863:

12:13:42.944: pdfview "newfile1.pdf"


This all looks correct, though I'm not sure about the last line. That doesn't look like a Windows command. So it appears to me as if the problem is with how Acrobat is being called.

Please try exporting instead of previewing: File> Export> PDF (pdflatex). This should create the file newfile1.pdf in the same directory as newfile1.lyx. See if you can view it. If so, that will confirm that Acrobat is the issue.

Richard

PS Please reply to the list. I'm not on Windows and so may run out of ideas.

Guillaume Munch | 31 Jul 18:12 2015
Picon

[PATCH] Improve the performance of the source panel by using a QTimer (bug #9493)

Improve the performance of the source panel by using a QTimer. Solves 
<http://www.lyx.org/trac/ticket/9493>. Please criticise.
Guillaume Munch | 31 Jul 18:05 2015
Picon

[PATCH] \{ and \% now correctly use the selection as their argument instead of erasing it (bug #6466)

\{ and \% now correctly use the selection as their argument instead of 
erasing it. Solves <http://www.lyx.org/trac/ticket/6466>. Please criticise.

Also I noticed that LyX produces invalid LaTeX code if one nests braces 
and comments, e.g. by typing \{\%\{\% ... but this behaviour is already 
there before the patch.
Scott Kostyshak | 31 Jul 04:47 2015

Use tilde for 'math-insert \tilde' binding?

Attached is a patch. I am hesitant to make a change since it has been
bound to & for so long. It appears that the original binding was
tilde, but in 584ea928 André changed it to ampersand. Was this
intentional? If so does anyone know why?

Scott

Gmane