Re: Insert Tex Code

2015-09-18 Thread Richard Heck

On 09/18/2015 10:15 AM, David L. Johnson wrote:

On 09/18/2015 09:40 AM, Sajjad wrote:

Hello forum,

I am trying to insert TeX code directly from the LyX interface 
Insert->Tex Code . Then I see a box in the editor. Inside the box I 
entered the following:


\sqrt A-B


But that is not correct TeX code.  If you were to write that in an 
editor and tried to run TeX, you would get the same error.  If you 
write, in the box, (as TeX claims it will do in that error message) 
$\sqrt A-B$ you would not get an error, but you would also not get 
what I suspect you want.  The $s put it in math mode for TeX.  To get 
the square root of the difference, write $\sqrt{A-B}$. Alternately, go 
to Math mode in LyX, rather than TeX mode, and enter \sqrt .  If you 
then hit the space bar, you see a little blue square root sign, with a 
blue box inside, and the cursor in the box. Then enter A-B.  Easier, 
and you see what you will get.


Maybe it's worth adding that "TeX Code" (aka ERT, Evil Red Text), is 
intended for various sorts of constructionw that LyX does not natively 
support, or doesn't support very naturally. As David said, most math can 
be done in LyX's math mode.


Richard



Re: Insert Tex Code

2015-09-18 Thread David L. Johnson

On 09/18/2015 09:40 AM, Sajjad wrote:

Hello forum,

I am trying to insert TeX code directly from the LyX interface 
Insert->Tex Code . Then I see a box in the editor. Inside the box I 
entered the following:


\sqrt A-B
But that is not correct TeX code.  If you were to write that in an 
editor and tried to run TeX, you would get the same error.  If you 
write, in the box, (as TeX claims it will do in that error message) 
$\sqrt A-B$ you would not get an error, but you would also not get what 
I suspect you want.  The $s put it in math mode for TeX.  To get the 
square root of the difference, write  $\sqrt{A-B}$. Alternately, go to 
Math mode in LyX, rather than TeX mode, and enter \sqrt .  If you then 
hit the space bar, you see a little blue square root sign, with a blue 
box inside, and the cursor in the box. Then enter A-B.  Easier, and you 
see what you will get.



--
 
David L. Johnson

Department of Mathematics
Lehigh University



Insert Tex Code

2015-09-18 Thread Sajjad
Hello forum,

I am trying to insert TeX code directly from the LyX interface Insert->Tex
Code . Then I see a box in the editor. Inside the box I entered the
following:

\sqrt A-B

When I go for preview I get the following error:

//
Errors:
Missing $ inserted

Description:

on \emph{L, }and any vector \sqrt A

-B

I've inserted a begin-math/end-math symbol since I think

you left one out. Proceed, with fingers crossed.



//

Any hint on what is missing in the process ?


Thanks


Re: lyx 2.0.1: insert tex-code does not work

2012-12-20 Thread stefano franchi
On Thu, Dec 20, 2012 at 12:56 AM, "Jörg Kühne"  wrote:

> Dear Stefano
>
> Many thanks for your email. How I could insert a simple footer or a header
> in Lyx? How I could use differnt styles f.e. different fonts in the same
> area/chapter?
> Is the style and the fonts under Document>>Settings adjustable?
>
> Best regards
>
> Joerg
>
>
>

Joerg,

Headers an footers are usually controlled by the document class you are
using and you don't need to do anything to set them. However, you can
insert custom headers/footers by following the instructions in the User's
guide, section 6.11 (llok it up, it's very short).

As for changing fonts: if you mean changing to a different fonts within the
same typeface (i.e from roman to bold or bold italic, or small caps), you
can do it by selecting the text in question, and then going to Edit>>Text
Style>>Customized.
If by "changing fonts" you mean "changing typefaces" (e.g. going from Times
to Palatino), well, that it is typically not done at the text level. You
can select the typeface at the document level (go
Document>>Settings>>Fonts). Changing the typeface for different elements in
your documents (i.e. headers, TOC, etc)  may be done in different ways
depending on which Document class you are using. The Koma-script classes,
for instance, have their own commands that allow you to change the fonts in
various areas of the documents (Headings, Footnotes, etcetera). I forget
the details, but their documentation it's excellent: Look up the file
scrguien.pdf or the more comprehensive German version: scrguide.pdf (both
should be part of your TeX installation). The memoir class offers similar
font-changing commands (see memman.pdf)

If you really need to change typefaces at the micro level, you may want to
look into the fontspec package (which, however, requires the XeTeX or
LuaTeX backends, not the standard pdfLaTeX). Or you may want to use the
Latex commands detailed in this page:
http://latex.computersci.org/Reference/Typefaces
Notice that, as that page says, these commands are typically NOT used in a
document---they are meant for classes definitions. The same is true for the
fontspec commands.Or take a look at the LaTex Companion to Latex---the font
chapter (I believe it's chapter 6 or chapter 7).

If you are trying to use Lyx as a standard word processor, changing styles
and typefaces on a ad hoc basis, you are on the wrong track and you'll be
wasting a lot of time. LyX is meant to be used in conjunction with a
document class. It is the class that takes the design decisions (with some
fine tuning, if necessary). If you want to constantly override the
decisions taken by the document class, you may be using the wrong approach.
I would switch to either a standard word-processor, plain TeX, or a page
layout application (e.g. InDesign, Scribus), depending on your needs and
background skills.

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


lyx 2.0.1: insert tex-code does not work

2012-12-19 Thread Jörg Kühne
Dear Lyx-Users

If I insert in the red box direct the tex-code, see

http://www.quora.com/How-can-I-edit-LaTeX-source-code-in-LyX

f.e.:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
adfaf
\end{document}


following error report appears:


 \documentclass
  [english]{article}
Your command was ignored.
Type  Ito replace it with another command,
orto continue without it.


What is wrong with that?

Regards

Joerg


Insert TEX code with right to left language text (persian,arabic, ...)

2012-11-08 Thread jalil
Hello!
When inserted Tex code with Persian words (RTL language)
my words in Persian  is shown in lyx editor in LTR
for example like this
\rl{ی ل ت}
but this is correct:
\rl{تلی} 

How can i insert both RTL and LTR texts in TeX mode?