Category Archives: latex

Add shortcut for "Export -> PDF(pdflatex)" on LyX's toolbar

Recently I got annoyed by LyX's inconvenient "Export -> PDF(pdflatex)" command.  Thus, I decide to modify my toolbar in LyX. Particularly, since I don't need the Update function (not an Adobe Reader user...), so I just removed it as well.

Today's aim: add an export shortcut for the menu File -> Export -> PDF(pdflatex), both keyboard shortcut and a button on the toolbar.

To modify LyX's toolbar, you need to go to its installation folder and find "stdtoolbars.inc". Mine is under the default path: "C:\Program Files\LyX20\Resources\ui". Then please find

Toolbar "view/update" "View/Update"
Item "View" "buffer-view"
Item "Update" "buffer-update"

After this, if you want to keep the Update button, then add this line after it:

Item "Export" "buffer-export pdflatex"

The result is shown like below

Or you can do it like me, just put the Update line into comment, i.e.

Toolbar "view/update" "View/Update"
Item "View" "buffer-view"
#Item "Update" "buffer-update"
Item "Export" "buffer-export pdflatex"

Moreover, if you love keyboard shortcut better than buttons on the toolbar, then please follow a few steps:

  1. go to "Tools->Preferences->Editing->shorcuts"
  2. under the "function" column, there is "document and window", then find "buffer-update" and remove it.
  3. find "buffer-export-custom", modify it to "buffer-export pdflatex" and configure the keyboard shortcuts as "ctrl+shift+R". (If you want to keep the shortcut for update, please choose another keyboard combination as you like)

Now you are able to use the keyboard shortcut for " File -> Export -> PDF(pdflatex)" as well! Enjoy!

Note: in similar ways, you can modify all the toolbar and shortcut you like!

ctrl+shift+R

New experience with LyZ!

Today I find a wonderful plugin for Zotero and LyX. In fact, it integrate Zotero and LyX via LyXServer. Therefore we can cite the reference stored in Zotero more easily!

From the author's website, its main features are:

  • Inserting citations to LyX from Zotero.
  • BibTeX database automatically updated when citation is inserted.
  • BibTeX database can be updated when the references in Zotero are modified.Get Zotero
  • Custom BibTeX key format.
  • Unique BibTeX key check.
  • Synchronization of BibTex keys between LyX document, BibTeX database and LyZ.
  • Editing of master/child documents (the same BibTeX database) and multiple documents (different BibTeX database for each document).
  • Persistent association of LyX documents and BibTeX databases.
  • Support for group cooperation.

They are really cooooool, aren't they?

After an easy installation, I start my journal with LyZ.

How easy? See the screenshots!

Snap333

Snap334

Sorry these screenshots are noted in Chinese. In fact if you are looking for more details about it, you can either visit the author's webpage (in English) or see my Chinese blog:

  1. a brief introduction
  2. Chinese translation of its official explanations.

The outline for Latex Lecuture

Title:

Latex and its application in economic essay writing

Introduction:

Latex is the best tool for college students to write their papers as well as some beamers for presentation. It is pretty convenient to typeset mathematical formulas and vectorized pictures. This series of lecture will be divided into three parts, with basic introduction of the operation principle of latex, including formulas, tables, pictures and reference etc. After the brief introduction, I will use visual method to show you how to finish a paper with latex, therefore avoiding  the terrible feeling when dealing with original codes.

After the lecture, you will be able to write an article with latex independently.

Outline:

Lesson 1: Basic Knowledge

1.1 basic pinciple

  • breif introduction: the origin of latex, different distributed version, the idea of latex's typeset, and mutually convert to word
  • user group: research, publication, why use latex?
  • application: academic papers, resume (CV), books and beamers
  • localization and Chinese
  • Layout: setting up the page, footnotes, fonts and colors

1.2 mathematical formula

  • introduction: grammar (Greek letters), common symbols, subscript and upscript, and different formula environments
  • advanced support: AMS package

1.3 table

  • float environment
  • insert and config a table

Lesson 2: Common Functions

2.1 visual editing

  • introduce Lyx: functions and installations.

2.2 figures

  • Insert a pic: supported formats, typeset, rotate and zoom
  • How to draw a scientific picture: the format of EPS, Illustrator

2.3 reference

  • Cross reference: insert a lable, refer a objection (formula, table, figure)
  • reference: format (default, Bibtex), reference methods (serial numbers, author and year)
  • automatically reference collection: zotero, and Endnote

Lesson 3: Advanced Functions

3.1 Tex Editors and real-time preview

  • the latex editor: simple introduction of LED, its appearance and functions
  • real-time preview: configuration

3.2 make a beamer

  • the principle of a beamer
  • steps to make a beamer: based on available templates

3.3 templates

  • situation: the difference compared with common documents
  • some international journal's templates: how to use and edit
  • use latex to make a book: compared with articles

3.4 cooperation with word

  • word to latex: Mathtype and formula
  • tex to word: solutions

3.5 work with R and stata

  • R project
  • Stata

How to show latex formulas on your blog/webpage/wordpress

For most people who are familiar with latex, we are addicted to the grammar of latex's mathematical formulas. However, although we can do well in PDF files, we can do little on traditional media like web pages (html) or our blog.

Fortunately, as the demand of it, some talent people provide the powerful tool. Like wikipedia, you can see the pictures  of these formulas directly and if you copy and paste them, you may get the latex code in your latex editor. Specifically, if you are using Lyx like me, you can see the formula as soon as you paste it in the mathematical environment like "equation". How cool it is!

But the fact is, what can we do on our blog? After searching for a while, I have found several solutions and tried one by one.

  • the best way is to install latex service on your servers. According to here, you can download  LatexRender. Then for those who are wordpress users, you can use the plugin WP LaTeX. Done!
  • But for those who are using third-part server like me, it is impossible to install latex service. From HERE: we can use John Forkosh's , can insert "real math images in html documents”. You only need to add latex code behind mathtex.cgi? and then you will get the image.
  • But don't you feel that it is inconvenient? You must enter the link by keyboard every time. Fortunately we have a wordpress plugin Latex for WordPess ( MimeTex for wordpress & bbPress,from here ). After the installation, it will automatically convert latex codes into gif images and cache them on your blog.

Note: Maybe you will fail to open your web pages after installing latex for wordpress. Then you may try to edit the plugin:

find this line:

class mimetex {

and then replace the following two lines with

var $server = “http://www.bytea.net/cgi-bin/mimetex.cgi?formdata=”;
var $img_format = “gif”;

Thanks for http://www.bytea.net/ and its public cgi.