Re: PDF graphics is blurred in LyX when scaled

2018-11-16 Thread Baris Erkus
On 16-Nov-18 11:24 AM, list_em...@icloud.com 
wrote:

On Nov 11, 2018, at 12:29 AM, Murat Yildizoglu 
mailto:myi...@gmail.com>> wrote:

I have also observed this in the last version under Osx.

Murat Yildizoglu
Le 11 nov. 2018 à 03:45 +0100, Baris Erkus 
mailto:bariser...@hotmail.com>>, a écrit :

Hello,

PDF graphics appears to be blurred in LyX when scaled from Graphics Options --> 
LaTeX and LyX options --> Show in LyX --> Scale on Screen.

I am not sure if this is a feature to reduce CPU rendering workload or smtg, 
but it would be really nice to have a clear view of the PDF while working on 
the document rather than looking at it using a PDF viewer.

See MWE and the view from LyX below.

Baris




I have only skimmed this thread so apologies if this is off-topic. At least one 
poster mentioned OSX aka OS X aka macOS. The following section in the LyX wiki 
might be useful:

https://wiki.lyx.org/Mac/Mac#toc9

Jerry

Thanks; this was very useful. I juggled around it a bit and this is my 
understanding:

  1.  LyX has a default PDF to PNG converter and associated options. The 
quality of the PNG that comes out of this default converter+options is very low 
and may be the resolution is adjusted to have the same size of the PDF.
  2.  We can define our converter with higher options and improve the quality 
for 100% view, but even for %101 or 99% scaling it goes back to the default 
converter+options and results low quality preview. So, it seems like definitely 
there is a bug here: It does not make sense to have very good quality preview 
at 100% caling and reduced quality at 101% or 99% scaling.
  3.  There is also awkward behavior I observed. Although I set the resolution 
to very high values, the PNG size didnot change on the screen. Normally, 
increasing the resolution should increase the size of the PNG on the screen. 
Maybe something to do with the cache or scaling algorithm in LyX.
  4.  Anyhow, I finally managed to get some nice previews on the screen. The 
problem is that I have to increase the resolution, which increases the view 
size of PNG. So, 100% preview actually shows a PNG image larger than the PDF 
size. Anyhow, it is still useful, since I can scale the preview with LyX 
preview option to put the image to size that I like.
  5.  There were also some awkward behavior when I setup it up so it took about 
an hour to make it work.

The solution is as follows: I defined a new converter from PDF(graphics) to PNG 
with the following ImageMagick converter:

convert -density 200 -trim -quality 100 -sharpen 0x1.0 $$i $$o

See the attached figure for output. I am not sure if ImageMAgick comes with 
LyX, but it is available in all OSs, so should not be a problem to get and use 
it.

I think there is a bug-like behaviour with preview scaling of LyX, so maybe I 
should convert the ticket to bug.

[cid:part4.3D8942FE.986C0A04@hotmail.com]

Baris

FYI: Email client Thunderbird makes you send replies bottom-post automatically. 
Top-post lovers may want to give a try to it. I am using Thunderbird only for 
LyX mailing list, so you do not need to use it as you main e-mail client. I 
also added the following signature to promote bottom post... :-)

--
↓↓
Please bottom-post. Start your reply here:


Re: Formula in Section title

2018-11-16 Thread Guenter Milde
On 2018-11-07, Patrick Dupre wrote:




>> On 2018-11-07 07:21, Patrick Dupre wrote:
>> > Hello,
>> > 
>> > I used to use small formula in section or sub-section title.
>> > Unfortunately, if latex manage the font of the Titles (by typically
>> > using a bold font) for the regular text, it just use the "standard"
>> > font for the formula.
>> > The transition from bold to regular is just ugly. Is there a way to
>> > coordinate the fonts?
>> > 
>> > Thank.

>> Hi,

>> Just to be sure: So just using \boldsymbol manually for formulas in the 
>> title and headings does not work for you, right? You want it to switch 
>> automatically whenever the surrounding text is bold?

>> Daniel

> Yes, I could edit each formula of the section title, but I would like to find
> an automatic way to have these formula, let say in \boldsymbol.
> Actually, my formula are already in \rm (Chemistry formula for example).
> They cannot be switched in \boldsymbol, but probably in \mathbf

The LaTeX tool for adapting a math formula to bold text style is switching to
the math version "bold" *before* the formula.
http://ctan.math.washington.edu/tex-archive/macros/latex2e/contrib/isomath/isomath.html#math-font-selection

