Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
tex:triky [2011/12/29 17:36] bejcek problem with hyperref internal names |
tex:triky [2019/09/09 16:37] (current) lauschmannova [pdf-a verification of theses] |
| ====== Central TeXLive distributions ====== |
| |
| If you are using TeXLive on your linux workstations you may use texlive-full portable installed in: |
| |
| /opt/texlive |
| |
| There are folders for several years backward up to the latest distribution. |
| |
| In order to use the shared TeX binaries from the command line, you may want to add the following line to your .bashrc: |
| |
| export PATH=/opt/texlive/2018/bin/x86_64-linux/:$PATH |
| |
| === Texstudio === |
| You may use {{ :latex:texlive-portable2018-full.zip |this}} config file for setting up **texstudio** to use version from 2018. |
| |
====== Tips and Tricks for LaTeX ====== | ====== Tips and Tricks for LaTeX ====== |
| |
| * see also [[::it-tricks#latex-pdf|IT-tricks with LaTeX and pdf]] |
* For the redefining the **header**, you can use | * For the redefining the **header**, you can use |
* ''\markboth'' -- two parameters (left and right page) or ''\markright'' with just one parameter | * ''\markboth'' -- two parameters (left and right page) or ''\markright'' with just one parameter |
* pseudocode //''algorithmicx''// | * pseudocode //''algorithmicx''// |
* trees: //''xytree''// (complicated), //''dtree''// (Obo, pstricks), //''xyling''// (Martin P., ''\B'' and ''\T'' must be relaxed) | * trees: //''xytree''// (complicated), //''dtree''// (Obo, pstricks), //''xyling''// (Martin P., ''\B'' and ''\T'' must be relaxed) |
* tables: //''xtab''// (better than ''longtable'' or ''supertabular''), //''tabulary''// (pretty wrapped text in autosized cells, similar to ''tabularx''), //''booktabs''// (no vertical lines, ''\toprule'', ''\midrule'', ''\bottomrule'' instead of ''\hline'') (all from this [[www.tug.org/pracjourn/2007-1/mori/mori.pdf|compendium]]) | * tables: //''xtab''// (better than ''longtable'' or ''supertabular''), //''tabulary''// (pretty wrapped text in autosized cells, similar to ''tabularx''), //''booktabs''// (no vertical lines, ''\toprule'', ''\midrule''/''\cmidrule'', ''\bottomrule'' instead of ''\hline''/''\cline'') (all from this [[http://www.tug.org/pracjourn/2007-1/mori/mori.pdf|compendium]]) |
* ''longtable'' or ''xtabular'' environment **cannot** be inside ''table'' environment. (Put it inside ''center'' instead, since you cannot use ''\centering'' as before.) | * ''longtable'' or ''xtabular'' environment **cannot** be inside ''table'' environment. (Put it inside ''center'' instead, since you cannot use ''\centering'' as before.) |
| * **Higher cells/rows in tables** can be achieved either by ''booktabs'' package, or (if you have to use **vertical lines** in tables) by inserting ''\toppadding'' and ''\bottompadding'' in every row:<code> |
| \newcommand\toppadding{\rule{0pt}{2.6ex}} |
| \newcommand\bottompadding{\rule[-1.2ex]{0pt}{0pt}} |
| ... |
| \hline |
| \toppadding First cell\bottompadding & Second cell & Third one \\ |
| \hline |
| ...</code> |
* ''hyperref'' package: | * ''hyperref'' package: |
* If some **links from ToC** point to **incorrect** objects (e.g. section III.2.5 points to the page where the section I.2.5 starts), then the problem is in internal hyperref naming convention (both section in the example are represented as 'section.2.5'). You can change it either by | * If some **links from ToC** point to **incorrect** objects (e.g. section III.2.5 points to the page where the section I.2.5 starts), then the problem is in internal hyperref naming convention (both section in the example are represented as 'section.2.5'). You can change it either by |
* ''naturalnames=true'' (=> 'section.III.2.5'), or | * ''naturalnames=true'' (=> 'section.III.2.5'), or |
* ''hypertexnames=false'' (=> 'section.289') | * ''hypertexnames=false'' (=> 'section.289') |
| * **New** type of **float** and its **List of**<code> |
| \usepackage{tocloft} |
| \newlistof{graphs}{grp}{List of Graphs} % new list, file extension, its name |
| \renewcommand{\cftgrptitlefont}{\sffamily\bfseries\huge} % style of list title |
| \setlength{\cftbeforegrptitleskip}{10ex} % space above list title |
| \setlength{\cftaftergrptitleskip}{4ex} % space below list title |
| % previous three lines alternatively (in pbmlbook class): \cfttitleset{grp} |
| \newlistentry{graph}{grp}{0} % one line of the list (because it will be of type 'graph', not 'graphs', due to float named 'graph') |
| \renewcommand{\cftgraphfont}{\sffamily} % entry style |
| \renewcommand{\cftgraphpagefont}{\sffamily} % page number style |
| \setlength{\cftgraphnumwidth}{2em} % space for graph number |
| % previous three lines alternatively (in pbmlbook class): \cftlineset{graph}{}{2em} |
| |
| \usepackage{float} |
| \newfloat{graph}{ht!}{grp} % new float environment {graph}, "place it here or at the top of page" by default |
| \floatname{graph}{Graph} % each caption is started as "Graph \thegraph: <captioin>" |
| ... |
| \begin{graph} |
| \centering |
| \includegraphics[scale=.8]{obr09} |
| \caption{Graph Caption}\label{graph:first} |
| \end{graph} |
| ... |
| \cleardoublepage\listofgraphs\phantomsection\addcontentsline{toc}{chapter}{List of Graphs}</code> |
| * **Crop** PDF **figure** by LaTeX<code> |
| \graphicspath{{./images/}} |
| \fbox{\includegraphics[scale=.4,trim=70 150 120 110,clip]{filename}}</code> |
| * it't left bottom right top and crop ''./images/filename.pdf''! |
| * ''fbox'' -- for debugging |
| * ''scale'' or ''width'' or ''height'' |
| * other useful: ''bb=10 10 10 10'', ''angle=45'', ''keepaspectratio'', ''draft'' |
| * Special counter/style/... in **enumerate**<code> |
| \renewcommand{\labelenumi}{\Alph{enumi}.} |
| \setcounter{lastenumi}{\theenumi} |
| \begin{enumerate} |
| \setcounter{enumi}{\thelastenumi} |
| ...</code> |
| |
==== počítání slov (a dalších věcí) ==== | ==== počítání slov (a dalších věcí) ==== |
| |
Podrobnosti v dokumentaci: ''texdoc texcount'' | Podrobnosti v dokumentaci: ''texdoc texcount'' |
| |
| ==== Fonts ==== |
| |
| * ''fc-list'' -- list of known fonts |
| * ''fc-list :lang=cs'' |
| * any font in ''~/.fonts'' is immediately found and ready for use |
| * other font directories can be specified in ''~/.fonts.conf'' in ''dir''-element: ''<dir>~/.fonts</dir>'' |
| |
<html><hr/></html> | <html><hr/></html> |
| |
Some PBML and SCTL-specific issues are [[https://wiki.ufal.ms.mff.cuni.cz/tex:pbml|here]]. | Some [[https://wiki.ufal.ms.mff.cuni.cz/tex:pbml|PBML]] and [[https://wiki.ufal.ms.mff.cuni.cz/tex:sctl|SCTL]]-specific issues can be found at these links. |
| |
| ====== pdf-a verification of theses ====== |
| All theses submitted at the Charles University must be in the pdf-a format, |
| following a specific set of requirements defined by a university profile. |
| `/lnet/ms/projects/verapdf/checkpdf` in the ufal internal network is a wrapper for the verapdf tool which you can use to check whether your thesis fulfills these requirements. New university profiles appear regularly at |
| https://cuni.cz/UK-7987.html , so don't rely on the default. |
| |
| [[vernerova@ufal.mff.cuni.cz|Anša's]] experience: |
| I used Eda's LaTeX template (send me an e-mail if you want to get it) and no amount of tweaking would give me a valid pdf-a, even though I was using |
| \usepackage[a-2u]{pdfx} |
| and compiling with a wrapper script containing the line |
| LC_ALL=cs_CZ.UTF-8 xelatex -shell-escape -output-driver="xdvipdfmx -z 0" -synctex=1 "$@" |
| I sent my pdf file to [[https://www.mff.cuni.cz/cs/fakulta/organizacni-struktura/lide?hdl=2684|Petra Hoffmannová from the library]], who ran my pdf file through Adobe Acrobat (the library has a commercial licence)... and voilà, it was a valid pdf-a. Unlike verapdf, Acrobat also gives a detailed summary of the exact issues with your file (like which piece of text in which image fails the validation). |