parent_url
stringlengths
41
46
parent_score
stringlengths
1
4
parent_body
stringlengths
25
35.5k
parent_user
stringlengths
37
42
parent_title
stringlengths
12
150
accepted
bool
2 classes
body
stringlengths
4
36.7k
score
stringlengths
1
4
user
stringlengths
37
42
answer_id
stringlengths
1
6
__index_level_0__
int64
0
322k
https://tex.stackexchange.com/questions/1789
6
I use AUCTeX in my Mac Emacs, which is Aquamac 23.1. Typically in AUCTeX, when I type `C-c C-c` it runs `pdflatex`, then `C-c C-c` again and it opens it in a PDF viewer. But in this Aquamac emacs version, it renders the PDF right in the emacs buffer. How can I change that? I just want it to open the PDF in a PDF viewer (ideally, [Skim](http://skim-app.sourceforge.net/)) when I press `C-c C-c`.
https://tex.stackexchange.com/users/3860
Aquamac, AUCTeX should open PDF in external viewer, not render it in Emacs buffer
false
You need to customize Auctex: LaTeX -> Customize AucTeX -> TeX Command -> TeX Output View Style Click view, change the viewer for `^pdf` extension, "safe" for future sessions on the top and you are done.
0
https://tex.stackexchange.com/users/137
1791
1,255
https://tex.stackexchange.com/questions/1789
6
I use AUCTeX in my Mac Emacs, which is Aquamac 23.1. Typically in AUCTeX, when I type `C-c C-c` it runs `pdflatex`, then `C-c C-c` again and it opens it in a PDF viewer. But in this Aquamac emacs version, it renders the PDF right in the emacs buffer. How can I change that? I just want it to open the PDF in a PDF viewer (ideally, [Skim](http://skim-app.sourceforge.net/)) when I press `C-c C-c`.
https://tex.stackexchange.com/users/3860
Aquamac, AUCTeX should open PDF in external viewer, not render it in Emacs buffer
false
I don't know whether it is going to work, but try the following: ``` M-x customize-apropos RET ``` then write: ``` tex-view-program RET ``` This will bring two customisable options: `tex-view-program-selection` and `tex-view-program-list`. This is how I have set them The most important, I think, is the one I circled in red. If you click on the button `value menu` it should give you the option to put Skim. Remember to save your options by clicking on `set for current session` and `set for future sessions`, on the top of this same screen. If it doesn't work, try re-starting Emacs (after having saved the options, of course). **EDIT**: If you can't find it using the `customize-apropos` command, you can use the menu as shown here: Then scroll down until you find the options I mentioned above, i.e. `tex-view-program-selection` and `tex-view-program-list`, and change then accordingly.
6
https://tex.stackexchange.com/users/14
1792
1,256
https://tex.stackexchange.com/questions/1793
30
Is anybody aware of a simple way to place nodes at arbitrary positions along an ellipse? Ideally I would want to mimic notation like ``` \draw (0,0) ellipse [ x radius=2, y radius = 1] node[pos=.3] {Hi, I am a node.}; ``` But this does not work. It is possible to splice together four curves that will do a good approximation, for instance ``` \node[coordinate,name=top] at (0,3) {}; \node[coordinate,name=bottom] at (0,-3) {}; \node[coordinate,name=left] at (-5,0) {}; \node[coordinate,name=right] at (5,0) {}; \draw (left) .. controls ($(left)+(0,2)$) and ($(top)-(2,0)$) .. (top); \draw (left) .. controls ($(left)-(0,2)$) and ($(bottom)-(2,0)$) .. (bottom); \draw (right) .. controls ($(right)+(0,2)$) and ($(top)+(2,0)$) .. (top); \draw (right) .. controls ($(right)-(0,2)$) and ($(bottom)+(2,0)$) .. (bottom); ``` will give a decent approximation to ``` \draw (0,0) ellipse [ x radius=5, y radius = 3]; ``` Using this method I can then use the notation I wanted to use. But if I want to make several pictures with this method or make adjustments, then it can become a lot of work. Also, the control points I picked were from guess and check as opposed to some other knowledge (this is a fault I know) so for varying sizes I will need to guess and check each time. So I am hoping for something a little more compact.
https://tex.stackexchange.com/users/144
Placing nodes along an ellipse in TikZ
false
One thing you could do is create an elliptical node and then use the anchor points of that node. So for example, ``` \node[draw,ellipse,minimum height=2cm,minimum width=4cm] (a) at (0,0) {}; \node[above right] at (a.75) {Hi I am a node}; ``` Here `75` is the angle around the ellipse where you want the text node to be placed.
11
https://tex.stackexchange.com/users/125
1794
1,257
https://tex.stackexchange.com/questions/1773
15
I need to convert a LaTeX document to OpenOffice -> Word in order to allow cooperation with non-LaTeX users. I've tried two commands: ``` oolatex foo.tex ``` and ``` mk4ht oolatex foo.tex ``` In both cases tex4ht failed to produce the ODT or SWX file, but a number of temp files were produced (`foo.4ct`, `4od`, `4oo`, `4tc`, `foo-manifes.4of`, `foo-meta.4ot`, `foo-setting.4os`, `foo-styles.4oy`). From my study of `.env` file of TeX4ht it became obvious that those files should have been later converted into the `OO` file. Has anyone else encoutered that problem and found a solution? Edit: After using Lian Tze's suggestion I changed all the path in `tex4ht.env` file, but still no go, the error I received now is somehow connected to java which is completely outside my league. ``` C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>t4ht docum ent -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate ---------------------------- t4ht.c (2009-01-31-07:34 kpathsea) t4ht document -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate (C:/Program Files (x86)/MiKTeX 2.8/tex4ht/base/win32/tex4ht.env) Entering document.lg System call: move document.4oo document.tmp 1 file(s) moved. System return: 0 System call: java -classpath c:\Program Files (x86)\MiKTeX 2.8\tex4ht\bin\tex4h t.jar xtpipes -i c:\Program Files (x86)\MiKTeX 2.8\tex4ht\xtpipes\ -o document.4 oo document.tmp Exception in thread "main" java.lang.NoClassDefFoundError: Files Caused by: java.lang.ClassNotFoundException: Files at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files. Program will exit. --- Warning --- System return: 1 System call: mkdir sxw-document.dir\Pictures System return: 0 System call: move document-settings.4os sxw-document.dir\setti ngs.xml 1 file(s) moved. System return: 0 System call: move document-styles.4oy sxw-document.dir\styles.xml 1 file(s) moved. System return: 0 System call: mkdir sxw-document.dir\META-INF System return: 0 System call: move document-manifest.4of sxw-document.dir\META-INF\manifest.xml 1 file(s) moved. System return: 0 System call: move document-meta.4ot sxw-document.dir\meta.xml 1 file(s) moved. System return: 0 System call: cd sxw-document.dir & zip -r -m document.zip * & cd .. adding: META-INF/ (164 bytes security) (stored 0%) adding: META-INF/manifest.xml (164 bytes security) (deflated 66%) adding: meta.xml (164 bytes security) (deflated 58%) adding: Pictures/ (164 bytes security) (stored 0%) adding: settings.xml (164 bytes security) (deflated 46%) adding: styles.xml (164 bytes security) (deflated 91%) System return: 0 System call: move sxw-document.dir\document.zip document.odt 1 file(s) moved. System return: 0 System call: del document.4od System return: 0 System call: if exist sxw-document.dir rmdir /Q /S sxw-document.dir System return: 0 C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy> ``` Here is the log of the last converting operation...
https://tex.stackexchange.com/users/815
Converting LaTeX to OpenOffice
false
(The reputation system prevents me from commenting so an answer is the best I can do, sorry.) With such a small amount of text, a manual conversion (copying and pasting the text, possibly removing extraneous newlines) is probably the fastest way to go.
0
https://tex.stackexchange.com/users/647
1795
1,258
https://tex.stackexchange.com/questions/1796
24
I have seen LaTeX code that 1. puts a ~ between *every* math expression and the text preceding it, 2. does not use ~ in this manner at all, and 3. uses a ~ in this way if and only if the math expression is a number (i.e, consists of digits). I think the first way is not very nice, since it constrains TeX a lot in how it can typeset the rest of the text. I follow the third way, because I vaguely seem to remember reading somewhere that this is how it should be done; but I cannot recollect where, and I don't have any justification for this. What is the rule to follow here, and what are the typographical/TeX principles behind this rule? It would be great to have references too, to convince obstinate co-authors (if required!). Similarly, what is the reasoning behind the (almost universally observed) rule that a ~ should precede a \cite{}? Is *this* documented somewhere?
https://tex.stackexchange.com/users/155
What is the right way to use of non-breakable space before math expressions?
false
See chapter~14 of the TeXbook, where Knuth suggests the following ties: * Chapter~12 * Theorem~1.2 * Appendix~A * Figure~3 * Table~\hbox{B-8} * Lemmas 5 and~6 * Donald~E. Knuth * Luis~I. Trabb~Pardo * Bartel~Lendert van~der~Waerden * Charles~XII * Charles Louis Xavier~Joseph de~la Vall\'ee~Poussin * dimension~$d$ * width~$w$ * function~$f(x)$ * string~$s$ of length~$l$ * string~$s$ of length $l$~or more * 1,~2, or~3 * $a$,~$b$, and~$c$. * 1,~2, \dots,~$n$. * of~$x$ * from 0 to~1 * increase $z$ by~1 * in common with~$m$ * of $u$~and~$v$. * equals~$n$ * less than~$\epsilon$ * (given~$X$) * mod~2 * modulo~$p^e$ * for all large~$n$ * is~15 * is 15~times the height * (b)~Show that $f(x)$ is (1)~continuous; (2)~bounded There are even more examples in the exercises, but that covers most cases...
32
https://tex.stackexchange.com/users/627
1797
1,259
https://tex.stackexchange.com/questions/1754
6
I use TexniCentre and Miktex 2.8 in Windows XP. I would like to typeset Tamil text, and so far I've been unsuccessful. Please suggest me a working TeX/LaTex/variants setup for Tamil language. Thanks for any help in advance.
https://tex.stackexchange.com/users/nan
Tamil Tex in windows
false
(Recommended) The XeLaTeX/LuaLaTeX way with polyglossia ------------------------------------------------------- You'll need a Tamil font installed on your *operating system*; I used Noto Serif Tamil and Noto Sans Tamil as example below. ``` \usepackage{polyglossia} \setmainlanguage{tamil} \setotherlanguage{english} %% OPTIONAL if you have some English text in your book %% Select fonts for Tamil \newfontfamily\tamilfont[Script=Tamil]{Noto Serif Tamil} \newfontfamily\tamilfontsf[Script=Tamil]{Noto Sans Tamil} %% OPTIONAL; Select fonts for English \setmainfont{Times New Roman} \setsansfont{Arial} ``` Then compile the document with `xelatex` or `lualatex`. The pdfLaTeX way with the itrans package ---------------------------------------- Typesetting Tamil is possible with the [`itrans`](http://tug.ctan.org/tex-archive/language/indian/itrans/) pakcage, but it's not packaged properly in MikTeX. You will need to install it manually. Download [`itrans53-win32.zip`](http://mirror.ctan.org/language/indian/itrans/itrans53-win32.zip) from CTAN. After unzipping the contents (say `C:\itrans53\`), assuming `<texmf>` being your local TEXMF tree, * Move the contents of the `lib` folder into `<texmf>\tex\latex\itrans` * Move the contents of the `fonts` folder into the appropriate locations, i.e. + `*.mf` in `<texmf>\fonts\source\itrans` + `*.afm` in `<texmf>\fonts\afm\itrans` + `*.tfm` in `<texmf>\fonts\tfm\itrans` + `*.pfb, *.pfa, *.pfm` in `<texmf>\fonts\type1\itrans` + `*.ttf` in `<texmf>\fonts\truetype\itrans` * Refresh the file name database (e.g. via MikTeX Options/Settings) Then try out the minimal example I gave in my answer to [this related question](https://tex.stackexchange.com/questions/319/latex-xetex-setup-tamil-indic-languages). You would need to evoke `itrans.exe` in the `itrans53\bin` folder. (However I'm not sure if it works in 64-bit Windows.)
6
https://tex.stackexchange.com/users/226
1798
1,260
https://tex.stackexchange.com/questions/1412
5
I've tried using both `algorithm2e` and `algorithmic` to generate a list of algorithms, but they both do it this way: ``` List of Algorithms 1 BFS ..... 1 2 DFS ..... 2 ... ``` When I'd like to it to be: ``` List of Algorithms Algorithm 1 BFS ..... 1 Algorithm 2 DFS ..... 2 ... ``` The packages being used: ``` \documentclass[pnumabnt,normaltoc,capchap,floatnumber=continuous]{abnt} \usepackage[bibjustif,abnt-etal-cite=2,abnt-full-initials=yes]{abntcite} \usepackage[toc,page]{modelo/tex/appendix} \usepackage[portuguese,brazilian,portuges]{babel} \usepackage[utf8]{inputenc} \usepackage{abnt-alf} \usepackage{graphicx} \usepackage{multicol} \usepackage{listings} \usepackage{booktabs} \usepackage{amsmath} \usepackage{amsthm} \usepackage{eucal} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage[portugues]{algorithm2e} ```
https://tex.stackexchange.com/users/572
Is it possible to change the way a list of algorithms is generated to include the word "Algorithm" before each element in the list?
false
The construction of the List of Algorithms uses the `\l@algocf` macro (or at least when I use the `algorithm2e` package it does). This may be slightly different depending on your algorithm package/settings/... Anyway, you could place the following in the preamble in order to change the way that lines in the TOC are drawn: ``` \makeatletter \let{\oldl@algocf}{\l@algocf} \renewcommand{\l@algocf}[2]{\oldl@algocf{Algorithm #1}{#2}} \makeatother ``` * The first and last lines simply allow you to use the `@` character in macro names. * The second line makes a copy of the original `\l@algocf` macro (so you can call it on the 3rd line) * The third line redefines the `\l@algocf` macro to insert the word Algorithm before the first argument (the caption text) in the TOC line.
1
https://tex.stackexchange.com/users/644
1799
1,261
https://tex.stackexchange.com/questions/1796
24
I have seen LaTeX code that 1. puts a ~ between *every* math expression and the text preceding it, 2. does not use ~ in this manner at all, and 3. uses a ~ in this way if and only if the math expression is a number (i.e, consists of digits). I think the first way is not very nice, since it constrains TeX a lot in how it can typeset the rest of the text. I follow the third way, because I vaguely seem to remember reading somewhere that this is how it should be done; but I cannot recollect where, and I don't have any justification for this. What is the rule to follow here, and what are the typographical/TeX principles behind this rule? It would be great to have references too, to convince obstinate co-authors (if required!). Similarly, what is the reasoning behind the (almost universally observed) rule that a ~ should precede a \cite{}? Is *this* documented somewhere?
https://tex.stackexchange.com/users/155
What is the right way to use of non-breakable space before math expressions?
true
The physical effect you would get from a line break at some point is a small pause / distraction in reading, so what I do is use a mental trick: imagine how the sentence sounds with a small pause in the trouble spot(s) when read out loud. Some cases are clearer than others, but in general that works fairly well for me. Occasionally I see something in the typeset output that looks bad visually even though it sounds OK, then I correct the ties in the input to fix that one break. As the problem is related to the actual language you are using, you could also ask this question on [english.stackexchange.com](http://english.stackexchange.com)
17
https://tex.stackexchange.com/users/89
1800
1,262
https://tex.stackexchange.com/questions/1789
6
I use AUCTeX in my Mac Emacs, which is Aquamac 23.1. Typically in AUCTeX, when I type `C-c C-c` it runs `pdflatex`, then `C-c C-c` again and it opens it in a PDF viewer. But in this Aquamac emacs version, it renders the PDF right in the emacs buffer. How can I change that? I just want it to open the PDF in a PDF viewer (ideally, [Skim](http://skim-app.sourceforge.net/)) when I press `C-c C-c`.
https://tex.stackexchange.com/users/3860
Aquamac, AUCTeX should open PDF in external viewer, not render it in Emacs buffer
false
AUCTeX actually has code for handling viewers on darwin system but somehow it is commented out. I have been using the following patch in AUCTeX: <http://paste.pocoo.org/show/250752/> and haven't found a problem. I will find time to encourage upstream to do the same.
0
https://tex.stackexchange.com/users/337
1802
1,263
https://tex.stackexchange.com/questions/1801
32
I am wondering if there is any tool that can help me work with tables in LaTeX. Specifically I'd like to be able to import HTML tables (or small Excel tables) into LateX Are there tools that can help me do that painlessly?
https://tex.stackexchange.com/users/230
Tool for manipulating LaTeX tables (HTML to LaTeX)
false
I think that, if you are able to import your html tables in Excel or OpenOffice Calc, these tools are what you need: * [Excel2LaTeX](http://www.ctan.org/tex-archive/support/excel2latex/) for MSExcel * [Calc2LaTeX](http://extensions.services.openoffice.org/en/project/Calc2LaTeX) for OO Calc (this one is my preferred, guess why ;) The first one is a macro you add to your Excel, and provides you with an extra button to create the LaTeX code for the table from a set of selected cells, ready to be pasted in your .tex source. The second, is an extension of OO, but should work in the same way. Edit: there is also [html2LaTeX](http://html2latex.sourceforge.net/), but I never used it. Happy TeXing!
27
https://tex.stackexchange.com/users/177
1803
1,264
https://tex.stackexchange.com/questions/1801
32
I am wondering if there is any tool that can help me work with tables in LaTeX. Specifically I'd like to be able to import HTML tables (or small Excel tables) into LateX Are there tools that can help me do that painlessly?
https://tex.stackexchange.com/users/230
Tool for manipulating LaTeX tables (HTML to LaTeX)
false
Check out this page <http://www.ctan.org/tex-archive/help/Catalogue/entries/datatool.html> and tools it links ie `csvtools` and `pgfplotstable`. They allow you to keep the data in csv or tsv format and configure typesetting options in .tex source. I have used pgfplotstable and it is very handy.
12
https://tex.stackexchange.com/users/337
1804
1,265
https://tex.stackexchange.com/questions/1793
30
Is anybody aware of a simple way to place nodes at arbitrary positions along an ellipse? Ideally I would want to mimic notation like ``` \draw (0,0) ellipse [ x radius=2, y radius = 1] node[pos=.3] {Hi, I am a node.}; ``` But this does not work. It is possible to splice together four curves that will do a good approximation, for instance ``` \node[coordinate,name=top] at (0,3) {}; \node[coordinate,name=bottom] at (0,-3) {}; \node[coordinate,name=left] at (-5,0) {}; \node[coordinate,name=right] at (5,0) {}; \draw (left) .. controls ($(left)+(0,2)$) and ($(top)-(2,0)$) .. (top); \draw (left) .. controls ($(left)-(0,2)$) and ($(bottom)-(2,0)$) .. (bottom); \draw (right) .. controls ($(right)+(0,2)$) and ($(top)+(2,0)$) .. (top); \draw (right) .. controls ($(right)-(0,2)$) and ($(bottom)+(2,0)$) .. (bottom); ``` will give a decent approximation to ``` \draw (0,0) ellipse [ x radius=5, y radius = 3]; ``` Using this method I can then use the notation I wanted to use. But if I want to make several pictures with this method or make adjustments, then it can become a lot of work. Also, the control points I picked were from guess and check as opposed to some other knowledge (this is a fault I know) so for varying sizes I will need to guess and check each time. So I am hoping for something a little more compact.
https://tex.stackexchange.com/users/144
Placing nodes along an ellipse in TikZ
false
You can let TikZ calculate the position of the node for you: ``` \usetikzlibrary{calc} \begin{tikzpicture} \draw (2,0) ellipse (2 and 1); \node at ($(2,0)+(75:2 and 1)$) {a node}; \end{tikzpicture} ``` The key here is that `(75:2 and 1)` is the position at 75 degrees on an ellipse with axis lengths 2 and 1 centered at (0,0). The (2,0) is just an example how you get an off-center position.
38
https://tex.stackexchange.com/users/83
1805
1,266
https://tex.stackexchange.com/questions/1750
36
I want to attach a footnote to each author of a paper and write that their research was supported by different grants. How do I do that? Simply `\footnote` after each author does not work.
https://tex.stackexchange.com/users/nan
How to write a footnote attached to the author in a LaTeX paper?
false
I've been doing something similar to have different authors with the same affiliation and have adapted an example from [Anthony Liekens](http://anthony.liekens.net/index.php/LaTeX/MultipleFootnoteReferences). ``` \documentclass{article} \usepackage{hyperref} \newcommand{\footremember}[2]{% \footnote{#2} \newcounter{#1} \setcounter{#1}{\value{footnote}}% } \newcommand{\footrecall}[1]{% \footnotemark[\value{#1}]% } \title{How to bowl properly} \author{% The Dude\footremember{alley}{Holly Star Lanes Bowling Alley}% \and Walter Sobchak\footremember{trailer}{probably in a trailer park}% \and Jesus Quintana\footrecall{alley} \footnote{Mexico?}% \and Uli Kunkel\footrecall{trailer} \footnote{Germany?}% } \begin{document} \maketitle The whole example is taken from \href{http://anthony.liekens.net/index.php/LaTeX/MultipleFootnoteReferences}{anthony liekens}\ldots \end{document} ```
4
https://tex.stackexchange.com/users/828
1807
1,267
https://tex.stackexchange.com/questions/1806
6
If you look at older documents the `\mathbb` characters appear different. For example they are sans serif. I don't know how I can use that set of characters instead of the current default. If you are not sure what version I am talking about load the package fourier and then use `\mathbb{C}` for example to see the difference. No other package beside fourier does that and I want to know how to do it with other packages.
https://tex.stackexchange.com/users/809
How can you change \mathbb characters to the old version?
true
The following is a hack that seems to do the work, it actually comes from the source of the `fourier` package. ``` \documentclass{article} \DeclareFontFamily{U}{futm}{} \DeclareFontShape{U}{futm}{m}{n}{ <-> s * [.92] fourier-bb }{} \DeclareSymbolFont{Ufutm}{U}{futm}{m}{n} \DeclareSymbolFontAlphabet{\mathbb}{Ufutm} \begin{document} Hello World $\mathbb{C}$ \end{document} ```
3
https://tex.stackexchange.com/users/169
1808
1,268
https://tex.stackexchange.com/questions/1806
6
If you look at older documents the `\mathbb` characters appear different. For example they are sans serif. I don't know how I can use that set of characters instead of the current default. If you are not sure what version I am talking about load the package fourier and then use `\mathbb{C}` for example to see the difference. No other package beside fourier does that and I want to know how to do it with other packages.
https://tex.stackexchange.com/users/809
How can you change \mathbb characters to the old version?
false
You could try using the [msym](http://www.ctan.org/tex-archive/fonts/msym/) package, which provides an older version of the AMS blackboard bold font (but it only has the letters C, N, R, S, Z).
1
https://tex.stackexchange.com/users/232
1809
1,269
https://tex.stackexchange.com/questions/1806
6
If you look at older documents the `\mathbb` characters appear different. For example they are sans serif. I don't know how I can use that set of characters instead of the current default. If you are not sure what version I am talking about load the package fourier and then use `\mathbb{C}` for example to see the difference. No other package beside fourier does that and I want to know how to do it with other packages.
https://tex.stackexchange.com/users/809
How can you change \mathbb characters to the old version?
false
The [Symbols Guide](http://www.ctan.org/pkg/comprehensive) has the following suggestions for blackboard bold fonts: In particular, `bbold`, `mathbbol` and `mbboard` provide sans-serif fonts. The last two also provide additional symbols in blackboard bold.
8
https://tex.stackexchange.com/users/83
1810
1,270
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
false
I'm of the idea that, whenever possible, you should stick to `utf8` (unicode) as it is finally *the* solution about character encodings on computer documents. Of course you only have to make sure that your text editor supports and behaves nicely with unicode documents. In either case, if you have to work with collaborators, you have to make sure that they *do* also use decent text editors that can handle the appropriate encoding without messing with the special characters. For documents with many collaborators I've learned the hard way that it is better to stick to `ascii` and use (La)TeX commands to produce special characters.
10
https://tex.stackexchange.com/users/169
1812
1,271
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
false
Short answer: If your editor can use Unicode (and in my opinion any good editor should save files as UTF-8 by default), then use Unicode. The main advantage of Unicode (and its main encoding UTF-8) is that it makes text files universally readable: Someone writing German umlauts can use the same encoding as someone writing Korean. Prior to that, when obtaining a a text file, there was no way to know which character encoding to apply to it: Latin 1? or Latin 9? or maybe a Russian encoding? Also for documents that use more than 256 different characters, UTF-8 is very useful. With it you can for example use both "ü" and "ł" in the same text (as I do here). Both modern (experimental) TeX compilers (LuaTeX and XeTeX) use Unicode/UTF-8 by default as do modern programming languages (i.e. .NET) and operating systems.
24
https://tex.stackexchange.com/users/83
1813
1,272
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
false
One of the advantages of using utf8 for source files is it is friendly towards version control tools. For example, if you have the source in latin-1, then most of latin-1 chars will show up as \267, \320 etc. when diffing.
6
https://tex.stackexchange.com/users/337
1816
1,273
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
true
If you can: do not use `\usepackage[utf8]{inputenc}` nor `\usepackage[latin1]{inputenc}`. Use LuaTeX: ``` \documentclass{article} \usepackage{luaotfload} \usepackage[EU2]{fontenc} \usepackage{lmodern} \begin{document} Das Mädchen ging über die \textbf{Brücke} nach \textit{draußen}. \end{document} ``` This will give you access to all modern things (OpenType fonts for example) while keeping most of the backward compatibility. Wait for TeXlive 2010 (or get the pretest) and you have a decent environment for LuaTeX. Million thanks to the few people who make the LuaLaTeX packages! If you are able to read german: see the site <http://www.luatex.org> for more examples (especially on `fontspec`).
15
https://tex.stackexchange.com/users/243
1817
1,274
https://tex.stackexchange.com/questions/1818
12
I need to be able to connect any arbitrary nodes in a tree to each other. I am using the tree package in tikz to create my tree. I cannot figure out though how to connect to nodes by let say a draw or path command. here is a minimal example. Let say I like to connect node F to node D, any suggestions would be truly appreciated. Artimess ``` \documentclass[10pt]{book} \usepackage{tikz} \usetikzlibrary{backgrounds} \usetikzlibrary{trees,positioning,arrows} \begin{document} \begin{tikzpicture}[scale=0.8,font=\small, edge from parent fork down, every node/.style={fill=blue!10}, edge from parent/.style={red,thick,draw}, level 1/.style={sibling distance=8cm}, level 2/.style={sibling distance=4.5cm}] \node {A} child {node {B} child {node {C} } child {node {D} child{node{E}}}} child {node {F} child {node {G}} }; \end{tikzpicture} \end{document} ```
https://tex.stackexchange.com/users/833
How two connect any arbitrary nodes of tree in tikz
false
I find that adding labels to the nodes makes this work. Note the `(D)` and `(F)` in the syntax for the corresponding nodes. ``` \documentclass[10pt]{book} \usepackage{tikz} \usetikzlibrary{backgrounds} \usetikzlibrary{trees,positioning,arrows} \begin{document} \begin{tikzpicture}[scale=0.8,font=\small, edge from parent fork down, every node/.style={fill=blue!10}, edge from parent/.style={red,thick,draw}, level 1/.style={sibling distance=8cm}, level 2/.style={sibling distance=4.5cm}] \node {A} child {node {B} child {node {C} } child {node (D) {D} child{node{E}}}} child {node (F) {F} child {node {G}} }; \draw (F) -- (D); \end{tikzpicture} \end{document} ``` (Though I don't discount the possibility that trees have an *implicit* labelling system in the same fashion as matrices.)
13
https://tex.stackexchange.com/users/86
1819
1,275
https://tex.stackexchange.com/questions/1820
46
I am using KOMA-Script (`scrreprt`) and `hyperref`. The PDF bookmarks are generated nicely from the table of contents, but I would like an extra *Contents* bookmark to point to the table of contents itself (without including an entry in the table of contents) - like the KOMA manual itself. (Also list of figures and list of tables if I include them) What is the best way to do this? I could add a `\pdfbookmark` manually but I'm not sure how to get it to point correctly to the start of the section - if I do it after it will be on the wrong page (multipage toc), if I do before it will be the page before (since `\tableofcontents` does `\cleardoublepage`?). I guess I have to redefine `\tableofcontents` somehow.
https://tex.stackexchange.com/users/759
Contents in PDF bookmarks
true
The following code should create a correct ToC bookmark for both `scrreprt` and `scrbook`: ``` \makeatletter \usepackage{etoolbox} \pretocmd{\tableofcontents}{% \if@openright\cleardoublepage\else\clearpage\fi \pdfbookmark[0]{\contentsname}{toc}% }{}{}% \makeatother ```
17
https://tex.stackexchange.com/users/510
1821
1,276
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
false
In short: * utf8 supports much more characters than latin1. * utf8 is multilingual and cross-platform spread, latin1 is mainly used on Windows. Unicode, which is supported by utf8, is international standard and it shall support all languages and shall handle all kinds of writing. utf8 is the widest spread encoding for Unicode and it is backwards-compatible with ASCII (in contrary to other Unicode encodings). In utf8, each character is represented by 1 to 4 bytes. That's why the number of possible symbols is really huge. latin1 uses just one byte, beeing limited to a maximum of 256 characters. I think it uses just 191 of 256 possible. So, utf8 might be already be favourable if you use just one platform. utf8 is the standard encoding on Linux and Mac OS X. The number of LaTeX editors supporting utf8 on Windows increased, for instance TeXworks uses it by default. If there's a possibility that anybody, including you, would open your document on a Mac or on Linux, I recommend to use utf8. This already concerns german umlauts.
8
https://tex.stackexchange.com/users/213
1822
1,277
https://tex.stackexchange.com/questions/1814
37
Has anyone written an interface through which I can get a citation of a book/paper from [amazon.com](http://amazon.com)? Thanks for the suggestions from fellow users. I'm updating the questions to detail in more specifics: * Citeulike.org issue: I used BibTeX "Export from my library" features. However it's not that accurate... it cannot extract all meta-data from amazon and complete the bibliographic reference. * Mendeley Desktop: I used <http://www.mendeley.com/blog/academic-features/mendeley-bookmarklet-released-one-click-import-from-google-scholar-pubmed-arxiv-acm-ieee-etc/>. This is a long way round, I want something where I give the URL and it gives me back the BibTeX entry.
https://tex.stackexchange.com/users/637
How do I get BibTeX entries from amazon.com?
false
Check out [zotero.org](http://www.zotero.org/). You'll find bib/bibtex discussions in the forums and useful information spread across the web (e.g., [here](http://www.curiousjason.com/zoterotobibtex.html)).
17
https://tex.stackexchange.com/users/416
1823
1,278
https://tex.stackexchange.com/questions/1820
46
I am using KOMA-Script (`scrreprt`) and `hyperref`. The PDF bookmarks are generated nicely from the table of contents, but I would like an extra *Contents* bookmark to point to the table of contents itself (without including an entry in the table of contents) - like the KOMA manual itself. (Also list of figures and list of tables if I include them) What is the best way to do this? I could add a `\pdfbookmark` manually but I'm not sure how to get it to point correctly to the start of the section - if I do it after it will be on the wrong page (multipage toc), if I do before it will be the page before (since `\tableofcontents` does `\cleardoublepage`?). I guess I have to redefine `\tableofcontents` somehow.
https://tex.stackexchange.com/users/759
Contents in PDF bookmarks
false
A general way for base classes using `\addtocontents` would be: ``` \addtocontents{toc}{\protect{\pdfbookmark[0]{\contentsname}{toc}}} ``` Similar for lof and lot with `\listfigurename` and `\listtablename`. But, since KOMA-Script uses `tocbasic`, this would be better way and very simple: ``` \BeforeTOCHead[toc]{{\pdfbookmark[0]{\contentsname}{toc}}} ``` Just this line will get you the bookmark for the table of contents. Here's a compilable example, where `\BeforeTOCHead` is used to create bookmarks for *all* such lists like toc, lof and lot. ``` \documentclass{scrbook} \usepackage{hyperref} \makeatletter \BeforeTOCHead{% \cleardoublepage \edef\@tempa{% \noexpand\pdfbookmark[0]{\list@fname}{\@currext}% }\@tempa } \makeatother \begin{document} \tableofcontents \listoffigures \listoftables \chapter{One} text \end{document} ``` No redefinition of `\tableofcontents` and no etoolbox would be required. Different names by babel are supported.
40
https://tex.stackexchange.com/users/213
1824
1,279
https://tex.stackexchange.com/questions/1825
8
When writing papers, I like to keep track of notes, thoughts and to do's inside the documents. I'd love to have tiny coloured multi-line marginalia. So far I used sth like ``` \newcommand{\mymarginnote}[1]{\marginpar{\begin{spacing}{0.8}\textcolor{red}{\scriptsize{#1}}\end{spacing}}} ``` to have a red side-note, but the single-spacing does not work. How can I have this marginalia single-spaced (or less)? And is it possible to have the text with a yellow background? The `\colorbox{}` command doesn't seem to wrap the text. I'd also be interested how you keep track of notes and thoughts within your documents... Thanks!
https://tex.stackexchange.com/users/nan
Single-spaced multi-line marginalia
true
You could use `\setstretch` and `\parbox` inside `\colorbox`. Here's an example, using even smaller stretch value to make the effect more visible: ``` \documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage[svgnames]{xcolor} \usepackage[doublespacing]{setspace} \newcommand{\mymarginnote}[1]{% \marginpar{\colorbox{yellow}{\parbox{\marginparwidth}{% \setstretch{0.5}\textcolor{red}{\scriptsize{#1}}}}}} \begin{document} \blindtext \mymarginnote{Some text in the margin spanning several lines} \blindtext \end{document} ``` The output looks like:
7
https://tex.stackexchange.com/users/213
1826
1,280
https://tex.stackexchange.com/questions/1773
15
I need to convert a LaTeX document to OpenOffice -> Word in order to allow cooperation with non-LaTeX users. I've tried two commands: ``` oolatex foo.tex ``` and ``` mk4ht oolatex foo.tex ``` In both cases tex4ht failed to produce the ODT or SWX file, but a number of temp files were produced (`foo.4ct`, `4od`, `4oo`, `4tc`, `foo-manifes.4of`, `foo-meta.4ot`, `foo-setting.4os`, `foo-styles.4oy`). From my study of `.env` file of TeX4ht it became obvious that those files should have been later converted into the `OO` file. Has anyone else encoutered that problem and found a solution? Edit: After using Lian Tze's suggestion I changed all the path in `tex4ht.env` file, but still no go, the error I received now is somehow connected to java which is completely outside my league. ``` C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>t4ht docum ent -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate ---------------------------- t4ht.c (2009-01-31-07:34 kpathsea) t4ht document -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate (C:/Program Files (x86)/MiKTeX 2.8/tex4ht/base/win32/tex4ht.env) Entering document.lg System call: move document.4oo document.tmp 1 file(s) moved. System return: 0 System call: java -classpath c:\Program Files (x86)\MiKTeX 2.8\tex4ht\bin\tex4h t.jar xtpipes -i c:\Program Files (x86)\MiKTeX 2.8\tex4ht\xtpipes\ -o document.4 oo document.tmp Exception in thread "main" java.lang.NoClassDefFoundError: Files Caused by: java.lang.ClassNotFoundException: Files at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files. Program will exit. --- Warning --- System return: 1 System call: mkdir sxw-document.dir\Pictures System return: 0 System call: move document-settings.4os sxw-document.dir\setti ngs.xml 1 file(s) moved. System return: 0 System call: move document-styles.4oy sxw-document.dir\styles.xml 1 file(s) moved. System return: 0 System call: mkdir sxw-document.dir\META-INF System return: 0 System call: move document-manifest.4of sxw-document.dir\META-INF\manifest.xml 1 file(s) moved. System return: 0 System call: move document-meta.4ot sxw-document.dir\meta.xml 1 file(s) moved. System return: 0 System call: cd sxw-document.dir & zip -r -m document.zip * & cd .. adding: META-INF/ (164 bytes security) (stored 0%) adding: META-INF/manifest.xml (164 bytes security) (deflated 66%) adding: meta.xml (164 bytes security) (deflated 58%) adding: Pictures/ (164 bytes security) (stored 0%) adding: settings.xml (164 bytes security) (deflated 46%) adding: styles.xml (164 bytes security) (deflated 91%) System return: 0 System call: move sxw-document.dir\document.zip document.odt 1 file(s) moved. System return: 0 System call: del document.4od System return: 0 System call: if exist sxw-document.dir rmdir /Q /S sxw-document.dir System return: 0 C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy> ``` Here is the log of the last converting operation...
https://tex.stackexchange.com/users/815
Converting LaTeX to OpenOffice
false
I have the same problem. For documents that aren't too complex, I often render the LaTeX as a PDF, and then use one of the PDF-to-Word coverters to make a Word document. For many jobs that works quite well, although if you have mathematical formulas, tables, or other complicated formatting, you will probably need to do some editing of the target document.
2
https://tex.stackexchange.com/users/837
1827
1,281
https://tex.stackexchange.com/questions/1825
8
When writing papers, I like to keep track of notes, thoughts and to do's inside the documents. I'd love to have tiny coloured multi-line marginalia. So far I used sth like ``` \newcommand{\mymarginnote}[1]{\marginpar{\begin{spacing}{0.8}\textcolor{red}{\scriptsize{#1}}\end{spacing}}} ``` to have a red side-note, but the single-spacing does not work. How can I have this marginalia single-spaced (or less)? And is it possible to have the text with a yellow background? The `\colorbox{}` command doesn't seem to wrap the text. I'd also be interested how you keep track of notes and thoughts within your documents... Thanks!
https://tex.stackexchange.com/users/nan
Single-spaced multi-line marginalia
false
Have you considered using `\linespread`, e.g., ``` \let\oldmarginpar\marginpar \renewcommand\marginpar[1]{% {\linespread{0.85}\normalfont\scriptsize% \oldmarginpar[\vspace{-1.5ex}\raggedright\scriptsize\color{red}\textsf{#1}]% {\vspace{-1.5ex}\raggedright\scriptsize\color{green}\textsf{#1}}% }% } ``` Of course, just adjust the `\linespread` factor to tighten things up (note that it's tucked inside a new `{...}` group). To make things interesting, I've redefined `\marginpar` to show that you can format each side differently in `twoside` docs. While I was at it, I adjusted the vertical position of the margin note up a notch to better align its baseline with the body text it relates to. I omitted the `\colorbox` command you were interested in since Stefan's answer made its usage pretty clear.
1
https://tex.stackexchange.com/users/416
1828
1,282
https://tex.stackexchange.com/questions/1815
8
Is there a software which can parse pdfs and extract bibliographic references? ACM DL is a web service which can give that info like here: <http://portal.acm.org/citation.cfm?id=296806.296823&coll=ACM&dl=ACM&CFID=98288669&CFTOKEN=12911537> Mendeley's current release can't do this, would someone confirm: [link](http://feedback.mendeley.com/forums/4941-mendeley-feedback/suggestions/834313-version-0-9-7-does-not-extract-references-from-the) > > Hello - This feature was removed in > 0.9.7 because it was consuming a fair amount of resources (client and server > side) without providing enough value. > We plan to re-introduce it in an > improved form in future > > >
https://tex.stackexchange.com/users/637
Extract bibliographic references from pdf files to a bib file
false
Try [cb2bib](http://www.molspaces.com/cb2bib/).
1
https://tex.stackexchange.com/users/627
1829
1,283
https://tex.stackexchange.com/questions/1830
16
What is the quickest way to check (on Linux) whether I already have a given package? In particular I'm interested in whether there is something that will take less time than the 20 seconds or so it would take me to create a tiny latex document and try to compile it.
https://tex.stackexchange.com/users/206
What is the quickest way to check whether I already have a given package?
true
``` kpsewhich pkgname.sty kpsewhich clsname.cls ```
25
https://tex.stackexchange.com/users/416
1831
1,284
https://tex.stackexchange.com/questions/1830
16
What is the quickest way to check (on Linux) whether I already have a given package? In particular I'm interested in whether there is something that will take less time than the 20 seconds or so it would take me to create a tiny latex document and try to compile it.
https://tex.stackexchange.com/users/206
What is the quickest way to check whether I already have a given package?
false
The standard tool works not only on Linux but also on Windows systems: at the command prompt, the command ``` kpsewhich name.sty ``` prints path and file name of one file `name.sty` if it can be found, otherwise nothing. ``` kpsewhich -all name.sty ``` prints all occurences if there are several (try `kpsewhich -all texmf.cnf`). It uses ls-R files but could search the disk as well if you specify the option -must-exist. kpsewhich recognizes a lot of format names. Beside tex formats like .cls, .sty, .tex it finds font files, bib files and many more. Type ``` kpsewhich --help ``` or ``` man kpsewhich ``` to learn more or have a look at this [kpsewhich manpage](http://texblog.net/hypertext-help/latex-tools/kpsewhich/). This standalone program belongs to the kpathsea library. To read about it, type ``` texdoc kpathsea ``` at the command prompt. As you may know, texdoc is another very useful command for the shell.
13
https://tex.stackexchange.com/users/213
1832
1,285
https://tex.stackexchange.com/questions/1833
7
> > **Possible Duplicate:** > > [How to split all BibTeX referenced entries from a big BibTeX database to a copy?](https://tex.stackexchange.com/questions/417/how-to-split-all-bibtex-referenced-entries-from-a-big-bibtex-database-to-a-copy) > > > I have one big `foo.bib` file that contains all my references. Every one of my different LaTeX documents uses this with `\bibliography{foo}` and cites only a subset of the contained references. Is there a good script that takes one of my LaTeX documents (including everything it includes using `\input`) and extracts all the items in `foo.bib` that are cited? In other words, I'd like to filter the big `foo.bib` file using a LaTeX document so that only the cited bibliography items survive.
https://tex.stackexchange.com/users/3860
Filter .bib file for items that are actually used with \cite?
false
I think there are some perl scripts doing that. But I use [RefTeX](http://www.gnu.org/software/auctex/reftex.html) which offers a function `reftex-create-bibtex-file` that does just that.
4
https://tex.stackexchange.com/users/337
1834
1,286
https://tex.stackexchange.com/questions/1833
7
> > **Possible Duplicate:** > > [How to split all BibTeX referenced entries from a big BibTeX database to a copy?](https://tex.stackexchange.com/questions/417/how-to-split-all-bibtex-referenced-entries-from-a-big-bibtex-database-to-a-copy) > > > I have one big `foo.bib` file that contains all my references. Every one of my different LaTeX documents uses this with `\bibliography{foo}` and cites only a subset of the contained references. Is there a good script that takes one of my LaTeX documents (including everything it includes using `\input`) and extracts all the items in `foo.bib` that are cited? In other words, I'd like to filter the big `foo.bib` file using a LaTeX document so that only the cited bibliography items survive.
https://tex.stackexchange.com/users/3860
Filter .bib file for items that are actually used with \cite?
false
The `bibkey` command from [pybib](http://www.petercorke.com/pybib.html) can do this (amongst other tools)
1
https://tex.stackexchange.com/users/89
1835
1,287
https://tex.stackexchange.com/questions/1773
15
I need to convert a LaTeX document to OpenOffice -> Word in order to allow cooperation with non-LaTeX users. I've tried two commands: ``` oolatex foo.tex ``` and ``` mk4ht oolatex foo.tex ``` In both cases tex4ht failed to produce the ODT or SWX file, but a number of temp files were produced (`foo.4ct`, `4od`, `4oo`, `4tc`, `foo-manifes.4of`, `foo-meta.4ot`, `foo-setting.4os`, `foo-styles.4oy`). From my study of `.env` file of TeX4ht it became obvious that those files should have been later converted into the `OO` file. Has anyone else encoutered that problem and found a solution? Edit: After using Lian Tze's suggestion I changed all the path in `tex4ht.env` file, but still no go, the error I received now is somehow connected to java which is completely outside my league. ``` C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>t4ht docum ent -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate ---------------------------- t4ht.c (2009-01-31-07:34 kpathsea) t4ht document -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate (C:/Program Files (x86)/MiKTeX 2.8/tex4ht/base/win32/tex4ht.env) Entering document.lg System call: move document.4oo document.tmp 1 file(s) moved. System return: 0 System call: java -classpath c:\Program Files (x86)\MiKTeX 2.8\tex4ht\bin\tex4h t.jar xtpipes -i c:\Program Files (x86)\MiKTeX 2.8\tex4ht\xtpipes\ -o document.4 oo document.tmp Exception in thread "main" java.lang.NoClassDefFoundError: Files Caused by: java.lang.ClassNotFoundException: Files at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files. Program will exit. --- Warning --- System return: 1 System call: mkdir sxw-document.dir\Pictures System return: 0 System call: move document-settings.4os sxw-document.dir\setti ngs.xml 1 file(s) moved. System return: 0 System call: move document-styles.4oy sxw-document.dir\styles.xml 1 file(s) moved. System return: 0 System call: mkdir sxw-document.dir\META-INF System return: 0 System call: move document-manifest.4of sxw-document.dir\META-INF\manifest.xml 1 file(s) moved. System return: 0 System call: move document-meta.4ot sxw-document.dir\meta.xml 1 file(s) moved. System return: 0 System call: cd sxw-document.dir & zip -r -m document.zip * & cd .. adding: META-INF/ (164 bytes security) (stored 0%) adding: META-INF/manifest.xml (164 bytes security) (deflated 66%) adding: meta.xml (164 bytes security) (deflated 58%) adding: Pictures/ (164 bytes security) (stored 0%) adding: settings.xml (164 bytes security) (deflated 46%) adding: styles.xml (164 bytes security) (deflated 91%) System return: 0 System call: move sxw-document.dir\document.zip document.odt 1 file(s) moved. System return: 0 System call: del document.4od System return: 0 System call: if exist sxw-document.dir rmdir /Q /S sxw-document.dir System return: 0 C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy> ``` Here is the log of the last converting operation...
https://tex.stackexchange.com/users/815
Converting LaTeX to OpenOffice
false
I have never before used tex4ht, however, what I have done in the past is use latex2html and then import the .html into OpenOffice/Word. The only problem with this approach is that large equations will be rendered as images (and will therefore not be editable).
0
https://tex.stackexchange.com/users/737
1836
1,288
https://tex.stackexchange.com/questions/1825
8
When writing papers, I like to keep track of notes, thoughts and to do's inside the documents. I'd love to have tiny coloured multi-line marginalia. So far I used sth like ``` \newcommand{\mymarginnote}[1]{\marginpar{\begin{spacing}{0.8}\textcolor{red}{\scriptsize{#1}}\end{spacing}}} ``` to have a red side-note, but the single-spacing does not work. How can I have this marginalia single-spaced (or less)? And is it possible to have the text with a yellow background? The `\colorbox{}` command doesn't seem to wrap the text. I'd also be interested how you keep track of notes and thoughts within your documents... Thanks!
https://tex.stackexchange.com/users/nan
Single-spaced multi-line marginalia
false
I think the *real* problem is this. Wrong spacing: ``` \newcommand{\mymarginnote}[1]{\marginpar{\textcolor{red}{\scriptsize #1}}} ``` Right spacing: ``` \newcommand{\mymarginnote}[1]{\marginpar{\scriptsize\textcolor{red}{#1}}} ``` Explanation: In the second version, `\scriptsize` is still in effect when the paragraph ends. This is the point at which Latex chooses the line spacing for the paragraph. No need to use any extra tweaks like the "spacing" environment.
4
https://tex.stackexchange.com/users/100
1837
1,289
https://tex.stackexchange.com/questions/1838
8
Running revtex4-1 with the preamble: ``` \documentclass[aps, pre, floatfix, reprint]{revtex4-1} ``` and the section later: ``` \begin{acknowledgements} The authors would like to thank Tex, LaTeX and Friends for the answer to this question. \end{acknowledgements} ``` Gives the warning: ``` Class revtex4-1 Warning: Environment acknowledgements is obsolete; ``` Have I done something wrong here?
https://tex.stackexchange.com/users/352
How come Revtex says acknowledgements are obsolete?
true
I have never used `revtex` but the [author's guide](https://authors.aps.org/revtex4/auguide4-1.pdf) explicitly states: > > Please note the spelling of “acknowledgments.” > > > This is also the full error message LaTeX produces: > > Class revtex4-1 Warning: Environment acknowledgements is obsolete; > Use acknowledgments instead. > > > So replacing `acknowledgements` by `acknowledgments` removes the message.
19
https://tex.stackexchange.com/users/83
1839
1,290
https://tex.stackexchange.com/questions/1842
17
Forgive me for my perhaps naive questions, I am beginning to discover Tikz potentials. To ease certain operations as moving objects or transforming them, I want to know if there is a mechanism in Tikz that I can group certain operations and give a name to this grouping and use that name in doing operations on the whole collection of objects that are grouped. My first guess was perhaps **scope** will do this. But could not see how I can refer collectively to the scoped operations and/or objects. The best analogy, for give me to mention it, is the grouping operation in Power Point. Thanks for your help. Artimess
https://tex.stackexchange.com/users/833
Grouping objects and applying operation to the group
false
tikzpicture envionments can be nested. They behave like scope environments and support optional arguments for parameters. For instance, `\begin{tikzpicture}[scale=0.5, transform shape] ... \end{tikzpicture}` could be used inside a parent tikzpicture environment.
1
https://tex.stackexchange.com/users/213
1844
1,291
https://tex.stackexchange.com/questions/1842
17
Forgive me for my perhaps naive questions, I am beginning to discover Tikz potentials. To ease certain operations as moving objects or transforming them, I want to know if there is a mechanism in Tikz that I can group certain operations and give a name to this grouping and use that name in doing operations on the whole collection of objects that are grouped. My first guess was perhaps **scope** will do this. But could not see how I can refer collectively to the scoped operations and/or objects. The best analogy, for give me to mention it, is the grouping operation in Power Point. Thanks for your help. Artimess
https://tex.stackexchange.com/users/833
Grouping objects and applying operation to the group
false
You can apply transformations to a `scope`, like for example: ``` \begin{tikzpicture} \begin{scope}[rotate=45] \draw (-1,-1) rectangle (1,1); \draw (0,0) circle (1); \end{scope} \end{tikzpicture} ``` Whatever parameters and operations you specify in the `[...]` at the beginning of the `scope` environment is applied to every command inside the `scope`.
12
https://tex.stackexchange.com/users/83
1845
1,292
https://tex.stackexchange.com/questions/1843
5
When I use the `setspace` package in an [`amsart`](https://www.ctan.org/pkg/amsart) document, the indentation of footnotes is messed up; the first-line indent is lost, with everything pushed to the left. Sample document: ``` \documentclass{amsart} \usepackage{setspace} \begin{document} Hello.\footnote{There.} \end{document} ``` Compare the placement of the footnote text when the second line is included vs. excluded. This does not occur in the `article` class, for which the inclusion of `setspace` appears to make no difference. I experience the issue on both MacTeX (from MacPorts) on Max OS 10.6, and on MiKTeX on a Windows XP machine. How can I keep `setspace` from messing up the footnote indentation when using `amsart`?
https://tex.stackexchange.com/users/842
amsart, setspace, and footnotes
true
setspace redefines `\@footnotetext`. You could save that command in your own macro and restore it after loading setspace: ``` \documentclass{amsart} \makeatletter \let\std@footnotetext\@footnotetext \usepackage{setspace} \let\@footnotetext\std@footnotetext \makeatother \begin{document} Hello.\footnote{There.} \end{document} ``` This is a method that can generally be used for such workarounds regarding undesired changes by packages.
6
https://tex.stackexchange.com/users/213
1846
1,293
https://tex.stackexchange.com/questions/1841
32
The [`microtype`](http://ctan.org/pkg/microtype) package allows to completely suppress ligatures. However, this feature requires pdfTeX 1.30 or newer. That's unfortunate if I'm using LaTeX or XeLaTeX while having to avoid ligatures. Is there any other way to disable ligatures for a complete document or just an environment?
https://tex.stackexchange.com/users/213
How can I completely suppress ligatures?
true
In XeLaTeX (or LuaLaTeX), if you are using an opentype/truetype font, you can just load it with the default ligature features (usually just `liga`) turned off. In standard LaTeX, the only safe solution that I know is to create special tfm files that do not contain ligatures. The new primitive, '`\noligs`' in pdftex 1.30 was created specifically so that you do not have to mess with these tfm files. The modification to the tfm files is not that hard, but I do not know how to make latex make use of the results. To patch a tfm file, say 'cmr10.tfm', first find the file and go to its location, then do this: ``` $ tftopl cmr10.tfm > cmr10-noligs.pl ``` The output file `cmr10-noligs.pl` is a 'human readable' representation of the tfm contents. You can open it in any text editor. Close to the top, there is a table that starts like this: ``` (LIGTABLE (LABEL O 40) (KRN C l R -0.277779) (KRN C L R -0.319446) (STOP) (LABEL C f) (LIG C i O 14) (LIG C f O 13) (LIG C l O 15) ``` within the `LIGTABLE`, delete all lines with `LIG` in it (most fonts have only `LIG`, but there are some variations possible like `/LIG` and `LIG/>`). When you have done that, you may end up with combinations of `LABEL` and `STOP` on consecutive lines. Whenever that happens, delete both those lines also. Then save the file, and run the shell command ``` $ pltotf cmr10-noligs.pl ``` This creates the new metrics file, `cmr10-noligs.tfm`, that can then be used to do typesetting without any automatic ligatures. Before you can actually use this font, you (usually) also have to add a dvips/pdftex map file entry for it, otherwise these programs will believe you have created a completely new metafont font. In this case, my `pdftex.map` contains this line for `cmr10`: ``` cmr10 CMR10 <cmr10.pfb ``` all that is needed is a copy of that line with the new tfm name ``` cmr10-noligs CMR10 <cmr10.pfb ``` Note: it is actually possible that there is no matching map line for the original font because it was itself a virtual font. In that case, you do not need an extra map line at all, but you *do* need to copy the `<fontname>.vf` file (use `kpsewhich` to find it, it is on your disk somewhere) to `<fontname>-noligs.vf`. Someone else will have to explain how to create a LaTeX package from new tfm files, I do not remember how to do that any more.
31
https://tex.stackexchange.com/users/89
1848
1,294
https://tex.stackexchange.com/questions/1847
23
I would like a command that takes two arguments: a page number and a block of text. I would like the command to create a PDF hyperlink around the text that will jump to the given page. I see that the undocumented `\hyperpage{}` command from the [hyperref](http://www.tug.org/applications/hyperref/manual.html) package will create a link to the given page, however, I don't see how it can be used to make a link for arbitrary text. I took a look at the underlying code in hyperref.sty but I can't really figure it out. I do realize that I could use `\hyperlink{}{}`, but that requires I put a `\hypertarget{}{}` on each of the pages to be linked. In my case, I only know the numerical number of the page to be linked.
https://tex.stackexchange.com/users/737
PDF hyperlinks to a given page.
true
You could use `\hyperlink` with the already defined page targets: ``` \documentclass{article} \usepackage{hyperref} \begin{document} \hyperlink{page.2}{Go to page 2} \newpage text on page 2 \end{document} ```
30
https://tex.stackexchange.com/users/213
1849
1,295
https://tex.stackexchange.com/questions/1847
23
I would like a command that takes two arguments: a page number and a block of text. I would like the command to create a PDF hyperlink around the text that will jump to the given page. I see that the undocumented `\hyperpage{}` command from the [hyperref](http://www.tug.org/applications/hyperref/manual.html) package will create a link to the given page, however, I don't see how it can be used to make a link for arbitrary text. I took a look at the underlying code in hyperref.sty but I can't really figure it out. I do realize that I could use `\hyperlink{}{}`, but that requires I put a `\hypertarget{}{}` on each of the pages to be linked. In my case, I only know the numerical number of the page to be linked.
https://tex.stackexchange.com/users/737
PDF hyperlinks to a given page.
false
Not sure it is the same, but you can create a link with something like this. First you add a label somewhere in the document. ``` \label{sec:listOfFiles} ``` And then add the link to that label with. ``` \ref{sec:listOfFiles} \pageref{sec:listOfFiles} ``` And if you add ``` \usepackage{hyperref} ``` it becomes a link you can click on.
1
https://tex.stackexchange.com/users/795
1850
1,296
https://tex.stackexchange.com/questions/1811
24
``` \usepackage[utf8]{inputenc} ``` or ``` \usepackage[latin1]{inputenc} ``` I write in German if that matters. Pro and contra?
https://tex.stackexchange.com/users/817
utf8 or latin1 encoding – German
false
The background... Pure ascii is a 7-bit encoding that is only good for english, the german characters is missing. Latin1 is a 8-bit (1 byte) character encoding that used to be the standard encoding in Germany some 5-10 years ago. And it does support the special german characters. If you have a look at the [latin1 page over at wikipedia](http://en.wikipedia.org/wiki/ISO/IEC_8859-1) you quickly realised that it was a little bit messy but it did work. So to solve this in a nicer way, utf8 was created and since it is using 1-4 bytes to store one character. More or less all special characters from all different countries inclusive the Asian ones can be saved in the same character encoding. And since all modern OS (Windows, Linux and MacOS) use utf8, you are probably using it right now without even knowing it.
4
https://tex.stackexchange.com/users/795
1851
1,297
https://tex.stackexchange.com/questions/1852
19
how to enumerate theorems using letters?
https://tex.stackexchange.com/users/nan
how to enumerate theorems using letters?
false
You could redefine the presentation of the theorem counter. For example: ``` \documentclass{article} \newtheorem{theorem}{Theorem} \renewcommand*{\thetheorem}{\Alph{theorem}} \begin{document} \begin{theorem} Text \end{theorem} \end{document} ``` Output: If your counter has the name `theorem`, the corresponding output command has the name `\thetheorem`. The command `\Alph` takes a counter as argument and returns the value converted into the corresponding capital letter. `\alph` would return lowercase letters instead.
27
https://tex.stackexchange.com/users/213
1853
1,298
https://tex.stackexchange.com/questions/1756
189
I have heard a lot about `LaTeX`, but never used it myself. It is mainly used for typesetting professional research papers. But I am not writing research papers. Is `LaTeX` for me? If yes, why should I be shifting from `OpenOffice` to `LaTeX`? What does `LaTeX` offer to the normal user who uses word processing software to make all kind of report documents?
https://tex.stackexchange.com/users/813
Why should I use LaTeX?
false
I don't intend this to be a complete answer to your question, but I don't believe anyone else has yet brought up the topic of longevity. TeX has been around for over thirty years, and the underlying language hasn't changed very much in that time. Has anyone ever tried using Word 2007 to load a file that was originally written in Word '97? Even if the file imports properly, chances are some of the page/line breaks are going to be off, possibly skewing the entire layout. What if you had decided to write your document in Lotus Word Pro back in 1990? Would you be able to view/edit that document today? These problems almost never occur with (La)TeX. A document that is typeset in (La)TeX today is likely to look exactly the same when you re-typeset it 10, 20, or 30 years down the road. Since TeX is stored in a human-readable plain text file, you also have the knowledge that you will always be able to edit the file in the future.
114
https://tex.stackexchange.com/users/737
1854
1,299
https://tex.stackexchange.com/questions/1856
3
I have a bibtex .bst file that issues something like: ``` "\MR{" mrnumber "}" * * ``` in order to produce things like: ``` \MR{MR123456789 (99 \#9999)} ``` or: ``` \MR{MR123456789} ``` inside the .bbl file. This is then parsed by one of the many MR implementations out there to produce a little URL to the review: ``` \href{http://www.ams.org/mathscinet-getitem?mr=123456789}{MR123456789} ``` Unfortunately, it no longer works too reliably as some records I am getting now look like: ``` \MR{123456789 (99 \#9999)} ``` or: ``` \MR{123456789} ``` without the inital MR. In terms of (perl compatible) regexes I want to capture $1 from `/^(?:MR)([0-9]*)[^0-9]*.*$/`. > > What sort of magic do I put in the `\def` in order to omit an optional leading "MR" and optional trailing garbage begun by a non-numeric character? > > >
https://tex.stackexchange.com/users/846
Macro definition: Ignoring leading "MR" and trailing garbage begun by non-numeric / Parsing the mrnumber returned by MathSciNet
true
You need to process this input in two stages. Something like this should do the trick: ``` \def\checkMR MR#1#2#3 #4\relax% {\ifx#1M% \ifx#2R\message{#3}\else\message{#1#2#3}\fi \else \message{#1#2#3}% \fi} \def\MR#1{\checkMR MR#1 \relax} ``` If the input is ``` \MR{MR10000} ``` the macros `\checkMR` gets fed these arguments: ``` \checkMR MRMR10000\relax ``` in that case, `#1` is M, `#2` is R, and the number is in argument `#3` (because `\checkMR` is a delimited macro whose call has to start with `MR`, so the first `MR` appearance is deleted by the macro scanner inside TeX). If the input is ``` \MR{10000} ``` the number is all three arguments concatenated, because it expands to `\checkMR MR1000\relax`. The `\ifx` tests in `\checkMR` differentiate between those cases. The `\relax` is there only to end `\checkMR` argument scanning. It could be anything, as long as it does not appear in the original `\MR` argument at all. Edit: sorry, I missed the space problem originally, I have adjusted the macro definitions to handle that as well. As an exercise to the reader: see if you configure out how that works on your own :)
5
https://tex.stackexchange.com/users/89
1857
1,300
https://tex.stackexchange.com/questions/1859
2
I want to declare some macros in my preamble which allow me to create 2 x 2 matrices more quickly, and in particular, I want to be able to tab through the four entry positions. I feel like this is super basic and I am missing an obvious solution. Ideally I would like the command to implement `smallmatrix` and `pmatrix`. Thanks in advance! **EDIT:** I apologize for the confusion. What I mean was something like `\newcommand{\norm}[1]{\left|\left|#1\right|\right|}` where the command takes an argument and using tab-completion in TexWorks or enter-completion in Kile will put your cursor in the argument field automatically. I hope this clarification helps!
https://tex.stackexchange.com/users/84
Defining a good tab-able macro for matrices.
false
Do you mean just shortcuts? Here's one possibility defining commands instead of environments: ``` \documentclass{article} \usepackage{amsmath} \newcommand*{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}} \newcommand*{\smat}[1]{\begin{smallmatrix}#1\end{smallmatrix}} \begin{document} \[ \pmat{a & b \\ c & d} \smat{e & f \\ g & h} \] \end{document} ```
3
https://tex.stackexchange.com/users/213
1860
1,301
https://tex.stackexchange.com/questions/1858
64
In Beamer, I often use a two-column slide layout, picture on the left and text on the right. Sometimes the same picture is used on multiple slides, with the text on the right changing. I use the Beamer `columns` environment for this purpose. My problem is that typically the pictures in the two slides do not have the same vertical alignment, causing a slightly annoying "jiggle". None of the various options for `column` seems to help, and the default (align centers) is the most reasonable anyway. Is there a way to force the picture to be vertically centered with respect to the page, irrespective of the size of the content of the other column? Here's an example - the text on the left (representing a picture) moves a little between frames. ``` \documentclass{beamer} \usepackage{calc} \begin{document} \begin{frame}\frametitle{Test frame} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{itemize} \item Item 1 \item Item 2 \end{itemize} \end{columns} \end{frame} \begin{frame}\frametitle{Test frame 2} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{itemize} \item Another item 1 \item Another item 2 \item This list is longer \item Than the previous one \item was \end{itemize} \end{columns} \end{frame} \end{document} ```
https://tex.stackexchange.com/users/490
Stable vertical alignment of columns in Beamer
true
You could fix the vertical alignment by using minipages of the same height in the second column. Here's the modified example with a stable left column: ``` \documentclass{beamer} \usepackage{calc} \begin{document} \begin{frame}\frametitle{Test frame} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{minipage}[c][.6\textheight][c]{\linewidth} \begin{itemize} \item Item 1 \item Item 2 \end{itemize} \end{minipage} \end{columns} \end{frame} \begin{frame}\frametitle{Test frame 2} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{minipage}[c][.6\textheight][c]{\linewidth} \begin{itemize} \item Another item 1 \item Another item 2 \item This list is longer \item Than the previous one \item was \end{itemize} \end{minipage} \end{columns} \end{frame} \end{document} ```
31
https://tex.stackexchange.com/users/213
1861
1,302
https://tex.stackexchange.com/questions/1858
64
In Beamer, I often use a two-column slide layout, picture on the left and text on the right. Sometimes the same picture is used on multiple slides, with the text on the right changing. I use the Beamer `columns` environment for this purpose. My problem is that typically the pictures in the two slides do not have the same vertical alignment, causing a slightly annoying "jiggle". None of the various options for `column` seems to help, and the default (align centers) is the most reasonable anyway. Is there a way to force the picture to be vertically centered with respect to the page, irrespective of the size of the content of the other column? Here's an example - the text on the left (representing a picture) moves a little between frames. ``` \documentclass{beamer} \usepackage{calc} \begin{document} \begin{frame}\frametitle{Test frame} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{itemize} \item Item 1 \item Item 2 \end{itemize} \end{columns} \end{frame} \begin{frame}\frametitle{Test frame 2} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{itemize} \item Another item 1 \item Another item 2 \item This list is longer \item Than the previous one \item was \end{itemize} \end{columns} \end{frame} \end{document} ```
https://tex.stackexchange.com/users/490
Stable vertical alignment of columns in Beamer
false
I think this is a good candidate for the `overprint` environment. It typesets different material on different slides, but puts them all inside a box the size of the largest one. ``` \documentclass{beamer} \usepackage{calc} \begin{document} \begin{frame} \frametitle<1>{Test frame} \frametitle<2>{Test frame 2} \begin{columns} \column{.5\textwidth} A figure \column{.5\textwidth} \begin{overprint} \onslide<1> \begin{itemize} \item Item 1 \item Item 2 \end{itemize} \onslide<2> \begin{itemize} \item Another item 1 \item Another item 2 \item This list is longer \item Than the previous one \item was \end{itemize} \end{overprint} \end{columns} \end{frame} \end{document} ``` **EDIT:** although, I just realized that this makes both lists be top-aligned, so the shorter one may look a bit displaced. I'm not sure if there's a way to specify that the contents of `overprint` should be vertically centered.
7
https://tex.stackexchange.com/users/125
1862
1,303
https://tex.stackexchange.com/questions/1863
249
The `hyperref` documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors. However, there are exceptions, for instance the `amsrefs` user's guide notes that `amsrefs` has to be loaded *after* `hyperref`. To avoid problems when adding hypertext functionality: do you know further such exceptions?
https://tex.stackexchange.com/users/213
Which packages should be loaded after hyperref instead of before?
false
`cleveref` is one.
11
https://tex.stackexchange.com/users/337
1864
1,304
https://tex.stackexchange.com/questions/1859
2
I want to declare some macros in my preamble which allow me to create 2 x 2 matrices more quickly, and in particular, I want to be able to tab through the four entry positions. I feel like this is super basic and I am missing an obvious solution. Ideally I would like the command to implement `smallmatrix` and `pmatrix`. Thanks in advance! **EDIT:** I apologize for the confusion. What I mean was something like `\newcommand{\norm}[1]{\left|\left|#1\right|\right|}` where the command takes an argument and using tab-completion in TexWorks or enter-completion in Kile will put your cursor in the argument field automatically. I hope this clarification helps!
https://tex.stackexchange.com/users/84
Defining a good tab-able macro for matrices.
false
I'm not sure what you mean by tabbing through the four entries, but the following is a slight modification to what Stefan Kottwitz gave. ``` \documentclass{article} \usepackage{amsmath} \newcommand*\pmat[4]{\begin{pmatrix}#1&#2\\#3&#4\end{pmatrix}} \newcommand*\smat[4]{\begin{smallmatrix}#1&#2\\#3&#4\end{smallmatrix}} \begin{document} \[ \pmat{a}{b}{c}{d} \smat{e}{f}{g}{h} \] \end{document} ```
4
https://tex.stackexchange.com/users/647
1865
1,305
https://tex.stackexchange.com/questions/1773
15
I need to convert a LaTeX document to OpenOffice -> Word in order to allow cooperation with non-LaTeX users. I've tried two commands: ``` oolatex foo.tex ``` and ``` mk4ht oolatex foo.tex ``` In both cases tex4ht failed to produce the ODT or SWX file, but a number of temp files were produced (`foo.4ct`, `4od`, `4oo`, `4tc`, `foo-manifes.4of`, `foo-meta.4ot`, `foo-setting.4os`, `foo-styles.4oy`). From my study of `.env` file of TeX4ht it became obvious that those files should have been later converted into the `OO` file. Has anyone else encoutered that problem and found a solution? Edit: After using Lian Tze's suggestion I changed all the path in `tex4ht.env` file, but still no go, the error I received now is somehow connected to java which is completely outside my league. ``` C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy>t4ht docum ent -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate ---------------------------- t4ht.c (2009-01-31-07:34 kpathsea) t4ht document -cooxtpipes -coo -ec:\tex4ht\texmf\tex4ht\base\win32\tex4ht.env -cvalidate (C:/Program Files (x86)/MiKTeX 2.8/tex4ht/base/win32/tex4ht.env) Entering document.lg System call: move document.4oo document.tmp 1 file(s) moved. System return: 0 System call: java -classpath c:\Program Files (x86)\MiKTeX 2.8\tex4ht\bin\tex4h t.jar xtpipes -i c:\Program Files (x86)\MiKTeX 2.8\tex4ht\xtpipes\ -o document.4 oo document.tmp Exception in thread "main" java.lang.NoClassDefFoundError: Files Caused by: java.lang.ClassNotFoundException: Files at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files. Program will exit. --- Warning --- System return: 1 System call: mkdir sxw-document.dir\Pictures System return: 0 System call: move document-settings.4os sxw-document.dir\setti ngs.xml 1 file(s) moved. System return: 0 System call: move document-styles.4oy sxw-document.dir\styles.xml 1 file(s) moved. System return: 0 System call: mkdir sxw-document.dir\META-INF System return: 0 System call: move document-manifest.4of sxw-document.dir\META-INF\manifest.xml 1 file(s) moved. System return: 0 System call: move document-meta.4ot sxw-document.dir\meta.xml 1 file(s) moved. System return: 0 System call: cd sxw-document.dir & zip -r -m document.zip * & cd .. adding: META-INF/ (164 bytes security) (stored 0%) adding: META-INF/manifest.xml (164 bytes security) (deflated 66%) adding: meta.xml (164 bytes security) (deflated 58%) adding: Pictures/ (164 bytes security) (stored 0%) adding: settings.xml (164 bytes security) (deflated 46%) adding: styles.xml (164 bytes security) (deflated 91%) System return: 0 System call: move sxw-document.dir\document.zip document.odt 1 file(s) moved. System return: 0 System call: del document.4od System return: 0 System call: if exist sxw-document.dir rmdir /Q /S sxw-document.dir System return: 0 C:\Users\Wojtek\Documents\My Dropbox\INSiK\Raporty\Artykuł problemowy> ``` Here is the log of the last converting operation...
https://tex.stackexchange.com/users/815
Converting LaTeX to OpenOffice
true
Not sure if your problem is the same as mine, but I got `oolatex` etc to work under Windows XP by editing `<texmf>\tex4ht\base\win32\tex4ht.env`. I updated all occurrences of `c:\tex4ht\texmf` and `c:/tex4ht/texmf` to the actual TEXMF path on my system, so that all the paths resolve. **Update:** Note that `java` doesn't like space characters in file paths, so you'll need to use those old-style 8.3 filenames if a directory name contains spaces. For the purpose of `oolatex`, search for the `<ooxtpipes>` section and edit the `java` calls accordingly: ``` <ooxtpipes> .4oo move %%0.4oo %%0.tmp .4oo java -classpath c:/Progra~1/MiKTeX~1/tex4ht/bin/tex4ht.jar xtpipes -i c:\Progra~1\MiKTeX~1\tex4ht\xtpipes\ -o %%0.4oo %%0.tmp .4om move %%1.4om %%1.tmp .4om java -classpath c:/Progra~1/MiKTeX~1/tex4ht/bin/tex4ht.jar xtpipes -i c:\Progra~1\MiKTeX~1\tex4ht\xtpipes\ -o %%1.4om %%1.tmp </ooxtpipes> ```
6
https://tex.stackexchange.com/users/226
1866
1,306
https://tex.stackexchange.com/questions/1856
3
I have a bibtex .bst file that issues something like: ``` "\MR{" mrnumber "}" * * ``` in order to produce things like: ``` \MR{MR123456789 (99 \#9999)} ``` or: ``` \MR{MR123456789} ``` inside the .bbl file. This is then parsed by one of the many MR implementations out there to produce a little URL to the review: ``` \href{http://www.ams.org/mathscinet-getitem?mr=123456789}{MR123456789} ``` Unfortunately, it no longer works too reliably as some records I am getting now look like: ``` \MR{123456789 (99 \#9999)} ``` or: ``` \MR{123456789} ``` without the inital MR. In terms of (perl compatible) regexes I want to capture $1 from `/^(?:MR)([0-9]*)[^0-9]*.*$/`. > > What sort of magic do I put in the `\def` in order to omit an optional leading "MR" and optional trailing garbage begun by a non-numeric character? > > >
https://tex.stackexchange.com/users/846
Macro definition: Ignoring leading "MR" and trailing garbage begun by non-numeric / Parsing the mrnumber returned by MathSciNet
false
The following seems to do what you want. ``` \def\MR#1{\futurelet\lettoken\checkMR#1 \endMRgarbage} \def\checkMR{% \if\lettoken M\expandafter\doMR \else \expandafter\doMR\expandafter M\expandafter R% \fi } \def\doMR MR{% \afterassignment\skipMRgarbage \begingroup \count255=% } \def\skipMRgarbage#1\endMRgarbage{% MR% \the\count255 \endgroup } \MR{MR10000} \MR{12345689 (99 \#9999)} \MR{MR323(99)} \bye ``` The three example expand to MR10000, MR123456789, and MR232. (Actually, it's not just expansion due to assignments, but that's the basic idea.) It should be easy enough to change the definition of \skipMRgarbage to produce an \href or whatever else you want.
1
https://tex.stackexchange.com/users/647
1867
1,307
https://tex.stackexchange.com/questions/1863
249
The `hyperref` documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors. However, there are exceptions, for instance the `amsrefs` user's guide notes that `amsrefs` has to be loaded *after* `hyperref`. To avoid problems when adding hypertext functionality: do you know further such exceptions?
https://tex.stackexchange.com/users/213
Which packages should be loaded after hyperref instead of before?
true
* `cleveref` Many others are documented in section 9 of the `hyperref` [manual](https://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/hyperref/doc/hyperref-doc.html). Some are more complex than simply loading after `hyperref`. Here are some more common ones... * `amsrefs` * `float` before `hyperref` before `algorithm` * `chappg` * `sidecap` * `linguex`
137
https://tex.stackexchange.com/users/627
1868
1,308
https://tex.stackexchange.com/questions/1863
249
The `hyperref` documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors. However, there are exceptions, for instance the `amsrefs` user's guide notes that `amsrefs` has to be loaded *after* `hyperref`. To avoid problems when adding hypertext functionality: do you know further such exceptions?
https://tex.stackexchange.com/users/213
Which packages should be loaded after hyperref instead of before?
false
Other common ones include * `bookmark` * `glossaries`
53
https://tex.stackexchange.com/users/416
1869
1,309
https://tex.stackexchange.com/questions/1870
10
I've needed a few new packages for some macros to draw diagrams that I'm working with. I've heard that some LaTeX editors can automatically download the correct packages from CTAN when they're not found when attempting to compile a `tex` file. I.e. when I put in `\usepackage{xiften}`, for example, and then (I'm sure this is the wrong way, I've only been using auctex for a couple of days) do `M-x compile` with command `pdflatex file.tex`, and it gives the error `xifthen.sty not found`, it would go to ctan and find `xifthen.sty` and download it, then after that when `ifmtarg.sty` (a dependency) was not found, it would fetch that, etc. Can AUCTeX do anything like this? If not, is there a simple way to install packages via the command line? The equivalent of a package manager, or something?
https://tex.stackexchange.com/users/848
Installing new packages from ctan through command line or AUCTeX on Mac OS?
false
If you are using a TeX Live based distribution, such as MacTeX, I am aware of no "on-the-fly" installation of packages. This is a feature of the Windows-based MikTeX distribution. ACUTeX may provide some functionality to remedy this- those emacs users are crafty. However I cannot speak authoritatively on the subject as I don't use emacs. TeX Live does indeed have a package manager though- the command you want is `tlmgr --help` for general usage notes and `tlmgr install <pkgname>` to install a package. You may also want to check out the [TeX Live Utility](http://code.google.com/p/mactlmgr/) which provides a nice GUI for `tlmgr` on OS X.
10
https://tex.stackexchange.com/users/17
1871
1,310
https://tex.stackexchange.com/questions/1859
2
I want to declare some macros in my preamble which allow me to create 2 x 2 matrices more quickly, and in particular, I want to be able to tab through the four entry positions. I feel like this is super basic and I am missing an obvious solution. Ideally I would like the command to implement `smallmatrix` and `pmatrix`. Thanks in advance! **EDIT:** I apologize for the confusion. What I mean was something like `\newcommand{\norm}[1]{\left|\left|#1\right|\right|}` where the command takes an argument and using tab-completion in TexWorks or enter-completion in Kile will put your cursor in the argument field automatically. I hope this clarification helps!
https://tex.stackexchange.com/users/84
Defining a good tab-able macro for matrices.
false
The [LaTeX plug-in for gedit](http://www.michaels-website.de/gedit-latex-plugin/), as with most good LaTeX editors, has a macro for tables and matrices. It supports tabbing between the entries. Being a gnome application you can assign any menu item a short-cut just by selecting it then pressing the keys you want. gedit is available for most operating systems. Texmaker has a spreadsheet-like wizard for creating matrices and tables and is also available for most platforms.
0
https://tex.stackexchange.com/users/422
1873
1,311
https://tex.stackexchange.com/questions/1874
20
I'm writing up some notes that will be displayed on an overhead projector. The standard time-derivative `\dot{x}` produces a dot that is hard to see. Does anyone know of a package or have a macro that produces a (nice looking) larger dot? Similarly with `\ddot{x}`. At the moment, I've been supplied with some ugly code that produces an ugly output: ``` \def\dt#1{{\buildrel {\hbox{\LARGE . }} \over {#1}}} % dot-over \def\ddt#1{{\buildrel {\hbox{\LARGE ..}} \over {#1}}} % double dot ```
https://tex.stackexchange.com/users/422
How to make a larger "\dot"
false
The normal `\dot` uses the dot accent from the font, so switching font families to a font set with larger accents would be the cleanest solution.
3
https://tex.stackexchange.com/users/89
1875
1,312
https://tex.stackexchange.com/questions/1872
7
I'd like to reference BibTeX sources with full name and year, e. g. [Adams1979]. Is there an easy way to to this?
https://tex.stackexchange.com/users/97
Full name and year as BibTeX key
true
Take a look at the `natbib` or `biblatex` packages. Either should be able to do what you want. Edit: Take a look at `\setcitestyle` for `natbib`. Edit 2: Here's a complete example: ``` \documentclass{article} \usepackage[authoryear]{natbib} \bibliographystyle{plainnat} \setcitestyle{square,aysep={}} \begin{document} \citep{adams:79} \bibliography{test} \end{document} ``` And the `.bib`: ``` @Article{adams:79, author = {Foo Adams}, year = 1979, title = {Test}, journal = {Test}, } ```
10
https://tex.stackexchange.com/users/647
1876
1,313
https://tex.stackexchange.com/questions/1872
7
I'd like to reference BibTeX sources with full name and year, e. g. [Adams1979]. Is there an easy way to to this?
https://tex.stackexchange.com/users/97
Full name and year as BibTeX key
false
Using `natbib` you only need to specify something like ``` \usepackage[authoryear]{natbib} \bibliographystyle{plainnat} ``` You can read its full documentation by typing `texdoc natbib` on a command line.
3
https://tex.stackexchange.com/users/169
1877
1,314
https://tex.stackexchange.com/questions/1874
20
I'm writing up some notes that will be displayed on an overhead projector. The standard time-derivative `\dot{x}` produces a dot that is hard to see. Does anyone know of a package or have a macro that produces a (nice looking) larger dot? Similarly with `\ddot{x}`. At the moment, I've been supplied with some ugly code that produces an ugly output: ``` \def\dt#1{{\buildrel {\hbox{\LARGE . }} \over {#1}}} % dot-over \def\ddt#1{{\buildrel {\hbox{\LARGE ..}} \over {#1}}} % double dot ```
https://tex.stackexchange.com/users/422
How to make a larger "\dot"
false
Maybe rather use `\partial_t x` or `x_t`? Also quite compact and much more noticeable.
1
https://tex.stackexchange.com/users/nan
1878
1,315
https://tex.stackexchange.com/questions/1856
3
I have a bibtex .bst file that issues something like: ``` "\MR{" mrnumber "}" * * ``` in order to produce things like: ``` \MR{MR123456789 (99 \#9999)} ``` or: ``` \MR{MR123456789} ``` inside the .bbl file. This is then parsed by one of the many MR implementations out there to produce a little URL to the review: ``` \href{http://www.ams.org/mathscinet-getitem?mr=123456789}{MR123456789} ``` Unfortunately, it no longer works too reliably as some records I am getting now look like: ``` \MR{123456789 (99 \#9999)} ``` or: ``` \MR{123456789} ``` without the inital MR. In terms of (perl compatible) regexes I want to capture $1 from `/^(?:MR)([0-9]*)[^0-9]*.*$/`. > > What sort of magic do I put in the `\def` in order to omit an optional leading "MR" and optional trailing garbage begun by a non-numeric character? > > >
https://tex.stackexchange.com/users/846
Macro definition: Ignoring leading "MR" and trailing garbage begun by non-numeric / Parsing the mrnumber returned by MathSciNet
false
I can't resist: a LuaTeX solution. The `\bgroup`/`\catcode` is not necessary if you put the definition in a separate lua-file, wich I'd always recommend. See that Lua has regular expressions (although limited compared to perl). ``` \bgroup \catcode`\%=11 \gdef\MR#1{ \directlua{ local str = ('#1'):gsub("^%a?%a?(%d+) ?.*$","%1") tex.sprint(str) }} \egroup \MR{MR123456789} \MR{MR123456789 (99 \#9999)} \MR{123456789 (99 \#9999)} \MR{123456789} ``` yields 4 times `123456789`
0
https://tex.stackexchange.com/users/243
1879
1,316
https://tex.stackexchange.com/questions/1874
20
I'm writing up some notes that will be displayed on an overhead projector. The standard time-derivative `\dot{x}` produces a dot that is hard to see. Does anyone know of a package or have a macro that produces a (nice looking) larger dot? Similarly with `\ddot{x}`. At the moment, I've been supplied with some ugly code that produces an ugly output: ``` \def\dt#1{{\buildrel {\hbox{\LARGE . }} \over {#1}}} % dot-over \def\ddt#1{{\buildrel {\hbox{\LARGE ..}} \over {#1}}} % double dot ```
https://tex.stackexchange.com/users/422
How to make a larger "\dot"
false
The `amsmath` package provides the commands `\overset` and `\underset` to set arbitrary things over/under other arbitrary things. So with `amsmath` and `bm` loaded you can use ``` \overset{\bm .}{a} ``` to obtain an "a" with a bold dot on it.
14
https://tex.stackexchange.com/users/83
1880
1,317
https://tex.stackexchange.com/questions/64
151
A lot of people write makefiles that say something like ``` paper.pdf: paper.tex pdflatex paper bibtex paper pdflatex paper pdflatex paper ``` To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?
https://tex.stackexchange.com/users/60
Tools for automating document compilation
false
I did a large amount of research for a [very similar StackOverflow question](https://stackoverflow.com/questions/1240037/recommended-build-system-for-latex/1394702#1394702). To summarize the problems of each tool: * `latexmk` will overwrite your document in place, frequently causing your viewer to display an incomplete document (eg when there are errors). Its error support is bad. * `rubber` will overwrite your document in place (see above). It also frequently doesn't update your document enough. * `rubber-info` prints errors spectacularly, and is better than all other tools at this task. It can be used seperately from rubber, with any other tool. * `vim-latexsuite` has an awful build system. Avoid. * I couldn't make ltx work. * MikTeX is windows only. * `latex-makefile` doesn't allow you use pdflatex, only latex -> ps -> pdf. It also misses bibtex sometimes. My [final solution](https://stackoverflow.com/questions/1240037/recommended-build-system-for-latex/1394702#1394702) constantly rebuilds the document via pdflatex, only overwriting when the document has changed (for your viewing pleasure). It relies on rubber-info for errors. I set vim to save the file after every X keystrokes, so that my script constantly rebuilds.
40
https://tex.stackexchange.com/users/855
1882
1,318
https://tex.stackexchange.com/questions/1874
20
I'm writing up some notes that will be displayed on an overhead projector. The standard time-derivative `\dot{x}` produces a dot that is hard to see. Does anyone know of a package or have a macro that produces a (nice looking) larger dot? Similarly with `\ddot{x}`. At the moment, I've been supplied with some ugly code that produces an ugly output: ``` \def\dt#1{{\buildrel {\hbox{\LARGE . }} \over {#1}}} % dot-over \def\ddt#1{{\buildrel {\hbox{\LARGE ..}} \over {#1}}} % double dot ```
https://tex.stackexchange.com/users/422
How to make a larger "\dot"
true
You could use the `accents` package and its command `\accentset` to create faked accents. Here`s an example: ``` \documentclass{article} \usepackage{amsmath} \usepackage{accents} \newcommand*{\dt}[1]{% \accentset{\mbox{\large\bfseries .}}{#1}} \newcommand*{\ddt}[1]{% \accentset{\mbox{\large\bfseries .\hspace{-0.25ex}.}}{#1}} \begin{document} $\dot{x} \neq \dt{x}$ $\ddot{x} \neq \ddt{x}$ \end{document} ``` Output: Instead of a large bold period you could also choose for instance a tiny \bullet.
19
https://tex.stackexchange.com/users/213
1883
1,319
https://tex.stackexchange.com/questions/1884
27
I'm using the standard book class. If I write ``` \documentclass{book} \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{foo} \section{Donald} \backmatter \chapter{bar} \section{Mickey} \end{document} ``` I expect to have chapter bar numbered as appendix A and section Mickey as A.1. Instead chapter bar is not numbered and section Mickey is 1.2, following section Donald. If I insert the appendix command to obtain ``` \documentclass{book} \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{foo} \section{Donald} \backmatter \appendix \chapter{bar} \section{Mickey} \end{document} ``` then chapter bar is unnumbered and section Mickey is numbered as .1. What am I doing wrong?
https://tex.stackexchange.com/users/260
Numbering of appendices in the backmatter of a book
true
Simply remove the `\backmatter` in your second version. The `\backmatter` should only be the bibliography and index (and similar things) at the end, which are not numbered.
32
https://tex.stackexchange.com/users/83
1885
1,320
https://tex.stackexchange.com/questions/1884
27
I'm using the standard book class. If I write ``` \documentclass{book} \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{foo} \section{Donald} \backmatter \chapter{bar} \section{Mickey} \end{document} ``` I expect to have chapter bar numbered as appendix A and section Mickey as A.1. Instead chapter bar is not numbered and section Mickey is 1.2, following section Donald. If I insert the appendix command to obtain ``` \documentclass{book} \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{foo} \section{Donald} \backmatter \appendix \chapter{bar} \section{Mickey} \end{document} ``` then chapter bar is unnumbered and section Mickey is numbered as .1. What am I doing wrong?
https://tex.stackexchange.com/users/260
Numbering of appendices in the backmatter of a book
false
Try putting `\backmatter` after your appendices?
8
https://tex.stackexchange.com/users/759
1886
1,321
https://tex.stackexchange.com/questions/1887
14
I have no experience with TeX or any other typesetting system. I am going to university soon and have been told that I should learn LaTeX as it will help with bibliographies and essay writing. I am also self employed and would like to generate invoices in the future. My original intention was just to learn LaTeX, however I found out about ConTeXt and now am a bit confused by the different options! What are the advantages and disadvantages of the different typesetting systems?
https://tex.stackexchange.com/users/858
What typesetting system should I use?
false
It is safe to say that in general ConTeXt focuses a bit more on typography and a bit less on structure than LaTeX. There is quite a lot of functionality to handle page layouts, page arrangements, and page layering, for example. Some other strong points of ConTeXt: * Multi-lingual interface with support for markup commands in Czech, Dutch, English, French, German, Italian, Persian and Rumanian. * Although extensibility is offered via a module system, the equivalent functionality of many (if not most) of the commonly used LaTeX packages is built into the ConTeXt core. * ConTeXt’s unified design avoids the package clashes that can happen with LaTeX * Extensive use of key-value setup commands means that defining your own style is quite easy. * ConTeXT has an active mailing list that is closely monitored by the core developers. * ConTeXt integrates a superset of MetaPost called MetaFun which allows the users to use the drawing abilities of MetaPost for page backgrounds and ornaments. * ConTeXt closely follows LuaTeX development. * ConTeXt provides a command-line wrapper script that among other this takes care of setting document modes and making sure that enough typesetting runs are done auomatically to resolve all references correctly. * It is possible to process xml and mathml files directly.
14
https://tex.stackexchange.com/users/89
1888
1,322
https://tex.stackexchange.com/questions/1887
14
I have no experience with TeX or any other typesetting system. I am going to university soon and have been told that I should learn LaTeX as it will help with bibliographies and essay writing. I am also self employed and would like to generate invoices in the future. My original intention was just to learn LaTeX, however I found out about ConTeXt and now am a bit confused by the different options! What are the advantages and disadvantages of the different typesetting systems?
https://tex.stackexchange.com/users/858
What typesetting system should I use?
false
In addition to Taco's answer: there is an entry in the TeX FAQ: <https://texfaq.org/FAQ-context>
3
https://tex.stackexchange.com/users/243
1889
1,323
https://tex.stackexchange.com/questions/1887
14
I have no experience with TeX or any other typesetting system. I am going to university soon and have been told that I should learn LaTeX as it will help with bibliographies and essay writing. I am also self employed and would like to generate invoices in the future. My original intention was just to learn LaTeX, however I found out about ConTeXt and now am a bit confused by the different options! What are the advantages and disadvantages of the different typesetting systems?
https://tex.stackexchange.com/users/858
What typesetting system should I use?
false
LaTeX is more of a standard document preparation system in academia. So if you ever want to submit a paper to a journal or conference and want to do it in TeX, LaTeX is your option. But if you have time, I would recommend learn both and then focus on one for your long term use, business, personal or academic. BTW, universities usually have free training courses on these computing skills.
10
https://tex.stackexchange.com/users/337
1890
1,324
https://tex.stackexchange.com/questions/1891
30
I have an article with the following figure (there are 2 small charts near each other, horizontally): ``` \begin{figure}[h] \centering \includegraphics{left-graph} \includegraphics{right-graph} \caption{My caption}\label{mylabel} \end{figure} ``` I reference the figure with: ``` Figure~\ref{fig:result} shows bla-bla-bla. ``` The rendered PDF shows **??** instead of the figure number. I tried with the reference occurring both before and after the figure (in the LaTeX source), but it didn't make a difference. The relevant packages I'm using are below (those removed are for titling). ``` \usepackage[english]{babel} \usepackage{graphicx} \usepackage[letterpaper]{geometry} \geometry{top=1.0in, bottom=1.0in, left=1.5in, right=1.0in} \usepackage{flafter} % make sure figures do not appear before their text \usepackage{sidecap} % use side captions for floats \usepackage{subfig} % subfloats ``` I'm not sure what's wrong here, advice is appreciated. I'm using MiKTeX 2.8. Thank you!
https://tex.stackexchange.com/users/564
Figure reference \ref{fig:result} renders as ?? in PDF
true
Your labels don't match. Change the reference to `\ref{mylabel}` or the label to `label{fig:result}`
35
https://tex.stackexchange.com/users/627
1892
1,325
https://tex.stackexchange.com/questions/1891
30
I have an article with the following figure (there are 2 small charts near each other, horizontally): ``` \begin{figure}[h] \centering \includegraphics{left-graph} \includegraphics{right-graph} \caption{My caption}\label{mylabel} \end{figure} ``` I reference the figure with: ``` Figure~\ref{fig:result} shows bla-bla-bla. ``` The rendered PDF shows **??** instead of the figure number. I tried with the reference occurring both before and after the figure (in the LaTeX source), but it didn't make a difference. The relevant packages I'm using are below (those removed are for titling). ``` \usepackage[english]{babel} \usepackage{graphicx} \usepackage[letterpaper]{geometry} \geometry{top=1.0in, bottom=1.0in, left=1.5in, right=1.0in} \usepackage{flafter} % make sure figures do not appear before their text \usepackage{sidecap} % use side captions for floats \usepackage{subfig} % subfloats ``` I'm not sure what's wrong here, advice is appreciated. I'm using MiKTeX 2.8. Thank you!
https://tex.stackexchange.com/users/564
Figure reference \ref{fig:result} renders as ?? in PDF
false
Besides the mistake noted by Lev Bishop (assuming that you just did some incomplete editing for this post, and in reality the labels match), it is possible that you did not run latex enough times. For the labels to work out you need to run it at least twice.
8
https://tex.stackexchange.com/users/211
1893
1,326
https://tex.stackexchange.com/questions/1319
976
If you were asked to show examples of beautifully typeset documents in TeX & friends, what would you suggest? Preferably documents available online (I'm aware I could go to a bookstore and find many such documents called 'books'). Extra bonus for documents whose LaTeX source is available. This is not an idle question. Seeing great examples of any craft is both educational and inspiring, let alone explaining why we prefer TeX to Word or other text editors. For instance, I like how Philipp Lehman's [Font Installation Guide](https://texdoc.org/serve/fontinstallationguide/0) looks. I don't know enough LaTeX to realize how much customization was done, but the ToC looks polished. Your nominations, please ...
https://tex.stackexchange.com/users/564
Showcase of beautiful typography done in TeX & friends
false
The handbook for the memoir class showcases quite a few different layouts, some of which I would call quite beautiful.
10
https://tex.stackexchange.com/users/194
1894
1,327
https://tex.stackexchange.com/questions/1895
5
I have this shaded circle: ``` \shade [ball color=black!80!white] (0,0) circle (1); ``` Is it possible to encapsulate it with node style and fixing the circle radius?
https://tex.stackexchange.com/users/69
TikZ: How to encapsulate shade in node?
false
You could define a style for nodes using `\tikzstyle`: ``` \documentclass{article} \usepackage{tikz} \begin{document} \tikzstyle{ball} = [circle,shading=ball, ball color=black!80!white, minimum size=1cm] \begin{tikzpicture} \node [style=ball] {}; \end{tikzpicture} \end{document} ``` Output:
5
https://tex.stackexchange.com/users/213
1896
1,328
https://tex.stackexchange.com/questions/837
44
My institution's letterhead is available as a PDF file. The PDF is not just of the logo (to be placed in a corner), but of the entire page. Is it possible to make this PDF the background of the first page of my document?
https://tex.stackexchange.com/users/35
PDF letterhead as document background
false
Here is a example with eso-pic, that uses frontpage.pdf for the first page and normalBackground.pdf for the rest. First create 2 macros that can be used later. ``` \usepackage{graphicx} \usepackage{eso-pic} \newcommand\BackgroundPicFront{ \put(0,0){ \parbox[b][\paperheight]{\paperwidth}{ \vfill \centering \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{frontpage}% \vfill } } } \newcommand\BackgroundPic{ \put(0,0){ \parbox[b][\paperheight]{\paperwidth}{ \vfill \centering \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{normalBackground}% \vfill } } } ``` Then use those macros and don't forget to "clear"/"remove" the first background when you add the next background. ``` \AddToShipoutPicture{\BackgroundPicFront} \ClearShipoutPicture \AddToShipoutPicture{\BackgroundPic} ``` Have fun
9
https://tex.stackexchange.com/users/795
1897
1,329
https://tex.stackexchange.com/questions/1898
14
What is the best way to draw checker board in tikz? I'm interested in what is the best way to draw many circular pieces on board. (the checker background is not important)
https://tex.stackexchange.com/users/69
Checkers board in TikZ.
true
I suggest to use a `matrix of nodes` from the tikz matrix library. A small example using the style devloped in the [other topic](https://tex.stackexchange.com/questions/1895/tikz-how-to-encapsulate-shade-in-node): ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \tikzstyle{ball} = [circle, shading=ball, ball color=black!80!white, minimum size=1cm] \begin{tikzpicture} \matrix (m) [matrix of nodes,nodes=ball] { {} & & {} & & {} & & {} & \\ & {} & & {} & & {} & & {} \\ {} & & {} & & {} & & {} & \\}; \end{tikzpicture} \end{document} ``` Output:
11
https://tex.stackexchange.com/users/213
1899
1,330
https://tex.stackexchange.com/questions/1898
14
What is the best way to draw checker board in tikz? I'm interested in what is the best way to draw many circular pieces on board. (the checker background is not important)
https://tex.stackexchange.com/users/69
Checkers board in TikZ.
false
TikZ usually has more than one way to produce a result. Stefan's solution is perfectly fine, but here is another way: TikZ has some programming constructs and many math functions built in that can be used to quickly generate all kinds of diagrams: ``` \begin{tikzpicture} \foreach \row in {0, 1, 2} { \foreach \column in {0, 1, ..., 3} { \fill[shading=ball, ball color=black!80] ({2*\column+mod(\row,2)}, -\row) circle (0.5cm); } } \end{tikzpicture} ``` This produces exactly the same picture as Stefan's solution does (well, except for a slightly changed bounding box because of the matrix padding). The advantage is that you can easily change the size by changing a few numbers and that you can put anything you like inside the foreach loops.
9
https://tex.stackexchange.com/users/83
1902
1,331
https://tex.stackexchange.com/questions/1900
11
``` \tikzstyle{...}=[...] ``` This command seems to be extremely useful since it allows to re-use the same style in multiple TikZ pictures. Is is used in a few places in TikZ manual (pgfmanual.pdf), but why it is not defined or described? What are the other useful commands not described in TikZ manual?
https://tex.stackexchange.com/users/69
Undocumented useful commands in Tikz
false
The command `\tikzstyle` is not well documented because the author would like to encourage users to set styles locally instead. Styles should be declared ``` \begin{tikzpicture}[..., certain style/.style={...}, ...] ... \en{tikzpicture} ``` This way the style belongs to that picture. Perhaps read this message of the author Till Tantau: [Keeping the tikzstyle command](http://osdir.com/ml/tex.pgf.user/2007-08/msg00004.html).
11
https://tex.stackexchange.com/users/213
1903
1,332
https://tex.stackexchange.com/questions/1904
15
I need to do the following: For the first page of every section, the page number should be at the bottom and centered. The text should stop one "double space" above it. For all other pages, the page number should be at the top right, with the text starting one "double space" below that. How can I: 1. Change the location of the page number according to the above? 2. How can I specify a "double space" distance above/below the page number?
https://tex.stackexchange.com/users/nan
Changing page number location
true
You could use a package like `fancyhdr` or `scrpage2` to customize header and footer. Compile this example and look at header and footer of the pages with filler text: ``` \documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{fancyhdr} \renewcommand*{\headrulewidth}{0pt} \fancyhf{} \rhead{\thepage} \pagestyle{fancy} \begin{document} \thispagestyle{plain} \blinddocument \end{document} ``` The commands and their usage are described in the [fancyhdr manual](http://tug.ctan.org/tex-archive/macros/latex/contrib/fancyhdr/fancyhdr.pdf).
13
https://tex.stackexchange.com/users/213
1905
1,333
https://tex.stackexchange.com/questions/1906
76
What is the easiest way to make a cursive, lowercase ell in LaTeX math mode?
https://tex.stackexchange.com/users/512
Cursive, lowercase ell
true
Simply use `$\ell$`
96
https://tex.stackexchange.com/users/401
1908
1,334
https://tex.stackexchange.com/questions/1906
76
What is the easiest way to make a cursive, lowercase ell in LaTeX math mode?
https://tex.stackexchange.com/users/512
Cursive, lowercase ell
false
Well `\( \ell \)`
28
https://tex.stackexchange.com/users/73
1909
1,335
https://tex.stackexchange.com/questions/1898
14
What is the best way to draw checker board in tikz? I'm interested in what is the best way to draw many circular pieces on board. (the checker background is not important)
https://tex.stackexchange.com/users/69
Checkers board in TikZ.
false
The difficulty with Caramdir's approach is that it is *too* regular so it would be hard, for example, to display the layout of the board in an actual game. Stefan's is better at that, but doesn't have the grid. However, a grid is very regular so Caramdir's approach can be adapted to that. So here's my version which is an amalgamation of the two. First, the result: Some things to note: 1. These are meant to be checkers pieces, after all! 2. Using the "between origins" option in the matrix spacing means that the checkers (aka nodes) are placed very precisely on the squares. 3. As in Stefan's answer, the syntax for actually placing the checkers on their squares is very intuitive. 4. The only thing left is a simple syntax for changing the colour of the pieces! ``` \documentclass{article} \pagestyle{empty} \usepackage{tikz} \usetikzlibrary{matrix,shapes.geometric} \begin{document} \tikzstyle{checker} = [cylinder, minimum width=.8cm, shape border rotate=90,cylinder end fill=gray!50!white, cylinder body fill=gray, cylinder uses custom fill] \begin{tikzpicture} \draw[ultra thick] (0,0) rectangle (8,-8); \foreach \row in {0,1, ..., 7} { \foreach \column in {0, ..., 3} { \fill ({2*\column + mod(\row,2)}, -\row) rectangle +(1,-1); } } \matrix (m) at (0,0) [matrix of nodes,nodes=checker, anchor=north west,column sep={1cm,between origins}, row sep={1cm,between origins}] { {} & {} & {} & & {} & & {} & \\ & & & {} & {} & {} & & {} \\ & {} & {} & & & & {} & \\ & {} & & {} & & {} & & {} \\ {} & & & {} & {} & & {} & \\ & {} & & {} & & {} & & {} \\ & & {} & & & & {} & \\ & & & {} & {} & {} & & {} \\ }; \end{tikzpicture} \end{document} ``` **Update 2012-03-09:** As this has just returned to the front page, I decided to see if I could fix the colours and the "kings". Thanks to Ryan Reich's [trace-pgfkeys](https://tex.stackexchange.com/q/34712/86) package, I figured out a way to set the colours and size. Here's the new code; I've slightly cleaned up the original and added the colour checking. The complicated bit (which Ryan's code was invaluable for) was figuring out how to set the colour from any ambient colour that might have been set. ``` \documentclass{article} %\url{https://tex.stackexchange.com/a/1911/86} \usepackage{tikz} %\usepackage{trace-pgfkeys} \usetikzlibrary{matrix,shapes.geometric} \makeatletter \colorlet{checkertint}{gray!70!white} \tikzset{ checker/.style={ draw, cylinder, minimum width=.8cm, shape border rotate=90, set checker colour=#1, cylinder uses custom fill, }, king/.style={ minimum height=.8cm, }, checker default colour/.initial=gray!50!white, set checker colour/.code={% \tikz@addoption{% \def\ch@color{#1}% \def\@tempa{\pgfkeysnovalue}% \ifx\ch@color\@tempa \ifx\tikz@fillcolor\pgfutil@empty \ifx\tikz@strokecolor\pgfutil@empty \ifx\tikz@textcolor\pgfutil@empty \pgfkeysgetvalue{/tikz/checker default colour}{\ch@color}% \else \let\ch@color\tikz@textcolor \fi \else \let\ch@color\tikz@strokecolor \fi \else \let\ch@color\tikz@fillcolor \fi \fi \pgfsetstrokecolor{\ch@color!50!checkertint}% \pgfkeys{ /tikz/cylinder end fill=\ch@color!80!checkertint, /tikz/cylinder body fill=\ch@color!50!checkertint } } } } \makeatother \begin{document} \begin{tikzpicture} \draw[ultra thick] (0,0) rectangle (8,-8); \foreach \row in {0,1, ..., 7} { \foreach \column in {0, ..., 3} { \fill ({2*\column + mod(\row,2)}, -\row) rectangle +(1,-1); } } \matrix (m) at (0,0) [ matrix of nodes, checker default colour=white, nodes=checker, anchor=north west, column sep={1cm,between origins}, row sep={1cm,between origins} ] { |[black]| {} & {} & {} & & {} & & {} & \\ & & & {} & {} & {} & & {} \\ &|[black,king]| {} & {} & & & & {} & \\ & {} & & {} & & {} & & {} \\ |[king]| {} & & & {} & {} & & {} & \\ & {} & & {} & & {} & & {} \\ & & {} & & & & {} & \\ & & & {} & {} & {} & & {} \\ }; \end{tikzpicture} \end{document} ``` Here's a new image.
18
https://tex.stackexchange.com/users/86
1911
1,336
https://tex.stackexchange.com/questions/1901
18
This is what I'm after: I'd like to have the sentence 'John loves his mother.' displayed with an arrow running from 'his' to 'John'. I looked at `gb4e`, but I found the documentation confusing and I haven't been able to make it work.
https://tex.stackexchange.com/users/451
How can I draw arrows between words in linguistic examples?
false
Use TikZ ``` \documentclass{article} \usepackage{tikz} \begin{document} \tikzstyle{every picture}+=[remember picture] \tikzstyle{na} = [shape=rectangle,inner sep=0pt,text depth=0pt] \tikz\node[na](word1){John}; loves \tikz\node[na](word2){his}; mother. \begin{tikzpicture}[overlay] \path[->,red,thick](word2) edge [out=90, in=90] (word1); \end{tikzpicture} \end{document} ``` I don't know what type of arrow you want =)
11
https://tex.stackexchange.com/users/137
1912
1,337
https://tex.stackexchange.com/questions/1914
46
I often see people creating new macros where the macro token is surrounded by braces. For example, ``` \newcommand{\foo}{foo} ``` This is unnecessary and I find the extra braces make it harder to read. Why do people do this? (As an aside, I've even seen people try to use `\let{\foo}{\bar}` which, of course, doesn't work.)
https://tex.stackexchange.com/users/647
Why do people use unnecessary braces?
false
What's easy to read for one person is not necessarily easy to read for another. Personally I find: ``` \newcommand{\foo}{foo} ``` *much* easier to read than: ``` \newcommand\foo{foo} ``` In particular, it clearly reveals what the two arguments to the function are, which the latter does not.
34
https://tex.stackexchange.com/users/411
1916
1,338
https://tex.stackexchange.com/questions/1914
46
I often see people creating new macros where the macro token is surrounded by braces. For example, ``` \newcommand{\foo}{foo} ``` This is unnecessary and I find the extra braces make it harder to read. Why do people do this? (As an aside, I've even seen people try to use `\let{\foo}{\bar}` which, of course, doesn't work.)
https://tex.stackexchange.com/users/647
Why do people use unnecessary braces?
false
Code should be readable and understandable. Using braces for all arguments, even if they aren't necessary, is more consistent. So, I prefer to use braces to not confuse unexperienced users. Leslie Lamport writes in *LaTeX - A Document Preparation System*: "Macho TeX programmers sometimes remove the braces around the first argument of `\newcommand`; don't do it yourself." Leslie Lamport is the initial developer of LaTeX. In the reference manual he specified the syntax of `\newcommand` to have braces: `\newcommand{cmd}[args][opt]{def}`. That no error occurs if you deviate from a syntax doesn't mean that this deviation is correct and will work for all times and that automatic syntax checker will understand that this deviation would do no harm, for `\newcommand`, `\renewcommand`, `\providecommand` and their starred environments and perhaps for all places where braces belong to the syntax but aren't strictly necessary. Since `\let` is not a LaTeX command, that syntax doesn't apply.
39
https://tex.stackexchange.com/users/213
1917
1,339
https://tex.stackexchange.com/questions/1915
1
> > **Possible Duplicate:** > > [Using opacity in TikZ causes strange rendering in Acrobat.](https://tex.stackexchange.com/questions/9261/using-opacity-in-tikz-causes-strange-rendering-in-acrobat) > > > This is a nice pice of TikZ for typesetting Go boards (gobans). ``` \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shadows} %% ----------------------------------------------------------------------------- \definecolor{wood}{rgb}{0.80,0.65,0.36} \newcommand{\goban}[2]{ \clip (0.3,0.3) rectangle (#1+0.5,#2+0.5); \fill [color=wood] (0,0) rectangle (20,20); \draw [step=1] (1,1) grid (19,19); \draw [thick] (1,1) -- (1,19) -- (19, 19) -- (19, 1) -- cycle; \foreach \row in {4, 10, 16} { \foreach \column in {4, 10, 16} { \fill (\row,\column) circle (0.07); } } } \tikzstyle{stone}=[ ball color = #1!70!gray, circle, %drop shadow, minimum size = 0.95cm ] \newcommand{\wstone}[2]{\node[black,stone=white] at (#1) {#2};} \newcommand{\bstone}[2]{\node[white,stone=black] at (#1) {#2};} %% ----------------------------------------------------------------------------- \begin{document} % \begin{tikzpicture} \goban {10} {7} \bstone {4,4} {} \wstone {6,3} {1} \bstone {3,6} {2} \wstone {4,2} {3} \bstone {3,3} {4} \wstone {9,3} {5} \end{tikzpicture} % \end{document} %% ----------------------------------------------------------------------------- ``` The "drop shadow" is commented out. If I uncomment it a shadow appears where it should, but also a whole picture become darker. Why such thing is happening? How can I avoid it?
https://tex.stackexchange.com/users/69
Tikz: Strange color change.
false
I suggest check your output using another pdf viewer, if there are differences as well. It could be a reader issue.
2
https://tex.stackexchange.com/users/213
1918
1,340
https://tex.stackexchange.com/questions/1920
15
I'm using `\cite` a lot in my document, but now I discovered that I really need `\citep` instead (from natbib). No problem, I thought, just redefine the `\cite` command: ``` \renewcommand{\cite}[1]{\citep{#1}} ``` That worked for the `LaTeX` version on my laptop (Mac), but on my Linux box this `\renewcommand` has no effect. How can I safely redefine the `\cite` command, so that it works on all LaTeX distributions? P.S.: The version where it didn't work is this: ``` pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian) kpathsea version 5.0.0 ``` Update: After `\let` didn't work either (see answer) I found the source of the trouble: I had the `\usepackage{natbib}` command *after* my `\renewcommand{\cite}` command. Changing the order fixed it.
https://tex.stackexchange.com/users/3860
\renewcommand{\cite} does not work
false
You could try ``` \let\cite\citep ``` instead. Update: after seeing your upated question: I assume `\let` would have worked if you would have placed it after `\usepackage{natbib}` as well. Generally, placing redefinitions after all packages have been loaded prevents macros from beeing accidentally overwritten.
8
https://tex.stackexchange.com/users/213
1921
1,341
https://tex.stackexchange.com/questions/1914
46
I often see people creating new macros where the macro token is surrounded by braces. For example, ``` \newcommand{\foo}{foo} ``` This is unnecessary and I find the extra braces make it harder to read. Why do people do this? (As an aside, I've even seen people try to use `\let{\foo}{\bar}` which, of course, doesn't work.)
https://tex.stackexchange.com/users/647
Why do people use unnecessary braces?
false
Contra Stefan (and therefore contra Leslie Lamport), and at the risk of weighing in on a matter involving personal style, I very much *prefer* the forms `\newcommand\foo{...\baz{\bar}...}` to `\newcommand{\foo}{...\baz{\bar}...}` and `\newcommand*\foo[n]{...\baz{\bar}...}` to `\newcommand*{\foo}[n]{...\baz{\bar}...}`. My reasons are as follows: * When standing in this position, `\foo` is a distinguished entity with a very different role to to play than `\bar`. For that reason, I like to lexically distinguish it as such. * To run with TH's point above, the pattern `\newcommand*{\foo}[n]{...}` is, for someone who must regularly interpret and sometimes produce TeX and LaTeX-interspersed code, ... well, let's say, a little 'over-ornate'. Re my second point, the human brain (yes, I actually *do* hold a research degree in neuropsych and learning), has to manage a huge amount of information during programming and program maintenance. Personally for my tiny little brain, the more regular the patterns it has to deal with, the fewer times it must take its metaphorical eye off the ball and attend to non-problem related tasks. The converse is also true. Of course, I wish it weren't so, but (sadly even more so than in any other computer language I have encountered), this situation is very much the case with the TeX et al. family. [And, here, JW, comes my major and so far only gripe with LaTeX3 - it is layering even *more* lexical pattern-breaking onto an already complex lexical (let alone syntactic or semantic or pragmatic or programmatic) pattern space. Of course, I agree that there are good *technical* reasons for this (encapsulation/namespaces being one), however real *psychological* tradeoffs accrue to *real* programmers managing *real* TeX/LateX2/LaTeX3(/LuaTeX) systems. I'm afraid (actually, I'm certain) that as this sort of complexity increases, the program error rate in these systems (and the commercial and non-commercial costs of producing and maintaining them) is going to increase in complex ways as well. Thank God we don't build rocket ships or commercial systems with this code! It might be provably deterministic Turing machine complete, but for heavens sake, TeX/LateX2/LaTeX3(/LuaTeX)'s little programming idioms like `\newcommand{\foo}{...}` and myriad ilk add like grains of sand to our psychological ability to build robust stuff in this code. And that is why I prefer to keep lexical patterns like `\newcommand\foo{...}` as far as possible in harmony with the patterns that TeX has for better or worse delivered earlier to us.] My tuppenny-ha'pence, guys and gals, sorry for taking the bait :))
27
https://tex.stackexchange.com/users/416
1922
1,342
https://tex.stackexchange.com/questions/1914
46
I often see people creating new macros where the macro token is surrounded by braces. For example, ``` \newcommand{\foo}{foo} ``` This is unnecessary and I find the extra braces make it harder to read. Why do people do this? (As an aside, I've even seen people try to use `\let{\foo}{\bar}` which, of course, doesn't work.)
https://tex.stackexchange.com/users/647
Why do people use unnecessary braces?
false
I tend to use braces in all but a few situations, just for clarity. So in the specific case you give above, I would definitely use braces to make it clear that `\foo` is a separate token/entity that is part of the *definition* of the command. Essentially the only exception I have to the braces rule is for superscripts and subscripts consisting of a single character, so `a_i` rather than `a_{i}`. But there have been many occasions when I have regretted that as well, since I have often forgotten to add the braces back in when making the expression more complicated...
5
https://tex.stackexchange.com/users/76
1923
1,343
https://tex.stackexchange.com/questions/1756
189
I have heard a lot about `LaTeX`, but never used it myself. It is mainly used for typesetting professional research papers. But I am not writing research papers. Is `LaTeX` for me? If yes, why should I be shifting from `OpenOffice` to `LaTeX`? What does `LaTeX` offer to the normal user who uses word processing software to make all kind of report documents?
https://tex.stackexchange.com/users/813
Why should I use LaTeX?
false
1. I use LaTeX because it allows me not to think about the visual aspect of documents. I get a high quality layout, even if boring, of aricle etc. but I don't have to choose anything. Presentation may not have fancy animation but it will have 'professional look' without work. 2. LaTeX allows typesetting math easily. Really - writing `\alpha` is quicker then searching alpha symbol in GUI. Similary writing `x^y` is quicker then searching power in list of symbols. I guess with AMS packages included LaTeX have much more symbols then anything else. 3. PDF guarantees same-look on everything. You won't run into problem because the computer you're useing don't have some fonts installed. 4. You can script it (program it) 5. It is plain text, open source and highly stable 6. It is standard (at least for many CS/Physics/Math... departments). When I want to send an e-mail about math I use LaTeX because other side will probably understend (1. because it is standard but 2, because it is intuitive) 7. It has many packages that allows vector graphics (tikz for example) To conclude. **Use it if**: * You type a lot of equation * You like plain text, stable formats * You don't want to bother with formatting documents **Don't use it if**: * You want to control every graphical aspect of whole document (it is possible to create custom layout but LaTeX is not designed to fine-tuning every page) * You are afraid of plain text (however - you can use some WYSIWYG) * You need to exchange documents with non-LaTeX people (for example someone requires doc and it's final)
23
https://tex.stackexchange.com/users/592
1925
1,344
https://tex.stackexchange.com/questions/422
100
Often in my papers I want to mention theorems in the introduction that are introduced in more detail and proved in a later section. I'd like to include the statement of these theorems twice over, each time numbered as the theorem would naturally appear in its later section. My current solution (using amsthm) is, e.g. ``` %(in the introduction) \newtheorem*{thm:associativity}{Theorem \ref{thm:associativity}} \begin{thm:associativity} Lorem ipsum ... \end{thm:associativity} %(in a later section) \begin{thm} \label{thm:associativity} Lorem ipsum ... \end{thm} ``` > > Can anyone think of a cleaner solution? > > >
https://tex.stackexchange.com/users/77
How do I repeat a theorem number?
false
Here is how I do it: ``` \documentclass{article} \usepackage{amsthm} \theoremstyle{plain} \newtheorem{thm}{Theorem}[section] \newtheoremstyle{TheoremNum} {\topsep}{\topsep} %%% space between body and thm {\itshape} %%% Thm body font {} %%% Indent amount (empty = no indent) {\bfseries} %%% Thm head font {.} %%% Punctuation after thm head { } %%% Space after thm head {\thmname{#1}\thmnote{ \bfseries #3}}%%% Thm head spec \theoremstyle{TheoremNum} \newtheorem{thmn}{Theorem} \begin{document} \begin{thmn}[\ref{T:1}] $1+1 = 2$ \end{thmn} \begin{thm}\label{T:1} $1+1 = 2$ \end{thm} \end{document} ```
13
https://tex.stackexchange.com/users/867
1926
1,345
https://tex.stackexchange.com/questions/1920
15
I'm using `\cite` a lot in my document, but now I discovered that I really need `\citep` instead (from natbib). No problem, I thought, just redefine the `\cite` command: ``` \renewcommand{\cite}[1]{\citep{#1}} ``` That worked for the `LaTeX` version on my laptop (Mac), but on my Linux box this `\renewcommand` has no effect. How can I safely redefine the `\cite` command, so that it works on all LaTeX distributions? P.S.: The version where it didn't work is this: ``` pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian) kpathsea version 5.0.0 ``` Update: After `\let` didn't work either (see answer) I found the source of the trouble: I had the `\usepackage{natbib}` command *after* my `\renewcommand{\cite}` command. Changing the order fixed it.
https://tex.stackexchange.com/users/3860
\renewcommand{\cite} does not work
false
As you noted, the order matters. Note that you can get roughly the same effect of your \renewcommand with less work by doing ``` \renewcommand\cite{\citep} ``` That is, you don't need the argument. This can often be necessary for things like \url that change catcodes before looking at arguments, but probably don't make any difference in this case.
16
https://tex.stackexchange.com/users/647
1928
1,346
https://tex.stackexchange.com/questions/1914
46
I often see people creating new macros where the macro token is surrounded by braces. For example, ``` \newcommand{\foo}{foo} ``` This is unnecessary and I find the extra braces make it harder to read. Why do people do this? (As an aside, I've even seen people try to use `\let{\foo}{\bar}` which, of course, doesn't work.)
https://tex.stackexchange.com/users/647
Why do people use unnecessary braces?
true
With my LaTeX3 'hat' on, I'd like to give a slightly different perspective. This will overlap with the other answers, but hopefully will be useful. To follow this you need to understand 'tokens', I'm afraid. TeX turns input into tokens, and in particular control sequences such as `\bar` are single tokens. When Leslie Lamport designed LaTeX, he decided that *all* LaTeX arguments should be wrapped in braces. This is in contrast to TeX, where many of the primitives require arguments without braces. However, when only a single token is begin passed you can omit the braces, hence the fact that ``` \newcommand{\bar} ``` and ``` \newcommand\bar ``` both work. There are really two different cases where you can omit braces: 1. Cases where the argument is always a single token. This is the case for `\newcommand`, where you have to have a macro name as the argument. The braces will never be needed as the argument is always `\<something>`. I do not use braces for these. 2. Places where you are passing a single token to an argument that will accept more. The classic example would be a subscript, where `a_i` will work but you'd need `a_{ii}`. I would always use braces here, so favour `a_{i}`. The LaTeX3 part to this answer is that we are trying to be much more rigourous about which arguments are single tokens and which are multiple tokens. At the moment this is only happening at a code level, but I'd anticipate a similar approach for users. So if the argument must be a single token, then make this clear by *not* using braces. On the other hand, it the argument can take multiple tokens then you *must* use braces even if only passing a single token.
37
https://tex.stackexchange.com/users/73
1929
1,347
https://tex.stackexchange.com/questions/1930
146
Is there ever a case when the use of `\begingroup` is preferred to `\bgroup`? Obviously, `\bgroup` is necessary in cases where you need to have balanced braces and thus cannot use `{`, but when is it necessary to use `\begingroup`? A related question would be: What's the difference between a simple group and a semi-simple group?
https://tex.stackexchange.com/users/647
When should one use \begingroup instead of \bgroup?
true
`\bgroup` is a synonym for `{`, which is defined in Plain TeX using `\let\bgroup={`. It interacts with TeX's "digestive system" in hairy ways: `{`s and `\bgroup`s start the same sort of groups, called simple groups, and each can be terminated with either `}`s or `\egroup`s, since they are the same. But when the TeX digestive system encounters them, they are of different catcodes, so commands that look ahead, e.g., in LaTeX with `\section\bgroup Title}`, can break this matching. `\begingroup` is different. It is a TeX primitive, and it matches a different sort of group that TeX accounts for separately, called "semi-simple groups" (a Knuth joke, I assume). Thus a `\begingroup` must be terminated by an `\endgroup`, not a `}`, and vice versa for `\endgroup`. I generally avoid `\bgroup`, and use `\begingroup`, but `\bgroup` could be useful if you are messing about with a nested token list.
147
https://tex.stackexchange.com/users/175
1932
1,348
https://tex.stackexchange.com/questions/1931
29
I am in the process of writing a large document containing some theorems, lemma, and propositions. Currently, I am using packages `amsmath` and `amsthm`. I defined my own environment for theorems by adding ``` \theoremstyle{plain} \newtheorem{thm} {Theorem}[chapter] ``` to the preamble. However, I am not quite satisfied with the looks. So is there a possibility to change the way this would be displayed? I would like to have the word "Theorem" appear in *small caps*. Furthermore, I would like a line break after the theorem's title. What is the best way to do this? Are there nice packages for this purpose (prefereably without too much fiddling)?
https://tex.stackexchange.com/users/870
How to change the way theorems are displayed?
false
Try ``` \usepackage[amsthm]{ntheorem} \newcommand{\theoremheaderfont}{\scshape} ``` (using `ntheorem` in place of `amsthm`).
6
https://tex.stackexchange.com/users/175
1933
1,349
https://tex.stackexchange.com/questions/1931
29
I am in the process of writing a large document containing some theorems, lemma, and propositions. Currently, I am using packages `amsmath` and `amsthm`. I defined my own environment for theorems by adding ``` \theoremstyle{plain} \newtheorem{thm} {Theorem}[chapter] ``` to the preamble. However, I am not quite satisfied with the looks. So is there a possibility to change the way this would be displayed? I would like to have the word "Theorem" appear in *small caps*. Furthermore, I would like a line break after the theorem's title. What is the best way to do this? Are there nice packages for this purpose (prefereably without too much fiddling)?
https://tex.stackexchange.com/users/870
How to change the way theorems are displayed?
true
`amsthm` provides the `\newtheoremstyle` command for defining new theorem styles. It is described in the [`amsthm` documentation](http://tug.ctan.org/tex-archive/macros/latex/required/amslatex/amscls/doc/amsthdoc.pdf). To have a style that is the same as `plain` except for the header font, you can use ``` \newtheoremstyle{mytheoremstyle} % name {\topsep} % Space above {\topsep} % Space below {\itshape} % Body font {} % Indent amount {\scshape} % Theorem head font {.} % Punctuation after theorem head {.5em} % Space after theorem head {} % Theorem head spec (can be left empty, meaning ‘normal’) \theoremstyle{mytheoremstyle} \newtheorem{thm}{Theorem} ``` The [`ntheorem`](http://ctan.org/pkg/ntheorem) package provides even more flexibility (as Charles hinted).
34
https://tex.stackexchange.com/users/83
1934
1,350
https://tex.stackexchange.com/questions/1319
976
If you were asked to show examples of beautifully typeset documents in TeX & friends, what would you suggest? Preferably documents available online (I'm aware I could go to a bookstore and find many such documents called 'books'). Extra bonus for documents whose LaTeX source is available. This is not an idle question. Seeing great examples of any craft is both educational and inspiring, let alone explaining why we prefer TeX to Word or other text editors. For instance, I like how Philipp Lehman's [Font Installation Guide](https://texdoc.org/serve/fontinstallationguide/0) looks. I don't know enough LaTeX to realize how much customization was done, but the ToC looks polished. Your nominations, please ...
https://tex.stackexchange.com/users/564
Showcase of beautiful typography done in TeX & friends
false
I know two nice repositories (the last one has already been listed here): 1. [Dario Taraborelli](http://nitens.org/taraborelli/latex) shows some of the elegant and beautiful features of LaTeX. 2. There is the [TeX Showcase](http://www.tug.org/texshowcase/), edited by Gerben Wierda, which contains examples of what you can do with LaTeX. Most, if not all, of these examples are of exceptionally high quality.
22
https://tex.stackexchange.com/users/870
1935
1,351
https://tex.stackexchange.com/questions/1936
6
In the document class `amsart`, I get different vertical spacing around the caption in tables and figures. For instance, compare the difference: ``` \documentclass{amsart} \begin{document} \begin{figure} \begin{center} \begin{tabular}{c} Figure \end{tabular} \caption{Caption} \end{center} \end{figure} \begin{table} \begin{center} \begin{tabular}{c} Table \end{tabular} \caption{Caption} \end{center} \end{table} \end{document} ``` Is this a bug? More to the point, is there some way of getting the figure spacing in tables? If I change the document class to `article`, then the spacings become the same.
https://tex.stackexchange.com/users/541
In amsart, how I can get caption spacing in tables to be like that in figures?
true
Im amsart captions are usually positioned above a table and below a figure. It's very common in typesetting. That means, position the `\caption` command before you begin the tabular environment. Then there will be the appropriate space between the caption and the table. Or do you want to use the intended style? If needed, a quick fix would be to add the missing space manually before the caption: ``` \begin{center} \begin{tabular}{c} Table \end{tabular} \vspace{\abovecaptionskip} \caption{Caption} \end{center} \end{table} ``` In that case, consider to remove the space after the caption by this line in the preamble: ``` \setlength{\belowcaptionskip}{0pt} ``` Or set it to the space you like. Similar you can change the value of \abovecaptionskip. --- Alternatively, you could use the very fine `caption` package. It offers many ways of customizing caption format and justification. For instance, if you just write ``` \usepackage[tableposition=above]{caption} ``` then you may put \caption above the tabular environment and get the correct spacing. --- However, if you don't want to use the caption package, you could redefine the internal `\@makecaption` command of amsart by writing in your preamble: ``` \makeatletter \renewcommand{\@makecaption}[2]{% \setbox\@tempboxa\vbox{\color@setgroup \advance\hsize-2\captionindent\noindent \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}% \unskip\kern-2\captionindent\par \global\setbox\@ne\lastbox\color@endgroup}% \ifhbox\@ne % the normal case \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}% \fi \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}% \else % tempboxa contained more than one line \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}% \fi \addvspace\abovecaptionskip \hbox to\hsize{\kern\captionindent\box\@ne\hss}% \relax } \makeatother ``` I just removed the different handling of figures and other floats. The original code has the difference here: ``` \ifnum\@tempcnta<64 % if the float IS a figure... \addvspace\abovecaptionskip \hbox to\hsize{\kern\captionindent\box\@ne\hss}% \else % if the float IS NOT a figure... \hbox to\hsize{\kern\captionindent\box\@ne\hss}% \nobreak \vskip\belowcaptionskip \fi ``` just before the last `\relax`. Note, it's usually not a good idea to redefine internal commands like this. Such commands might be changed later. It's just a workaround for the moment. And doing it with `caption` package features is much more easier. --- Finally, note: using `\begin{center} ... \end{center}` inside a figure or float environment causes additional space since the center environment is a list environment internally, bringing some space before and after it. I recommend to use the command `\centering` instead. Perhaps see [`center` vs. `\centering`](http://texblog.net/latex-archive/layout/center-centering/).
9
https://tex.stackexchange.com/users/213
1937
1,352
https://tex.stackexchange.com/questions/1938
20
I'd like to format two groups of equations such that all their equal signs line up and such that I can put a big brace to the right of each block to annotate that block. The last part is easily achieved using the `aligned` environment of `amsmath`: ``` \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} \left.\begin{aligned} \alpha_X \times \alpha_Y &= \chi \\ \alpha_X \times \beta_Y &= \xi \\ \beta_X \times \beta_Y &= \zeta \end{aligned}\right\} \quad X<Y \\[2em] \left.\begin{aligned} \Upsilon_j &= 0 \\ \Psi_j &= \sqrt{\sinh E - \tan^2\tfrac{F}{2}} \\ \Gamma_j &= F \end{aligned}\right\} \quad j=1,\ldots,g \end{align} \end{document} ``` But that doesn't line up the equal signs. I guess I could achieve this with some manual horizontal white space, but I'd like something automatic. Something like the `split` environment which supports reusing the anchor points of the outside 'align' environment: ``` \begin{align} A &= 0 \\ BB &= AVE + VEA + EAV \\ \begin{split} CCC &= UVWXY + VWXYU + WXYUV \\ &\quad {} + XYUVW + YUVWX \end{split} \end{align} ``` Is there a way to make aligned reuse the anchor points of the outside `align`? Also, is there an automatic way to additionally line up the big braces in the first example?
https://tex.stackexchange.com/users/598
Aligning across 'aligned' equation blocks
false
You could adopt [Andrew's](https://tex.stackexchange.com/questions/1559/adding-a-large-brace-next-to-a-body-of-text/1570#1570) or [my](https://tex.stackexchange.com/questions/1559/adding-a-large-brace-next-to-a-body-of-text/1568#1568) answer to [this question](https://tex.stackexchange.com/questions/1559/adding-a-large-brace-next-to-a-body-of-text).
1
https://tex.stackexchange.com/users/83
1939
1,353
https://tex.stackexchange.com/questions/1940
7
I'd like to define acronyms via the `\de`f command. I know that the acronym package exists, but that's too much typing (`\ac{myacronym}` vs. `\myacronym`). The problem that I have is that for `\def\myacronym{acronym expanded}`, it won't have an empty space after it, so I can only use it in front of punctuation. For `\def\myacronym{acronym expanded }`, I cannot use it before punctuation because it always causes an empty space. My question is: How can I detect whether punctuation comes after the acronym, so I can dynamically generate a space only if needed. Also, it would be nice to be able to detect whether there is the string ". " before my acronym, so I could make the acronym uppercase dynamically. I guess this is kind of hard to do since those parameters are not passed to the function, but maybe somebody has an idea.
https://tex.stackexchange.com/users/nan
Custom acronyms via \def
false
Use the [`xspace`](http://ctan.org/pkg/xspace) package, and put `\xspace` at the end of your definitions.
2
https://tex.stackexchange.com/users/73
1941
1,354