Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fuss:latex [2016/01/15 10:22]
office [Hide Sections at Compile Time Using a Conditional]
fuss:latex [2017/02/22 18:30] (current)
Line 1: Line 1:
 +====== Installing Tex Live Under Windows ======
  
 +The TeX Live install bundle found at [[http://​www.tug.org/​texlive/​windows.html|TeX Live Windows installation]] makes perl crash under Windows. The workaround is to use some other perl bundle. Currently there are two major perl distributions,​ [[http://​www.activestate.com/​activeperl/​downloads|Active State Perl]] (our favorite) and [[http://​strawberryperl.com/​releases.html|Strawberry Perl]]. To work around the problem:
 +
 +  - Install either Active State Perl or Strawberry Perl from the links above.
 +  - Right click the ''​install-tl.bat''​ file from the [[http://​www.tug.org/​texlive/​acquire-netinstall.html|install-tl.zip]] and select ''​Edit''​ so the installer dos code shows up.
 +
 +Change the following lines:
 +  ​
 +<code dos>
 +rem Use TL Perl
 +set "​path=%~dp0tlpkg\tlperl\bin;​%path%"​
 +set "​PERL5LIB=%~dp0tlpkg\tlperl\lib"​
 +</​code>​
 +  ​
 +to the following:
 +  ​
 +<code dos>
 +rem Use TL Perl
 +rem set "​path=%~dp0tlpkg\tlperl\bin;​%path%"​
 +rem set "​PERL5LIB=%~dp0tlpkg\tlperl\lib"​
 +</​code>​
 +  ​
 +which comments out the TeX Live installer perl settings and uses the system-wide perl you installed in the first step.
 +
 +====== Using non-Latin Characters ======
 +
 +The most elegant way is to use UTF8 encodings for both the bibliography file and the document. UTF8 has to be supported by the operating system and the editor (popular latex editors allow you to change the character encoding in their preferences). Then add in the preamble:
 +
 +<code latex>
 +\usepackage[utf8]{inputenc}
 +\usepackage[T2A]{fontenc}
 +\usepackage[russian,​english]{babel}
 +
 +</​code>​
 +
 +this will render UTF8 (keyboard-generated) characters exactly as they are. The third line allows you to specify languages used in the document.
 +
 +====== Change Font inside Verbatim Environment ======
 +
 +This can be done by surrounding the ''​verbatim''​ environment by ''​begingroup''​ and ''​endgroup''​ and then using ''​fontsize''​ to select the font size and the line spacing.
 +
 +<code latex>
 +\begingroup
 +    \fontsize{8pt}{10pt}\selectfont
 +    \begin{verbatim}  ​
 +        This font is 8pt. 
 +    \end{verbatim}  ​
 +\endgroup
 +</​code>​
 +
 +The first parameter to ''​fontsize''​ is the font size (''​8pt''​) and the second parameter represents the line spacing (''​10pt''​).
 +
 +====== Update To LaTeX2e ======
 +
 +LaTeX2e is the current LaTeX version and usually has to be installed on top of an initial install. For example, on the Amiga, the ''​PasTeX''​ LaTeX distribution can be updated by copying over the files from LaTeX2e in the ''​texmf''​ directory as described.
 +
 +First, we need to get [[http://​www.ctan.org/​tex-archive/​macros/​latex/​base|the latest LaTeX distribution from CTAN]]. We are only interested in the ''​base''​ directory which we can download.
 +
 +Then unpack the ''​base''​ directory:
 +<code bash>
 +tar -zxpvf base.tar.gz
 +</​code>​
 +
 +which will produce a ''​base''​ directory containing all the necessary files. Some of these files have to be installed into the local latex distribution which is by convention referred to ''​texmf''​ where all the LaTeX files are placed.
 +
 +Now, unpack the distribution to generate the LaTeX format files:
 +<code bash>
 +cd base
 +initex unpack.ins
 +initex latex.ltx
 +</​code>​
 +
 +From the ''​base''​ directory, copy all the required files:
 +<code bash>
 +cp latex.fmt latex.log /​usr/​share/​texmf/​web2c
 +cp *.fd *.cls *.clo *.sty *.def *.tex /​usr/​share/​texmf/​tex/​latex/​base
 +cp *.ist /​usr/​share/​texmf/​makeindex
 +</​code>​
 +
 +and then test the installation using the provided ''​ltxcheck.tex'':​
 +<code bash>
 +mkdir tmp
 +cd tmp
 +cp ../​ltxcheck.tex ./
 +latex ltxcheck.tex
 +</​code>​
 +
 +====== Regenerate LaTeX Format ======
 +
 +Find the ''​latex.ltx''​ file which is usually located under ''​texmf/​tex/​latex/​base/​latex.ltx''​. Change directory to the first directory up (in this case ''​base''​). Then issue:
 +<code bash>
 +initex latex.ltx
 +</​code>​
 +and copy the resulting ''​latex.fmt''​ and ''​latex.log''​ to ''​texmf/​web2c''​.
 +
 +====== Hide Sections at Compile Time Using a Conditional ======
 +
 +First we create the conditional:​
 +<code latex>
 +\newif\ifanswers
 +</​code>​
 +
 +then we create a toggle:
 +<code latex>
 +\answerstrue % comment out to hide answers
 +</​code>​
 +
 +which will show the text in case it is not commented.
 +
 +Finally, any block that should not appear on the page can be surrounded by ''​\ifanswers''​ and ''​\fi'':​
 +
 +<code latex>
 +\ifanswers
 +The solution is here!
 +\fi
 +</​code>​
 +
 +====== Number Sets ======
 +
 +Number sets can be displayed using the ''​amsfonts''​ or the ''​amssymb''​ packages.
 +
 +^ Latex ^ Description ^
 +| ''​\mathbb{P}''​ | prime numbers $\mathbb{P}$ | 
 +| ''​\mathbb{W}''​ | whole numbers $\mathbb{W}$ |
 +| ''​\mathbb{N}''​ | natural numbers $\mathbb{N}$ |
 +| ''​\mathbb{Z}''​ | integers $\mathbb{Z}$ |
 +| ''​\mathbb{I}''​ | irrational numbers $\mathbb{I}$ |
 +| ''​\mathbb{Q}''​ | rational numbers $\mathbb{Q}$ |
 +| ''​\mathbb{R}''​ | real numbers $\mathbb{R}$ |
 +| ''​\mathbb{C}''​ | complex numbers $\mathbb{C}$ |

fuss/latex.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.