Latex: Difference between revisions

From Andreida
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Links ===
== Links ==
* [http://texblog.org/2011/02/26/generating-dummy-textblindtext-with-latex-for-testing/ Generating dummy text/blindtext with LaTeX for testing]
* [http://texblog.org/2011/02/26/generating-dummy-textblindtext-with-latex-for-testing/ Generating dummy text/blindtext with LaTeX for testing]


=== Misc ===
== Misc ==
* [Custom header/footer]
=== Custom header/footer ===
\documentclass{...}
\usepackage{fancyhdr}

\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{}

=== last page ===
\usepackage{lastpage}

Page \thepage~/~\pageref{LastPage} }

=== Umlaute ===
\usepackage[utf8]{inputenc}

=== pdf auto update ===
\usepackage{pdfsync}

=== Table with repeating header and wrapping rows ===
The wrapping occurs only at spaces (whitespaces?), so make sure you do not have words that are longer than the columns width.

Source: [http://tex.stackexchange.com/questions/153067/longtabu-column-width here]

<pre>
\documentclass{report}

\usepackage{longtable,tabu}

\begin{document}
\begin{longtabu} to \textwidth {
X[1,c]
X[1,c]
X[1,c]
X[10,l]}
\hline \hline
\textbf{Time End of Step} &
\textbf{Step} &
\textbf{Event} &
\textbf{Description}
\\ \hline \hline \hline \hline
\endhead % all the lines above this will be repeated on every page
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\

12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event \\
12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
\end{longtabu}
\end{document}

</pre>

=== epub ===
Make sure to have installed:
* tex4ht
* miktex-tex4ht
* tex4ebook
You will want to use the package manager for these three.

* create the .dvi
latex book.tex
* create the epub2
tex4ebook -f epub book
* or create the epub3 which is not readable by many e-book readers
tex4ebook -f epub3 book

Latest revision as of 13:12, 10 December 2017

Links

Misc

Custom header/footer

\documentclass{...}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{}

last page

\usepackage{lastpage}
Page \thepage~/~\pageref{LastPage} }

Umlaute

\usepackage[utf8]{inputenc}

pdf auto update

\usepackage{pdfsync}

Table with repeating header and wrapping rows

The wrapping occurs only at spaces (whitespaces?), so make sure you do not have words that are longer than the columns width.

Source: here

\documentclass{report}

\usepackage{longtable,tabu}

\begin{document}
	
	\begin{longtabu} to \textwidth {
			X[1,c]
			X[1,c]
			X[1,c]
			X[10,l]}
		\hline \hline
		\textbf{Time End of Step} & 
		\textbf{Step} & 
		\textbf{Event} &
		\textbf{Description} 
		\\ \hline \hline \hline \hline
		\endhead % all the lines above this will be repeated on every page
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\

		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event \\
		12:18:52 & 1 & 1 & this is a description for the event 1234567890x1234567890x123 4567890x1234567890x123456789 0x1234567890x1234 567890x1234567890x1234567890x1234567890x \\
		
	\end{longtabu}
\end{document}

epub

Make sure to have installed:

  • tex4ht
  • miktex-tex4ht
  • tex4ebook

You will want to use the package manager for these three.

  • create the .dvi
latex book.tex
  • create the epub2
tex4ebook -f epub book
  • or create the epub3 which is not readable by many e-book readers
tex4ebook -f epub3 book