The switch is valid until another \mathversion command or the end of the
current group (e.g. a section command argument):

\documentclass[]{article}
\begin{document}

\section{$\mathrm{H_20}$ \mathversion{bold} $\mathrm{H_20}$}

back to normal math version $\mathrm{H_20}$
switch to bold math version \mathversion{bold} 
test $\mathrm{H_20}$

\end{document}

Some symbols don't exist in a bold version, so it may become a strange mix
of bold and normal characters, though.


There are packages that allow to define a default command for each section,
so you can automate the math version switch. If you are using the
KOMA-Script document classes, see their documentation for details.

Hope this helps,

Günter



Re: PDF graphics is blurred in LyX when scaled

2018-11-16 Thread Murat Yildizoglu
Thank you Jerry,
It seems that I have already followed this advice some years ago because my 
PDF->PNG converter already contains:

sips --resampleWidth 800 --setProperty format png $$i --out $$o

Maybe 800 is too big, and I have a tendency to ask to LyX to reduce the size of 
the generated bitmaps on the screen. That could give a less crisp image. I will 
change this width and test.


> Le 16 nov. 2018 à 09:24, list_em...@icloud.com a écrit :
> 
> 
>> On Nov 11, 2018, at 12:29 AM, Murat Yildizoglu > > wrote:
>> 
>> I have also observed this in the last version under Osx.
>> 
>> Murat Yildizoglu
>> Le 11 nov. 2018 à 03:45 +0100, Baris Erkus > >, a écrit :
>>> Hello,
>>> 
>>> PDF graphics appears to be blurred in LyX when scaled from Graphics Options 
>>> --> LaTeX and LyX options --> Show in LyX --> Scale on Screen.
>>> 
>>> I am not sure if this is a feature to reduce CPU rendering workload or 
>>> smtg, but it would be really nice to have a clear view of the PDF while 
>>> working on the document rather than looking at it using a PDF viewer.
>>> 
>>> See MWE and the view from LyX below.
>>> 
>>> Baris
>>> 
>>> 
>>> 
>>> 
>>> 
> I have only skimmed this thread so apologies if this is off-topic. At least 
> one poster mentioned OSX aka OS X aka macOS. The following section in the LyX 
> wiki might be useful:
> 
> https://wiki.lyx.org/Mac/Mac#toc9 
> 
> Jerry

--
Prof. Murat Yildizoglu

Université de Bordeaux 
GREThA (UMR CNRS 5113)
Avenue Léon Duguit
33608 Pessac cedex
France

murat.yildizo...@u-bordeaux.fr

http://yildizoglu.fr

http://www.twitter.com/yildizoglu





TeX comments in preamble (was: Biblatex in LyX 2.3 and newer)

2018-11-16 Thread Guenter Milde
On 2018-11-10, jezZiFeR wrote:

> Also the lines:
> \urlstyle{%}
> \usepackage{%}
> \begin{%}

> caused some errors – do I really have to remove all of them? Is there
> is one obvious reason for this?

In TeX (and the LyX-user-preamble), a % starts a comment that stretches till
the end of line. Therefore, all these lines produce unbalanced braces, for
TeX the code becomes:

 \urlstyle{
 \usepackage{
 \begin{

Günter



Re: PDF graphics is blurred in LyX when scaled

2018-11-16 Thread list_email

> On Nov 11, 2018, at 12:29 AM, Murat Yildizoglu  wrote:
> 
> I have also observed this in the last version under Osx.
> 
> Murat Yildizoglu
> Le 11 nov. 2018 à 03:45 +0100, Baris Erkus , a écrit :
>> Hello,
>> 
>> PDF graphics appears to be blurred in LyX when scaled from Graphics Options 
>> --> LaTeX and LyX options --> Show in LyX --> Scale on Screen.
>> 
>> I am not sure if this is a feature to reduce CPU rendering workload or smtg, 
>> but it would be really nice to have a clear view of the PDF while working on 
>> the document rather than looking at it using a PDF viewer.
>> 
>> See MWE and the view from LyX below.
>> 
>> Baris
>> 
>> 
>> 
>> 
>> 
I have only skimmed this thread so apologies if this is off-topic. At least one 
poster mentioned OSX aka OS X aka macOS. The following section in the LyX wiki 
might be useful:

https://wiki.lyx.org/Mac/Mac#toc9

Jerry