LyX Use and Tricks
LyX Use and Tricks
A-Imam Al-Sammak
October 7, 2024
Contents
1 Introduction 4
2 Installation 4
3 Useful documentations 4
4 Navigating document 4
4.1 Navigate menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.2 View Outline Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
6 Math 5
6.1 LyX native math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
6.1.1 Inserting Inline Equation (Formula) . . . . . . . . . . . . . . . . . . . . . . . 5
6.1.2 Inserting Display Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
6.1.3 Equation array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
6.1.4 Numbering equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.1.5 Inserting matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.1.6 Inserting “case” environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.1.7 Inserting plain
P text in an equation . . . . . . . . . . . . . . . . . . . . . . . . 6
6.1.8 Inserting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.1.9 Inserting integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.1.10 Inserting ∞ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.2 Importing equations: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
6.2.1 Importing equations MSWord equation . . . . . . . . . . . . . . . . . . . . . 7
6.2.2 Importing equations from MathType . . . . . . . . . . . . . . . . . . . . . . . 8
6.3 Inserting plain Latex equations: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7 Images 8
7.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.2 EMF Drawing in LyX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3 Comments about figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3.1 Importing pdf figures from Visio . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3.2 Centering an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3.3 Image quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1
7.3.4 Comments about using Visio for my Electronic Circuits book . . . . . . . . . 12
7.3.5 General comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.4 Referencing figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.5 Sub-figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.5.1 Without cross referencing to sub-figures . . . . . . . . . . . . . . . . . . . . . 12
7.5.2 With cross referencing to sub-figures . . . . . . . . . . . . . . . . . . . . . . . 13
7.5.3 Using tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.5.4 Sub-figures over multiple pages . . . . . . . . . . . . . . . . . . . . . . . . . . 14
7.5.5 Using TexStudio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.6 Formatting figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.7 Center pictures or tables inside floats globally . . . . . . . . . . . . . . . . . . . . . . 17
7.8 Fixing Image position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.9 Figures in different directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.10 Putting table inside figure floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8 Boxes 18
9 Tables 18
9.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
9.2 How to split the top left cell of a table in 2 diagonally . . . . . . . . . . . . . . . . . 20
9.3 Notes about tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.4 Fixing position of table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.5 Long tables in Landscape view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.6 Fitting long table within text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
11 Hyperlinks 23
11.1 Inserting Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
11.2 Accessing hyperlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
11.3 Underlining Hyperlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
13 Inserting footnotes 24
14 Preamble uses 24
15 Lists 25
15.1 Lists numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
15.2 Lists spacing between items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
18 Paragraph spacing 26
2
19 Fonts 27
19.1 Font families: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
19.2 Font shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
19.3 Font series: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
21 Master-child documents 28
22 Quotes 29
24 Indexing 30
25 Pagination 30
25.1 Blank pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
25.2 Pages with NO number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
25.3 Using roman numbering (i, ii, iii, iv, ..) . . . . . . . . . . . . . . . . . . . . . . . . . . 31
25.4 Blank Page vs Page Break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
29 Contents page 35
32 Finishing touches 35
34 TexLive update 36
3
1 Introduction
• Latex is very powerful tool that produces beautiful documents.
• LyX is a very useful tool, menu driven almost like using MS Word and MathType.
• It is a joy to use as it uses menu driven graphical interface.
• It producing stunning output as it is an editor for Latex
2 Installation
To install LyX we need to install a “Latex Distribution - the best one available is "Tex live". There
was also another distribution "MikTex". MikTex is small and contains everything needed to run
Latex but unfortunately it stopped working lately and could not download it. MikTex is one man
show while Tex Live is group run.
Tex Live must be installed first and LyX will simply pick it up as the Latex distribution. Tex
Live is very large (about 8 GB) and takes a long time to download and install (many hours and
possibly days if internet is slow), so you have to be patient.
3 Useful documentations
• A good start with excellent overview and tutorial is found https://www.baeldung.com/cs/lyx-
tutorial
• LyX comes with many useful manuals, you simply click ’Help’ option on top and will give you
a wide range of manuals. One good start is “tutorial manual”.
• A good,relatively short video, is Introduction to LyX
4 Navigating document
4.1 Navigate menu
A special "Navigate" button is given on top line, where we can access any part of our document.
It also gives other navigation options: "figures", "tables" and "other lists". "other lists" navigates
"equations", "footnote", "graphics" and "labels and references".
You can display the table of contents in a separate window (on the left) by clicking on the toolbar
button , or by using View ▷ Outline Pane .
4
• “The slide bar” at the bottom can be used to globally select up to which level the tree view
remains “open.” It has three options (indicated by three dashes) : Main heading, Sub-heading,
Sub-Sub-heading.
6 Math
6.1 LyX native math
It has a built in symbols and other operations (using toolbar button ). The second is used
P
to toggle the two math bars at the bottom (which shows available math symbols and operations).
Alternatively, you can insert equations using the Insert ▷ Math menu where you can select any type
of equation, e.g. display, inline, numbered formula, array environment, etc ..
α=θ+a
To add more lines, it is easier to just hover over the line formula
α=θ+a
σ =Ω+π
5
More operations can be carried out on equation array such as and select any of the available
options such as: add new line, number equations, equation label, ... many more. Another way is to
press "Ctrl+Return" at the end of the formula. The first method is easier to remember than using
"Ctrl+Return".
α=θ+a (1)
σ =Ω+π (2)
The placement and format of the formula number in the output depends on the document class.
To number just one equation, set the cursor in the formula > select the line of formula > right
click on formula > (number this line) .
α=θ+a
σ =Ω+π (3)
6
• Select the part you want to be plain text
• Go to Edit > Math > Text Properties > Text Normal Font. The resulting equation is:
• In the math options tool bar (second line at the bottom) select the button .
P
• you can add upper and lower limits as usual (i.e. using uppercase and lowercase)
6.1.10 Inserting ∞
Many of the symbols listed in this section can also be inserted via the toolbar buttons and . ∞ is
selected from the toolbar button .
Note that some of more involved equations may not be completely translated and we may need to
adjust. Some of the symbols may not be readable.
7
6.2.2 Importing equations from MathType
This is really NOT worth it as we can use LyX native math , but it is given here just in case someone
decide to utilize it!!
• Open MathType equation you need to convert
• In MathType pane, click on Preferences > Cut and Copy Preferences > Click “MathML or
Tex > Select the option “Latex 2.09 or higher”
RX = R1 ||R2 ||rπ
Trying $ instead of "\[" and "\]"
RX = R1 ||R2 ||rπ
y1 = x2 + 1
7 Images
7.1 General
To insert an image in your document,
• Place the cursor at the text position you want.
• Click (toolbar button ) or the menu Insert ▷ Float ▷ Figure. This insert a rectangular box with
a place holder.
• Type figure title in the place holder.
• Click on the toolbar icon or select Insert ▷ Graphics from the menu. Then a dialog will appear
which allows you to browse and choose the file to load. Browse for needed file.
8
15V 15V F0 F0
100
140
62 3D
F0 F0 2
3k
62 3D
1
5k
R1 R 62k
33k C1 RC 2
R3 vo
vi 1 uF 1 uF
.5 uF
R2 6.2k
50 uF 1.2 k 50 uF
5.6k 1.5 k R4
Figure 3: Figure copied from Visio 2021 and pasted in LyX (as emf)
VCC
RC RC
vo1 vo2
F0
F0 2B
2B
vi1 vi2
F0 I REE F0
2D
2D
VEE
F0
2D
9
Figure 6: Inserting images by browsing files - JPEG
10
7.2 EMF Drawing in LyX
We found that the quality of emf is equal to pdf format, but requires one step less than that for pdf.
The steps taken is as follows:
• Copy figure from Visio.
• Paste it to LyX. It will give it a name "pastedXX" where XX is a counter that is updated
every time we paste a new figure.
• Modify file name to any name, e.g. DM-1, and save it in any directory you like, e.g. "..\EMF".
Notes:
• We could paste image directly into LyX as "pastedXX" which is quicker, but unfortunately,
later on it will be confusing as it has no name!
• We can do the above for the complete chapter and save it in the required directory, and later
insert figures in the usual LyX way!
• Nevertheless, the pdf format is more widely used, so we will stick to it.
• Go to the "Design" button and select "size" - otherwise the figure will be shown as a small
part of a whole page which leaves a lot of space around figure!
• Select "fit to drawing"
• In Visio go to: File > export > Create XPS/PDF document > select "pdf" > options >
uncheck (document structure tags for accessibility) > ok > publish. The last option produce
a figure without border box. If unchecked then the the figure will have a box surrounding it.
• Save resulting file into the required directory
• Insert figure into LyX file using the method given above.
11
7.3.3 Image quality
• Best quality is PDF format, specially the one generated by Visio 2021 (or later versions).
• EMF is of equal quality to pdf.
• SVG format gives crispier image, but distorts some of the math and changes math fonts
slightly!!
• XPS, MetaFile File formats are rejected by LyX.
7.5 Sub-figures
7.5.1 Without cross referencing to sub-figures
This can be done by inserting image floats into existing image floats. Note that only the main
caption of the float is added to the List of Figures. Figure 12 is an example of a figure float with
two images set side by side. You can also set the images on top of each other by pressing “Enter” at
the end of the first sub-image.
Figures can be put next to each other in figure as shown below. Note that:
• We can place figures horizontally and vertically. To place sub-figure vertically, we press "re-
turn" to start on a new line.
• There is NO numbering for sub-figures, if we need to, then we place them inside the figures
themselves before importing to to LyX. This problem is solved in 7.5.2
12
vo
GM vi Ro = K ro1
1 1 1
00
00 11 11
01
01
10 10
11
11 11 10
(a) AA (b) BB
13
As you can see, we can in this case reference sub-figures individually as shown in Fig. 13a and
Fig. 13b.
• Insert Box > Frameless > Table (regular one on first line).
• Insert figure (regular one on first line)
An example is given in Fig. 14 which has three figures with spacing between them. Note that:
• The figures are on the same line, which I could achieve only with using figure option (Scale
graphics), this time to 60% of the original size.
• This method uses an extra command which is "Box(minipage)" which we did not use before!
• This seems to be the best / easiest way for sub-figures!
1 1 1 1 1 0
00
00 11 11 11
01
01
10 10 00
10
11 01
11 11 10 11 10 10
A more elaborate example is given in Fig. 15. Note that the initial imported file had TWO
columns only and we added to it a 3rd column and extra two rows.
Limitation of this technique is that the figures must fit within one page only!
14
1 1 1 1 1 0
00
00 11 11 11
01
01
10 10 00
10
11 01
11 11 10 11 10 10
00
00
11 11
11
01
10
10
10
11
output 11 10 10 11
(d) fourth
input 1 1 0 0 1
00
00
11 11
11
01
10
10
10
11
output 11 10 10 11 11
(e) fifth
15
• You can split the figure to as many floats as you need to fit on the pages if you add in TeX
mode \ContinuedFloat at the beginning of each of the subsequent floats.
• An example was kindly provided by Jürgen and I just adjusted the required figures. The only
modification I did was to use the “fixed height” option instead of “% Line width”. here the
example.
1 1 1 1 1 0
00
00 11 11 11
01
01
10 10 00
10
01
11
11 11 10 11 10 10
input 1 1 0 0 1
00
00
11 11
11
01
10
10
10
11
output 11 10 10 11
(d)
input 1 1 0 0 1
00
00
11 11
11
01
10
10
10
11
output 11 10 10 11 11
(e)
16
input 1 1 0 0 1 0
00 11
11
11
01
01
10
10 10
10
11
output 11 10 10 11 11 01
(f)
input 1 1 0 0 1 0 0
00 11 11
11 11
01 00
01
10
10
10
11
output 11 10 10 11 11 01 11
(g)
17
7.8 Fixing Image position
Sometimes we need to place an image after certain text, so to keep the table close to its entry in the
output:
Right click on “float:Figure” > setting > Placement Settings > Custom > Here definitely (or any
other option)
Alternatively, we can make this setting for ALL floats (images and tables) by:
Document > Float setting > Custom > Here definitely (or any other option)
8 Boxes
Lyx has built in normal boxes. To insert a box: go to > Insert > Box > select type of box you like,
e.g.
oval
testing box within LyX
oval box
How to color boxes (e.g used shaded boxes) is solved in section 26.
9 Tables
9.1 General
To insert a table in your document,
• Place the cursor at the text position you want.
• Use the menu Insert ▷ Float ▷ Table or the toolbar button . This insert a rectangular box with
a place holder.
18
• Use the Insert ▷ Table (toolbar button ) to insert the actual table. A dialog will appear,
asking you for the number of rows and columns. The default table has lines around each cell
and the first row appears separated from the rest of the table. An example is shown in table
1.
• There are many operation that can be done on the table by simply right clicking on the cell
(or group of cells), e.g. "select two cells" > "right click" > "Multi Row" . You can control
"borders" , "alignment" etc. e.g.: "select two cells" “table menu” appears at the bottom where
you can select to add / remove borders at any side of the selected cells.
1 2 3
Joe Mary Ted
a b
x2 dx
R
1+1=2
c d
• Click on the table with the right button to get a Table Settings dialog box which allows extensive
table editing.
• The table toolbar is an alternative to the table dialog to be able to alter tables faster. It should
normally appear at the bottom of LYX’s main window when the cursor is inside a table. The
toolbar has the following icons:
toggles a line at the bottom of every cell for the currently selected cells
toggles a line at the left side of every cell for the currently selected cells
toggles a line at the right side of every cell for the currently selected cells
19
adds lines around the current or selected cells - if the current cell is not a multicolumn
cell this also affects the current row and column
deletes all lines of the current or selected cells - if the current cell is not a multicolumn
cell this also affects the current row and column
If using a formal table, this resets the border to its default (only horizontal lines in top
and bottom rows)
left-aligns the content of the current cell / column
centers the content of the current cell / column horizontally
Properties
Type
20
9.3 Notes about tables
• Table has to be inserted “after caption” so that caption comes on TOP, otherwise LyX put
caption below table.
• To be able to assign "table caption" we must use Table Float button or using "insert > Float
>Table" .
• To center the table, place the cursor to the right of the Table > right click > select paragraph
setting > tick center.
21
Table 3: Channel Capacity Calculation
At p(xi )= 1/N
# Ch. [ P(Y/X) ] [P(X)] [P(Y)] H(Y/X) H(Y/X) [P(Y)] H(Y) C sym Comments
Name o/p?
1 BC .8 .2 .85 .725 .7458 .8016 .55 .45 .9928 0.1912 - Log2 (2) = 1
.3 .7 .15 .275
B = binary, C = channel, E = erasure, S = symmetric, Q-ary = Quaternary,
22
9.6 Fitting long table within text
This is achieved by using latex command
\resizebox{\textwidth}{!}{<tabular>}
Item Label
Figure fig:xyz
Table table:xyz
Section sec:xyz
Chapter chap:xyz
Example exm:xyz
Equation eq:xyz
11 Hyperlinks
11.1 Inserting Hyperlinks
Go to “Insert” , then select “Hyperlink”. This will open a panel with two entries “Target” which is
where you put the actual link and “Name” where you can put the name you want to call it. An
example is shown in section 3.
23
11.2 Accessing hyperlink
To access the hyperlink you can access it from LyX file or from pdf output, not from LyX code!).
• From LyX file: Right click on the link it will show two options: “setting” and “open target”,
select “open target”
• From pdf output: left click on the link it will transfer you the the website (but it asks you for
permission)!
y1 = x2 + 1
• In case you would like to use LaTeX just locally and once, you could insert TeX code in the
document: click the TeX toolbar button, or select Insert and TeX. This is also known as ERT.
The acronym ERT (Evil Red Text) refers to raw LaTeX commands inserted into the body
of your LyX document. In historical versions of LyX, ERT appeared in the user interface
alongside regular text as red characters.
• If you repeat LaTeX commands within the text, there"s a good chance that you could do the
same by a global setting, in the preamble.
13 Inserting footnotes
Go to “Insert” > footnote (a place holder ’box’ will appear where you can put the footnote contents)
14 Preamble uses
We can modify the preamble section to suit our needs. In the menu, choose Documents >Settingsh
> document preamble. Here you can insert any latex command (such as \usepackage for loading
packages with settings) and making further command definitions (such as \definecolor) .
• Adding special packages by “\usepackage” etc.
24
\definecolor{BlueDark2}{RGB}{33,174,254}
\definecolor{BlueLight}{RGB}{200,240,255}
\g@addto@macro\@floatboxreset\centering
The first two commands define new degrees of the color blue, while the third line globally centers
all floats i.e. figures and tables.
15 Lists
15.1 Lists numbering
LyX number lists as 1, 2, 3, ...
Sometimes (as in the case of my book) we need to alphabetical listing, the solution to this simple
and provided by
• Redefining (labelenumi) command before the beginning of the list should do the trick, i.e.
simply add a TEX code at the begin of the list. Type in the following code: \renewcom-
mand{\labelenumi}{\alph{enumi}.}
For more info about this take a look at Additional Features manual, Section 7.2. (in LyX, go to:
Help > Additional Features).
25
16 Importing from different programs
• We use “File” > “ Import”.
• Just do not expect miracles: if the document that we are migrating is complex, it will need
attention.
• Clearly, import and export of LATEX documents works perfectly.
• With ’Pandoc’ and other filters already present, it is possible to import and export to and
from LYX (not tried yet)
18 Paragraph spacing
• This can be set using "Dopcument" > "Setting" > "Text Layout" > select "Indentation" >
chose "Default" or "Custom".
• In "Text Layout" , you can select "Vertical Space" to control space between paragraphs, but
this cancells indentation AUTOMATICALLY
• You CANNOT combine "Indentation" and "Vertical Space" together!!
• By the way, Sedra & Smith does NOT use paragrapph seperation but defferntiate between
them using "Indentation"
26
19 Fonts
19.1 Font families:
• rm: corresponds to roman family
• sf: corresponds to sans serif family
• tt: corresponds to typewriter family
• Select “customized”
• In the pane, select “color”, it will give you choice of standard colors available.
27
Of course, on the LyX GUI you"ll still get the original colors, which thanks to the particular
background of LyX are very readable.
At the moment, you can only redefine the names of colors LyX knows about. The LyX way to
select colors (Edit -> Text style -> Customized) does not accept new color names.
21 Master-child documents
For a large document like a book, it is better to split it in chapters. This is done using master-child
documents.
• Create a master document that include ALL preliminaries like Title, author, etc
• In the master document, (insert) > (file) > child. Browse and select file(s).
Note: master and child files must be of the same "Document class", e.g. book in our case! An
example is given in Fig. 18.
28
Figure 18: Master-child book example
22 Quotes
LyX and possibly Latex reserves the use of single quote (’), so to quote something ’how to quote’
we will get spelling error issue. It is best to use double quote “how to quote”.
c. Book (standard with extra font sizes) - This is the best fit to my Electronics book
d. Book (standard) - same as number “c”
e. Springer contributed book (svmulti)
I tried “c” and “d” and they work fine. They look the same for me! AMS version does NOT look
nice for me. KOMA is fine but it did NOT accept the colors I added in preamble!!
29
24 Indexing
• Include \usepackagemakeidx and \makeindex in the preamble (through Document > setting
> Preamble).
• An index entry is created if you use the menu Insert ▷ Index Entry or the toolbar button . A
box is inserted containing the text that appears in the index. The word where the cursor is in
or the currently highlighted text is proposed by LYX as the index entry.
• Move to the end of document (or any other place you want it) and choose Insert > LIST/TOC
> Index List.
Note: I applied this for a single word now (Springer) given in 5 and illustrated in Fig. 19.
25 Pagination
25.1 Blank pages
To insert a blank page, we need to insert a Latex code (\thispagestyle{empty}) in top of the page.
For some reason, I had to add a blank vertical space, otherwise it will not produce an empty page!
This differs from inserting “New Page” or “Page Break” shown in subsection 25.4 where this
actually insert a full blank page while the other choices you can write in the pages, an example is
given in 20.
30
25.3 Using roman numbering (i, ii, iii, iv, ..)
How can I have roman pagination (i, ii, iii...) for the first part of my document?
• If you use a book class, simply insert latex code (\frontmatter) at the beginning of the docu-
ment. This will switch page numbering to roman (i, ii, iii...)
• At the end of selected pages insert again (\mainmatter) which will switch back to Arabic (1,
2, ...) and start from "1".
31
The choice of insets are:
• Color Box
• Custom color Box 1 - 5
• Fit color box
• Raster color box - I got an error. Latex Error: “Environment tcbraster undefined”. Neverthe-
less, I don’t need it at least for the time being.
• Subtitle. I tried this option it gives me a "shaded box with whatever text you type inside it"
To colorbox for use in our examples, we need to create a custom color box, I used one of them
(ColorBox A) which will translate to ’Custom color box 1’. This style is based on my Book “Electronic
Circuits Fundamentals with Mathcad Examples’ - by A-Imam Al-Sammak, available on Amazon as
eBook ::::::::::::::::::::::::::::
Electronic Circuits Book -eBookand print ::::::::::::::::::::::::::::::::
Electronic Circyuigts - Print version. This part is
done by Mr. Natarajan Yoganathan (Upwork.com freelancer) which is based on work done for
formatting my book in Latex by Mr. Faseeh Muhammed (Upwork.com freelancer) .
Our main interest here is to create book examples that are numbered chapter wise and that can
be labeled and cress referenced. To insert a color box (we will use our own created custom box),
follow the following:
• A color box is inserted via the menu Insert ▷ Custom Insets ▷ Custom Color Box 1. An a place-
holder rectangle red box appears.
• Right clock on the “place holder”, select ’color box options, another “placeholder \” within our
original “placeholder” appears.
32
Running this will give us the following output:
• To label the example for future referencing, we need to insert another option “MORE color
box options”, where we type our label (which is used later for cross referencing), e.g. i.e.
• Inside the new “place holder” insert a label, e.g. Example X. Note, since this is a label, the
output does NOT show either the “More Color Box Options” or “Example X”!
• Move the cursor outside the second placeholder, press “return” to create space where we can
put any text / data / tables etc. It can contain several paragraphs and math.
VCC = 15V
RC 3.9 k
vo
Rsig
RL 10 k
+ = 100
vsig 10 k RB 50 k
− 2 mA I
VEE = −15V
Figure 22: Common emitter amplifier using Constant current source example.
Solution
Since we have a constant current source and high β(= 100) we can use the approximate
method:
33
IC
IC ≈ IE = I = 2 mA, IB = = 20 µA
β
Table 5: Table 1
a b
1 2
3 4
To reference “example box”, we need to use a Latex insert, i.e. as shown in Example .1. Please
note the following:
• The output will show “as shown in Example 0.1” where “0” is the chapter number and “.1” is
the example number.
• We have inserted the word “Example” and it is NOT part of the label “Example X”!
To insert a table within color box, float placements will not be working in LaTeX. So we need to go
to - setting > Placement Setting > “here definitely” option. Strange, but this how it works!
34
boxrule=0pt,
frame empty,
opacityback=0,
enhanced jigsaw,
colframe=mycyan!10
}
}
An example of how the resulting shaded box example is shown in Fig. 23
29 Contents page
This is simply done by: Insert >” Lists / Contents / References” > Contents
32 Finishing touches
This is copied from: Linux LyX Book design
When you’re done composing all of your text in LyX, you’ll want to do a little cleanup on your
document before sending it to press. Because TeX is a typesetting engine, it may occasionally fail
to find a good place to break a line, resulting in a warning message and a line that extends into
the margin. When this happens, your options are to rewrite the line so that TeX can find a good
place to break it; manually force a break by using Insert -> Special Formatting -> Line Break; or
allow TeX to insert extra spacing between words by using the command sloppypar. Aesthetically,
the third option is considered the method of last resort, but you can use it by inserting an ERT
35
code box with Insert -> TeX code, typing begin{sloppypar} at the beginning of the paragraph, and
inserting another code box containing end{sloppypar} at the end.
In the same vein, TeX prefers not to leave blank space at the bottom of a page where a section
ends. To avoid this, the software will insert extra spacing between paragraphs in order to stretch
the text vertically to fill the page. We preferred to leave the blank space at the bottom, which we
easily accomplished by using Insert -> Special Formatting -> Page Break below the section that did
not fill the page.
Some publishers, including Lulu Press’ Global Distribution option, require electronic files submit-
ted in PDF format to be created with Adobe Distiller. This wasn’t an option for us, but fortunately
we could also upload the book in PostScript format. To do this, we created a PDF of the book using
View -> PDF(pdflatex), which brings up a PDF version of the book in Adobe Reader. We then
saved a copy of the PDF from Adobe Reader and converted that file to PostScript format using the
command:
pdftops -level3 -paperw 432 -paperh 648 Book.pdf Book.ps
where Book.pdf is the PDF saved from Adobe Reader. In this command, the paper dimensions
are given in points; the points in the example command correspond to a 6×9-inch book.
34 TexLive update
This done through “tlmgr - TeX Live package manager” TexLive update
In prompt command (>) type:
tlmgr - TeX Live package manager
tlmgr is the name of the package and configuration manager included in TeX Live. It oper-
ates completely separately from any package manager the operating system may provide. The full
documentation for tlmgr is available (updated nightly), or you can run tlmgr --help.
If you installed MacTeX, precede the commands below with sudo, since MacTeX installs as root.
Getting updates
Occasionally new versions of tlmgr are released. Your installed tlmgr will notice and ask you to
update it before updating anything else. The command to do this is:
tlmgr update --self
After any updates of tlmgr, you can then run, for instance, tlmgr update --all, which will update
(including additions and removals) all other packages in your installation that have been changed
on the server. Authors frequently release new versions of their work to CTAN, which is propagated
into TeX Live.
36
35 My issues with LyX
• Sub-figures cannot be referenced separately if they are inserted using Table method.
• How to reference sub-figures as 1.23(x) instead of 1.23(x).
• How to add book templates other than those listed in LyX (not needed, as I could add for-
matting to preamble!)
37
Index
E
ERT, 24
S
Springer, 29
38