Bibliography Using Texmaker Latex

Posted on by Gall

Just the other day I was trying to use BibLaTeX over BibTeX, because I heard good things about it. My primary motivation to give it a try was, that citing web-resources seemed much easier.

The way it is supposed to work is quite straight forward: You include the BibLaTex package, tell it which bibliography backend to use (i.e. Biber or BibTex) and it creates an auxiliary bibliography, which is referenced then in the aux file of your master document.

There were however two things I really wanted to hold on to: I love Texmaker so obviously I want the quick build button to work as usual. Furthermore I hate clutter in my working directory, so a separate build directory is key.

Assume the following example files: The where all my packages are loaded and usually a lot of other stuff is happening. Usually the actual content of my work will be scattered across separate tex files. Additionally there’s the trusty bibliography file, in this case called .

Using the default quick build (set to use pdflatex + bibtex + pdflatex + pdflatex + view) did not work. After some troubleshooting I figured out where the problem lies. Remember I mentioned biblatex references to the auxiliary bibliography file () from the ? Those lines look something like that:

\bibstyle{biblatex} \bibdata{master-blx,bib} \citation{biblatex-control}

The bibliography data, which bibtex will look for are the original bibliography and the auxiliary bibliography generated by BibLaTeX. However, the sits nicely in the build directory as it should, but bibtex looks for both files in the same directory. After skimming over a bunch of pages of the package documentation I found no solution, which enabled me to have this reference manipulated. Neither did bibtex have a command line option to indicate different file locations to look for. Part of the solution is to look at placed we can touch: It’s possible to use  over . Doing that, you need to run the bibtex step from within the build directory.

Problem solved, right? Not quite. Texmaker did not accept any attempts to customize the bibtex command in a way to accept either environment variables or commands or any other stuff I tried. What did end up working though, was writing a shell script that does what I want and put it into a random custom command and choosing the quick build setting to execute it and viewing the resulting PDF as shown in the screenshots.

The shell script ():

pdflatex -output-directory=build -synctex=1 -interaction=nonstopmode master.tex cd build/; bibtex master.aux; cd .. pdflatex -output-directory=build -synctex=1 -interaction=nonstopmode master.tex pdflatex -output-directory=build -synctex=1 -interaction=nonstopmode master.tex

The latex document ():

\documentclass[a4paper]{article} \usepackage[backend=bibtex]{biblatex} \bibliography{../bib.bib} \begin{document} \section{Introduction} LaTeX is a high-quality typesetting system \cite{latex}. \printbibliography \end{document}

The bibliography file with a web reference ():

@online{latex, author = {LaTeX project team}, title = {LaTeX - A document preparation system}, publisher={Frank Mittelbach}, date={2015-04-03}, urldate = {2016-02-13}, url = {https://latex-project.org/} }

That’s it! Additional thoughts might be to place the make.sh somewhere else and point the command to an absolute path to that file, which would then be project independent. The script would have to take parameters (the master file name and the absolute path to the project directory), which you could achieve with Texmakers special characters.

I hope that helps, thanks for reading!

2.1 Usual commands

The standard commands (cut, copy, find...) can be launched via the "Edit" menu and the "Edit" toolbar.
Block selection is available by using the Alt key while moving the mouse cursor.

2.2 Setting the preamble of a TeX document

To define the preamble of your document, you can use the "Quick start" wizard ("Wizard" menu).

This dialog allows you to set the main features of your document (class, paper size, encoding...).
Note : You can add other options by clicking the "+" buttons. All yours settings are recorded.

You can also type your own preamble model in the editor : with the "Copy/paste" or "Save As" commands, you can use it for a new document.

2.3 Structure of a document

To define a new part (section,subsection...) in your document with Texmaker, just use this combobox in the toolbar :

This will cause a dialog to pop up which allows you to define the style of the part (section,subsection...).
Note : the "Structure View" is automatically updated.

2.4 Browsing your document

The "Structure View" (left panel) lets you quickly reach any part of your document. All you need to do is to click on any item (label, section...) and you will be taken to the beginning of the corresponding area in the editor.

The "Structure View" is automatically updated while typing. You can also use the "Refresh Structure" ("Edit" menu) command at any moment.

For each file, three bookmarks can be used to speed up navigation : just click on a line number to add or remove a bookmark. When you have already defined three bookmarks, you must remove one of them to add a new bookmark. To jump to the line corresponding to a bookmark in the editor, just click on the buttons in the status bar.

2.5 Formatting your text

You can quickly set the format of a part of your text with this :

Additional option: a selected text can be directly framed by certain environments. Example: while clicking on the button "Bold" after having selected the word "Hello" , you will obtain the code: \textbf{Hello}.
This option is available for all the environments indicated by "[selection]" in the "LaTeX" menu.

2.6 Spacings

The usual "spacing" commands are available in the "LaTeX" and "Math" menus. To insert quickly the "new line" LaTeX command, you can use the corresponding command in the toolbar (shortcut : Ctrl+Alt+return)

2.7 Inserting a list

The usual list environments code can be insert quickly via the "LaTeX-List" menu.
Note : the shortcut for the \item command is Ctrl+Shift+I.

2.8 Inserting a table

With the "Tabular" wizard ("Wizard" menu), the LaTeX code for a tabular environment can be quickly inserted :

You can set the main features of your table.
Note : this dialog allows you to type directly the code in the cells.
The corresponding LaTeX code is automatically inserted in the editor.

2.9 Inserting a "tabbing" environment

To help you to insert a "tabbing" code, you can use the "Tabbing" wizard ("Wizard" menu) :

2.10 Inserting a picture

To insert a picture in your document, just use the "\includegraphics" command in the "LaTeX" menu. Then, click on the "browser" button in the dialog to select the graphic file.
Note : if you click on the "+" button, a "figure" LaTeX environment will be added automatically.

2.11 Cross References and notes

This toolbox in the toolbar allows you to insert quickly the label, cite, ref, footnote... code.
Note : the labels used in your documents are displayed in the "Structure View".

Additional option:for the \ref command, a dialog box allows you to select directly the label.

2.12 Inserting math formulae

You can toggle in the "in-line math" environment with the "$$" button in the toolbar (shortcut : Ctrl+Alt+M) or with the "Math" menu. The shortcut for the "display math" environment is : Alt+Shift+M.
The "Math" toolbar allows you to insert the most currents mathematical forms (frac, sqrt...)

With the "symbols panels" in the structure view, you can insert the code of 400 mathematical symbols and the \left and \right tags..(just click on the "symbols" buttons in the structure view)

Additional option: A "favorites symbols" (*) panel allows you to define your own "symbols panel".

  • To add a symbol to the "favorites symbols panel", just right-click on a symbol in the others "symbols panels" and select "Add to favorites" in the pop-up menu.
  • To remove a symbol in the "favorites symbols panel", just right-click on it and select "Remove from favorites" in the pop-up menu.

You can also define the format of your mathematical text via the "Math" menu.
For the "array" environments, a wizard (like the "Tabular" wizard) is available in the "Wizard" menu. With this wizard, you can select the environment : array, matrix, pmatrix.... The cells can be directly completed.

2.13 Using the "•" place holders

The "•" place holders, automatically inserted by some Texmaker commands, allow you to reach directly the next field in the created structure by using the "Tab" key ("Shift+Tab" to go backward).
Note : inserting a tabulation with the "Tab" key is deactivated if the line contains a "•" place holder.


Categories: 1

0 Replies to “Bibliography Using Texmaker Latex”

Leave a comment

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *