title: Tamil/Indian Typesetting via ITRANS package

text: I am rather a beginner to LaTeX while I have already written quite some nice articles with it. Yet I am inquiring problems to get a particular package to run on Windows 7, namely **itrans**. I am using MikTex 2.9 and Texmaker on Windows 7 (64-bit) to produce LaTeX documents. Now I want to use Tamil typesetting via the `itrans` package. However, as you have mentioned in the below threads MikTex does not install the package automatically on Windows. I tried to follow your steps but receive the following error messages when trying to run your below code in Texmaker via 'XeLaTex' or 'LaTeX'.               \documentclass[11pt]{article}     \usepackage[preprocess]{itrans}          \newfont{\tmlb}{wntml12}     \newfont{\tmls}{wntml10}     \newfont{\devnf}{dvng10 scaled \magstep1}     #tamilifm=wntml.ifm     #tamilfont=\tmlb     #hindiifm=dvng.ifm     #hindifont=\devnf          \begin{document}     Thank you!     {#tamil na^nRi #endtamil}     {#hindi dhanyavaad #endhindi}     \end{document}      Log File:               LOG FILE :     This is XeTeX, Version 3.1415926-2.4-0.9998 (MiKTeX 2.9 64-bit) (preloaded format=xelatex 2013.9.22) 30 SEP 2013 08:51     entering extended mode     **Tamil.tex     ("C:\Users\Prasath\Documents\LaTeX course\Tamil.tex"     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,     croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,     lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n     german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman     ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm     an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl     ishmax, welsh, loaded.     ("C:\Program Files (x86)\MikTex 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files (x86)\MikTex 2.9\tex\latex\base\size11.clo"     File: size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     Requested font "cmr10" at 10.95pt     -> cmr10     )     \c@part=\count80     \c@section=\count81     \c@subsection=\count82     \c@subsubsection=\count83     \c@paragraph=\count84     \c@subparagraph=\count85     \c@figure=\count86     \c@table=\count87     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     ("C:\Program Files (x86)\MikTex 2.9\tex\latex\itrans\itrans.sty"     File: itrans.sty 1998/6/12     ("C:\Program Files (x86)\MikTex 2.9\tex\latex\itrans\idevn.tex"     Requested font "cmr6" scaled 1000     -> cmr6     Requested font "cmr8" scaled 1000     -> cmr8     Requested font "cmr9" scaled 1000     -> cmr9     ))     Requested font "wntml12" scaled 1000     -> wntml12     Requested font "wntml10" scaled 1000     -> wntml10     Requested font "dvng10" scaled 1200     -> dvng10     ! You can't use `macro parameter character #' in vertical mode.     l.7 #     tamilifm=wntml.ifm     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! LaTeX Error: Missing \begin{document}.     See the LaTeX manual or LaTeX Companion for explanation.     Type H <return> for immediate help.     ...     l.7 #t     amilifm=wntml.ifm     You're in trouble here. Try typing <return> to proceed.     If that doesn't work, type X <return> to quit.     ! You can't use `macro parameter character #' in horizontal mode.     l.8 #     tamilfont=\tmlb     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! You can't use `macro parameter character #' in horizontal mode.     l.9 #     hindiifm=dvng.ifm     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     Missing character: There is no i in font wntml12!     Missing character: There is no i in font wntml12!     Missing character: There is no i in font wntml12!     Missing character: There is no f in font wntml12!     Missing character: There is no v in font wntml12!     Missing character: There is no g in font wntml12!     Missing character: There is no . in font wntml12!     Missing character: There is no i in font wntml12!     Missing character: There is no f in font wntml12!     ! You can't use `macro parameter character #' in horizontal mode.     l.10 #     hindifont=\devnf     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     Missing character: There is no i in font wntml12!     Missing character: There is no i in font wntml12!     Missing character: There is no f in font wntml12!     Missing character: There is no o in font wntml12!     ("C:\Users\Prasath\Documents\LaTeX course\Tamil.aux")     LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 12.     LaTeX Font Info: ... okay on input line 12.     LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 12.     LaTeX Font Info: ... okay on input line 12.     LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 12.     LaTeX Font Info: ... okay on input line 12.     LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 12.     LaTeX Font Info: ... okay on input line 12.     LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 12.     LaTeX Font Info: ... okay on input line 12.     LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 12.     LaTeX Font Info: ... okay on input line 12.     ! You can't use `macro parameter character #' in horizontal mode.     l.14 {#     tamil na^nRi #endtamil}     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! Missing $ inserted.     <inserted text>     $     l.14 {#tamil na^     nRi #endtamil}     I've inserted a begin-math/end-math symbol since I think     you left one out. Proceed, with fingers crossed.     Requested font "cmmi10" at 10.95pt     -> cmmi10     Requested font "cmmi8" at 8.0pt     -> cmmi8     Requested font "cmmi6" at 6.0pt     -> cmmi6     Requested font "cmsy10" at 10.95pt     -> cmsy10     Requested font "cmsy8" at 8.0pt     -> cmsy8     Requested font "cmsy6" at 6.0pt     -> cmsy6     LaTeX Font Info: External font `cmex10' loaded for size     (Font) <10.95> on input line 14.     LaTeX Font Info: External font `cmex10' loaded for size     (Font) <8> on input line 14.     LaTeX Font Info: External font `cmex10' loaded for size     (Font) <6> on input line 14.     ! You can't use `macro parameter character #' in math mode.     l.14 {#tamil na^nRi #     endtamil}     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! Extra }, or forgotten $.     l.14 {#tamil na^nRi #endtamil}     I've deleted a group-closing symbol because it seems to be     spurious, as in `$x}$'. But perhaps the } is legitimate and     you forgot something else, as in `\hbox{$x}'. In such cases     the way to recover is to insert both the forgotten and the     deleted material, e.g., by typing `I$}'.     ! You can't use `macro parameter character #' in math mode.     l.15 {#     hindi dhanyavaad #endhindi}     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! You can't use `macro parameter character #' in math mode.     l.15 {#hindi dhanyavaad #     endhindi}     Sorry, but I'm not programmed to handle this case;     I'll just pretend that you didn't ask for it.     If you're in the wrong mode, you might be able to     return to the right one by typing `I}' or `I$' or `I\par'.     ! Missing $ inserted.     <inserted text>     $     l.16 \end{document}     I've inserted a begin-math/end-math symbol since I think     you left one out. Proceed, with fingers crossed.     [1     ] ("C:\Users\Prasath\Documents\LaTeX course\Tamil.aux") )     (\end occurred inside a group at level 1)     ### simple group (level 1) entered at line 14 ({)     ### bottom level     Here is how much of TeX's memory you used:     326 strings out of 429035     3275 string characters out of 3166907     51246 words of memory out of 3000000     3646 multiletter control sequences out of 15000+200000     7707 words of font info for 27 fonts, out of 3000000 for 9000     912 hyphenation exceptions out of 8191     21i,4n,19p,167b,111s stack positions out of 5000i,500n,10000p,200000b,50000s     Output written on Tamil.pdf (1 page).      I am not quite sure how to approach these error messages. So far I followed your instructions from another thread: > Typesetting Tamil is possible with the itrans pakcage, but it's not packaged > properly in MikTeX. You will need to install it manually. Download > itrans53-win32.zip from CTAN. After unzipping the contents (say > C:\itrans53), assuming 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. You would need to evoke itrans.exe in the itrans53\bin folder. > (However I'm not sure if it works in 64-bit Windows.) Do you have other suggestions what I can do? Or is there a how-to for _Dummies_ available anywhere? Tamil Tex in windows LaTeX/XeTeX setup Tamil/Indic languages http://latex-my.blogspot.ch/2010/08/tamil-and-hindi-support-in-latex.html


title: Inline row vectors with smallmatrix

text: I typeset inline column vectors with the `smallmatrix` environment from the `amsmath` package:               $\left(\begin{smallmatrix}a\\b\end{smallmatrix}\right)$      Unfortunately, when I do the same with row vectors I am not satisfied with the result since the height of the surrounding braces is the same as that of a column vector with two elements. Any recommendations of how to properly typeset the brackets?


title: Texmaker TexLive 2014 does nothing

text: I am using Texmaker 4.3 (downloaded from their website) and Texlive 2014 (also downloaded) on Ubuntu 12.4 fork ElementaryOS in 64bit. I recently completely reinstalled my OS and compiling a PDF in Texmaker does not work (it did work before the reinstall, but that may have been Texlive 2013 or even 2012, though I am not sure. also it was 32bit). By "not working" I mean that if I click the PDFLaTeX button, my PC works and I see latex output, but there is no pdf created (and if one exists previously, it's not changed). I see no conpile errors. I google a bit, but I was not able to find a solution. My configuration of Texmaker is               latex -interaction=nonstopmode %.tex     pdflatex -synctex=1 -interaction=nonstopmode %.tex      Some more information: Compiling works in Terminal (with pdflatex name.tex). For the current document I don't have a bibliography, but in general I use biblatex with biber.


title: Guidelines for typesetting fractions

text: I realize that this question is to some extent subjective. However, I suspect that there are some common standards regarding how fractions ought to be typeset in mathematics. The guide _Mathematical Writing_ by Knuth, Larrabee, and Roberts states that "One of the most common errors mathematicians make when they get their own typesetting systems is to over-use the form of fractions with the horizontal bar..." (19). Therefore, I feel that it would be useful to gather a list of recommendations on how fractions ought be typeset in various contexts. Here is a (possibly very incomplete) list of such contexts; feel free to add additional items and expand upon existing ones.   * Inline fractions. Should one use `\frac`, `\dfrac`, or something else? How about when one is typesetting an inline derivative like `dy/dx`? What if one wishes to typeset an inline partial derivative like `d^3 f/(dz dy dx)`?   * Fractions in display math. Suppose that one wishes to typeset `1/n` in display math. Should one use `\frac` or `/`? If you think that `/` should be used, at what point is the fraction "large enough" that one should switch to using `\frac`?   * Fractions in subscript and superscript (e.g. exponents).   * Fractions at the top or bottom of series and integral symbols.   * Fractions nested within `\frac`-style fractions.   * Continued fractions.   * Fractions in plots and diagrams. Thanks for your input!


title: Is there some way to add text between the items of an enumerate or itemize environment

text: The title says it all. This does not seem possible with a regular enumerate or itemize enviroment. Do you need to use a special/custom environment for this, or am I missing something? I thought this might be a duplicate, but did a search and did not find anything.


title: How to combine equations and graphical calculus in TikZ?

text: I am writing an article about category theory and a lot of my equations are graphical, like this: ![Graphical calculus and equation](http://i.stack.imgur.com/sFbjk.png) Straight lines (and later, bent lines and circles) represent morphisms in an abelian category. But it does not look good at all, especially the spacing. You can see how the vertical spacing of the two sums is messed up and the placement of the equality signs is done quite arbitrarily by hand, with a mediocre result. The distance of the prefactor `\dim Y` to the line is too big. The placement of the line and node labels is done by TikZ, which looks decent. Is there a good package or preferred method how to do all of this with an automatically good looking result? My code is as follows:               \documentclass{article}          \usepackage{tikz}     \usepackage{mathtools}          \begin{document}         \begin{tikzpicture}[thick, dot/.style={circle,fill,inner sep=1pt}]             %TODO Get vertical spacing of sums right             \draw (0,0) -- node[right] {$X$} (0,3);             \node at (1,1.5) {=};             \newcommand{\inserted}[2]{\draw (#1,0) -- node[right] {$X$} +(0,1) node[dot] {} node[right] {$\iota$} -- node[right] {$#2$} +(0,2) node[dot] {} node[right] {$\iota^*$} -- node[right] {$X$} +(0,3);}             \node at (1.9,1.5) {$\displaystyle\sum_{\iota \in \mathcal{C}(X,\Omega_\mathcal{C})}$};             \inserted{2.8}{\Omega_\mathcal{C}}             \node at (3.8,1.5) {=};             \node at (5.0,1.5) {$\displaystyle\sum_{\mathclap{\substack{Y \in \Lambda_\mathcal{C} \\ \iota \in \mathcal{C}(X,Y)}}} \dim Y$};             \inserted{6.2}{Y}         \end{tikzpicture}     \end{document}


title: Defining scalable "white curly brackets" {| and |} (⦃ and ⦄)

text: **I would like to construct what Unicode calls "white curly brackets" that are in addition scalable.** They look like ⦃ (≈`{|`) and ⦄ (≈`|}`) and have Unicode codepoints U+2983 and U+2984. `unicode-math` has them as `\lBrace` and `\rBrace`, but (1) I don't presently use XeTeX or LuaTeX and (2) their design (shown in `unimath-symbols.pdf` on pages 3-4) is not to my liking: the brace part is too fat for my taste, and I would like the vertical bar to not leave any protrusions. I am trying to have them visually match the parentheses `\llparenthesis`, `\rrparenthesis`, `\llbracket`, and `\rrbracket` from `stmaryrd`. Right now I am using a makeshift definition, which is sufficient for now, but the symbols don't scale (in general or with `\left`/`\right`). Here is sample code:               \documentclass{article}     \usepackage{amsmath}     \usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd} % for comparison with 4 similar parenthesis symbols     \usepackage{accsupp} % for ensuring the right Unicode codepoint upon pasting          \newcommand*{\llbrace}{%       \BeginAccSupp{method=hex,unicode,ActualText=2983}%         \textnormal{\usefont{OMS}{lmr}{m}{n}\char102}%         \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%         \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%       \EndAccSupp{}%     }     \newcommand*{\rrbrace}{%       \BeginAccSupp{method=hex,unicode,ActualText=2984}%         \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%         \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%         \textnormal{\usefont{OMS}{lmr}{m}{n}\char103}%       \EndAccSupp{}%     }               \begin{document}          \noindent     ok:     \(\displaystyle\llbrace abc \rrbrace\)     \(\textstyle\llbrace abc \rrbrace\)     \(\scriptstyle\llbrace abc \rrbrace\)     \(\scriptscriptstyle\llbrace abc \rrbrace\)          \noindent     ok:     \(\displaystyle \llbrace \frac{a}{b} \rrbrace\)     \(\textstyle\llbrace \frac{a}{b} \rrbrace\)     \(\scriptstyle\llbrace \frac{a}{b} \rrbrace\)     \(\scriptscriptstyle\llbrace \frac{a}{b} \rrbrace\)          \noindent     incorrectly scaled (\verb|\scriptsize|): {\scriptsize\(\llbrace abc \rrbrace\)} (large magnification required)          \noindent     incorrectly scaled (\verb|\tiny|): {\tiny\(\llbrace abc \rrbrace\)}          \noindent     \verb|\left| and \verb|\right| not possible before \verb|\llbrace| and \verb|\rrbrace|: \\     \indent \(\llbrace \left\llbracket\left\{\left[(a) \cdot bc^{2^3}\right]^4\right\}^5\right\rrbracket \rrbrace\)     % Note: This is also not possible with \llparenthesis and \rrparenthesis from stmaryrd.          \noindent     for comparison: \(\llparenthesis x \rrparenthesis, \llbracket x \rrbracket, \llbrace x \rrbrace; (x), [x], \{x\}\)          \end{document}      Lines 1 and 2 look just right with the present setup. Lines 3 and 4 demonstrate that my definitions don't scale. Lines 5a/b gives an example of where I would like to be able to use `\left` and `\right`. Line 6 juxtaposes different types of parentheses for visual comparison. **Is there an easy way to scale the glyphs I have constructed myself? Or is designing new glyphs the only way?** While the vertical part of my glyphs doesn't leave any protrusions, the "brace part being too fat" part of my problem isn't being addressed by my code. With this in mind: I recognize that it might not be that easy to make the brace part of the glyph thinner (though if you can, more power to you), but I think that any solution that **addresses the scaling problem for any manually constructed glyph cluster** will be a valuable contribution to the community. * * * For a slightly different setup (original example code) with               \RequirePackage{fix-cm}     \documentclass[12pt]{memoir}     \usepackage{fixltx2e}[2006/09/13]     \usepackage{amsmath}     \usepackage{txfonts}     \usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd}     \usepackage{accsupp}      in the preamble, one needs `\mkern-5.7mu` in the fourth argument to `\mathchoice` for "correct" scaling. To see what goes wrong in that case, it's best to include a line such as `discontinuous small symbols in a footnote\footnote{\\(\scriptscriptstyle\llbrace \frac{a}{b} \rrbrace\\)}`. This might help a potential answerer test things out.


title: Last chapter not appearing in table of contents

text: I am new to LaTeX. I have been creating a document with four chapters. As I am editing the chapters and compiling the code, sometimes Chapter 4 is being left out from the table of contents. To me, it seems that the chapter beginning after a certain page number is being left out and the problem is not specifically with Chapter 4 itself. For example, when Chapter 4 begins from page 12, it shows up in the table of contents as it should but disappears if it begins after page 12. However, I may be wrong. Also, I tried including Chapter 4 before Chapter 3 and everything worked perfectly. Kindly help. Here is the `main.tex` I am using:               \documentclass[11pt]{report}      \usepackage{titlesec}     \titleformat{\chapter}      {\normalfont\fontsize{12}{15}}{\thechapter.}{1em}{}       \titleformat{\section}      {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}      \titleformat{\subsection}      {\normalfont\fontsize{11}{15}\bfseries}{\thesubsection}{1em}{}          \usepackage[a4paper,left=15mm,right=15mm,top=15mm,bottom=20mm, includefoot]{geometry}     \usepackage{helvet}     \usepackage{lipsum}     \usepackage{fancyhdr}     \usepackage{lastpage}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage{cite}     \usepackage{lscape}     \usepackage{indentfirst}     \usepackage{latexsym}     \usepackage{multirow}     \usepackage{hhline}     \usepackage{tabls}     \usepackage{wrapfig}     \usepackage{slashbox}     \usepackage{longtable}     \usepackage{supertabular}     \usepackage{subeqn}     \usepackage{subfigure}     \usepackage{pdflscape}     \usepackage{etoolbox}     \titlespacing*{\chapter}{0pt}{10pt}{10pt}     \fancypagestyle{main}{     \fancyhf{}      \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}       \cfoot{Page \thepage\ of \pageref{LastPage}}     }          \renewcommand{\familydefault}{\sfdefault}     \setlength{\parindent}{.4in}     \setcounter{tocdepth}{0}     \makeatletter     \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}     \makeatother     \patchcmd{\chapter}{plain}{main}{}{}     \pagestyle{main}          \begin{document}          \include{Titlepage}     \setcounter{page}{1}     \renewcommand{\baselinestretch}{1}     \small\normalsize     \tableofcontents     \renewcommand{\baselinestretch}{1}     \small\normalsize     \begingroup     \let\clearpage\relax     \renewcommand{\baselinestretch}{2}     \small\normalsize     \include{Chapter1}     \renewcommand{\baselinestretch}{1}     \small\normalsize     \include{Chapter2}     \include{Chapter3}     \include{Chapter4}     \endgroup     \end{document}      Also, chapter 4 has               \renewcommand{\thechapter}{\textbf{4}}     \chapter{\textbf{ChapterName}}      All text...


title: Add image and line break within a table

text: I want to create a rather mysterious table with both a line brake in a single row and an image. You understand that I cannot use a new row without `\hline` because I want to add an image at the same row. I tried with `\newline` within the cell but it didn't work. The code that I using is               \documentclass{article}     \usepackage{graphicx}     \usepackage{multicols}     \begin{document}     \begin{table}[H]     \centering     \begin{tabular}{|l|l|c|}     \hline     \multicolumn{1}{|c|}{\textbf{\eng{NIM}}} & \multicolumn{1}{c|}{\textbf{Χρήσιμα}} &     \textbf{Εικόνα}\\     \multicolumn{1}{|c|}{\textbf{\eng{Module}}} & \multicolumn{1}{c|}    {\textbf{Χαρακτηριστικά}} & {}\\     \hline     PSU \newline CAEN N1470 & $4$ channels \newline Positive/Ouput Polarity &         \includegraphics[height=\columnheight]{N1470.jpg}\\     \hline     \end{tabular}     \caption{}     \label{tab:}     \end{table}     \end{document}      I've only added one row in the MWE just to make it as simple as possible. Note that `\newline` does nothing actually on that very code and `\columnheight` is not recognised at all. Any ideas on that?


title: How to color the region between two curves with two different colors?

text: In the code below, I'm having two problems:               \documentclass{article}     \usepackage{tikz}      \usetikzlibrary{arrows}     \begin{document}          \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]     \draw[->,color=black] (-0.5,0) -- (5.5,0);     \foreach \x in {2,4}     \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};     \draw[->,color=black] (0,-0.5) -- (0,4.5);     \foreach \y in {1,2}     \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};     \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};     \clip(-0.5,-0.5) rectangle (5.5,4.5);     \draw [domain=0:5.5] plot(\x,{(\x -2)});     \draw[ smooth,samples=100,domain=0:5.5] plot(\x,{sqrt((\x))});     %\draw [fill=gray,fill opacity=0.3] plot [domain=0:2] (\x,{(\x -2)})--plot [smooth,domain=0:4] (\x,{sqrt((\x))}) ;          \end{tikzpicture}     \end{document}        1. Why is the graph near (0,0) not really smooth?   ![enter image description here](http://i.stack.imgur.com/WVKER.png)   2. How to color the region between two curves like the picture below?   ![enter image description here](http://i.stack.imgur.com/LbxYD.png)


title: lyx shortcut for superscript and subscript

text: Instead of using the menu for Insert->Formatting->Superscript or Subscript, I would like to use a keyboard shortcut. I tried Tools->Preferences->Shortcuts, there are already shortcuts for math- superscript and math-subscript, but they put me in math mode, which is not what I want. I tried to add a new shortcut, however, I couldn't find the name of the function. I tried "superscript" and "font-superscript" but got an error "Unknown or invalid LyX function name". How can I find the correct function name?


title: How to vertically center an image in table, using p{} and without using m for tex4ht?

text: Ok, I gave up on this. This is the problem. I'd like to center an image in table columns. There are solutions for this, for example here but this does not work when I use `p` for column specifications. Another solution I know that works is using `m` for all the columns, as shown here but this uses `m` and I need to use `p` because I need to use tex4ht to also generate these tables. I just tried `makecell` package. I can get it to center the image horizontally, (which also works with tex4ht) but do not know how to use this package to center vertically also. Package documentation not clear to me. The problem is tex4ht does not support `m` and it ignores the column width. So have to use `p` but I do not know how center the image using `p` So I am looking for solution to center images in columns, but without using `m` and must be able to use `p`. This is what I tried (MWE)               \documentclass{article}          \usepackage{mwe}     \usepackage{longtable}     \usepackage{hyperref}     \usepackage{array}     \usepackage{makecell} %for makecell     %\usepackage{blindtext}     \newcommand{\mytext}{bla bla bla bla bla bla bla bla bla bla bla bla       bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla       bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla}     \begin{document}          \begin{longtable}{|p{1in}|p{1in}|p{2in}|}\hline     \mytext&\mytext&     \raisebox{-.5\height}{\includegraphics[scale=0.25]{example-image}}      \\\hline     \end{longtable}          \begin{longtable}{|p{1in}|p{1in}|p{2in}|}\hline     \mytext&\mytext&     \makecell[cc]{\includegraphics[scale=0.25]{example-image}}                 %centered ok, but only horizonatlly, how to make it center vertically?     %\makecell[{{m{2in}}}]{\includegraphics[scale=0.25]{example-image}} %not working     \\\hline     \end{longtable}          \begin{longtable}{|m{1in}|m{1in}|m{2in}|}\hline     \mytext&\mytext&     \includegraphics[scale=0.25]{example-image}     \\\hline     \end{longtable}     \end{document}      pdflatex output ![Mathematica graphics](http://i.stack.imgur.com/hjEds.png) So the `m` solution works in pdflatex (but not with tex4ht). The `\raisebox{-.5\height}` works if one does not use `p` but I need to use `p` else table will be too wide. Here is the output from tex4ht (must use p-width option, else tex4ht will ignore `p`)                htlatex foo.tex "htm,p-width"      One can see the `p` worked, but the image is not aligned in center. WIth `makecell` it is aligned ok, but only horizontally, and With `m` the image is aligned, but lost the width specification. (isn't Latex fun?) ![Mathematica graphics](http://i.stack.imgur.com/e0JEr.png)


title: TeX Gyre fonts in XeLaTeX and LuaLaTeX: call by name or file name?

text: Is there any downside of using file names with \setmainfont, except for the fact that it takes more typing? I ask because I am experiencing problems with using names for TeX Gyre fonts on my Linux Mint box: as explained here, XeLaTeX on Linux will not find TeX- installed fonts by name. Hence, I installed the fonts also system-wide (Ubuntu package tex-gyre), but the font names are different from my Windows box: the spaces are gone, so "Tex Gyre Termes" becomes "TeXGyreTermes" etc. This means that using names, the code becomes system-dependent :-( (By the way, should this be considered a bug and reported to the maintainers of the tex-gyre package?) On the other hand, calling the font by file name should work as long as the font file names are the same - can one trusts that? And is there any other potential problem with using file names? Thanks


title: Right alignment of column in table column

text: I have a table defined as follows where the first column is right-justified:               \documentclass{article}     \usepackage[margin=1in]{geometry}     \usepackage{array}     \begin{document}     \begin{table}     \centering     \begin{tabular}{>{\hfill}p{3.50cm}p{5.50cm}p{5.50cm}}     \hline\noalign{\smallskip}     \textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\ [0.5ex]     \hline\noalign{\smallskip}     1 & text & text \\     2 & text & text \\     \hline\noalign{\smallskip}     \end{tabular}     \caption{thisTable.}     \label{tab:thisTable}     \end{table}     \end{document}      However, the column heading of the first column is also right-justified. Can I change the column heading to be left-justified but leave the values contents of the data part of the column right-aligned?


title: tool for checking my scientific writing for common style errors

text: I write frequently scientific reports such as technical reports, research papers, book chapters etc. I use LaTeX for writing these reports. My question is "Is there any tool with latex support, which can check my scientific writing for common style errors?" Please assume that I am comfortable with Windows/unix OS.


title: Error messages with diagonal arrows

text: When I copy and paste the corrected code for example in this question, I get the following error message:               xymatrix 2x2          ! Missing number, treated as zero.          to be read again                              \/          l.101   & C     }      I've been using xymatrix/pic for a while now, and only recently I've been getting weird error messages like these when I try to implement diagonal arrows. What's going on? ADDENDUM: So in a basic latex file, the code in question, and any code like it works just fine. So the problem lies in the particular file I'm working in now. What is possibly different about this file? ADDENDUM II: I isolated the problem. It turned out what made everything go awry was that I had renewed the command "`\char`" in this file. So, original problem solved. However, can anyone tell me what `\char` had to do with in the compilation of the diagram?


title: Wrong rendering in PDF viewer?

text: Consider the following example: **Code**               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{figure}     \centering     \psset{xunit=0.09cm,yunit=1.8cm}     \begin{pspicture}(-5,-0.25)(120,3)     \psaxes[Dx=10,Dy=0.5,comma]{->}(0,0)(-5,-0.25)(105,2.7)[$p$~(\%),0][$u$~(\%),90]     \psplot[algebraic,linewidth=1.25pt,linecolor=red]{0}{100}{2*sqrt(x*(100-x)/1633)}     \end{pspicture}     \end{figure}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/HZq0j.jpg) There are some wierd dents in the graph at the highlighted parts. Is this a problem with my PDF viewer or is it an error in `pstricks-add`? I have tried both Evince and Adobe Reader as viewers but with the same result. P.S. I am using Fedora 18 with the xfce desktop environment. (I am not sure if this is relevant.)


title: Command line *before* \documentclass & relation with output-directory

text: This question has to do with changing the output directory on a file I am trying to compile (using Kile, though I hope the solution isn't editor- specific). If I type               pdflatex -output-directory DIRECTORY file.tex      in a terminal window, then pdflatex is run on "file.tex", and the output (i.e., .pdf/.out/.aux files) appears in the specified directory "DIRECTORY". My question is this: Can I include something in "file.tex" _before_ the appearance of \documentclass so that the following occurs:   * I open "file.tex" using my editor (in this case, Kile).   * I hit the "pdflatex" latex button in my editor, and   * pdflatex is run on "file.tex", and the output is directed to "DIRECTORY" In other words, this question is about how to amend a latex file so that the "terminal functionality" that I am able to achieve persists when using my latex editor. At one point, someone showed me how to do something like this (it involved adding "%%!" or something similar, followed by some terminal commands), but I can't remember it now. Thanks for your help!


title: How to make a fill-in-the-blank presentation

text: I want to make a presentation with LaTeX. My problem is that I want to have on the current slide, at anytime I'd like to positionate (e.g. "The gras __ green"), some text only shown underlined without the text. Then I want to annotate at this underlinded line. After that I want on the next slide I want text and the underlining (e.g. "The gras __is green" with the "is" on the underlining). Is it possible to create a command that makes it automatically possible? Thank you very much in advance for your answer!


title: Reaction arrows with reaction rates with subscripts with mhchem and Sphinx

text: I am using Sphinx 1.1.3 to document a reaction rate with an underscore.               \ce{A + $h$\nu ->[k_A] B}      It works perfectly when I make html documentation, using MathJax and a template file containing the following:               {% extends "!layout.html" %}          {% block extrahead %}       <script type="text/x-mathjax-config">       MathJax.Hub.Config({         TeX: {             extensions: ["mhchem.js"]         }       });     </script>     {% endblock %}      and including the `_templates` folder in the `templates_path` of the `conf.py` file. You can see my mchem_example here. But when I try to build a latexpdf using MiKTeX, with the preamble `\usepackage[version=3]{mhchem}` as stated in the mhchem documentation in the `latex_elements` dictionary of the `conf.py`, I don't get the reaction rate or the arrow. The other examples in the mhchem documentation all work, such as using `+H20` or `\alpha`. I have made it work for both MathJax and MiKTeX by enclosing the `\nu` in curly braces.               \ce{A + $h${\nu} ->[k_A] B}      So now my question is why? Why does the `\nu` have to be in curly braces?


title: Indented paragraph after word on same line

text: I want to do this:               Term        This is the definition of the word. No matter how much is typed                 here it should always line up like this. How do I do this? I am                 not sure since there is another word on the first line.          Next Term   Not to mention, the alignment should be consistent for multiple                 entries as well. The entries may span multiple pages as well.      I am using LuaLaTeX.


title: BibTex error when fields have {'s around them

text: I'm gradually getting used to using BibTeX for citing references in my LaTeX documents, but I've run into a bit of a problem. I'm using natbib so that I get Harvard-style citations, but I get a warning saying that my references cannot be resolved when I try and cite a reference. I've done some investigation of this and found that when my references are in the form below:               @article{Wasson:1983,         Annote = {10.1038/304337a0},         Author = {Wasson, R. J. and Hyde, R.},         Date = {1983/07/28/print},         Date-Added = {2010-10-29 10:34:27 +0100},         Date-Modified = {2010-10-29 10:36:13 +0100},         Day = {28},         Journal = {Nature},         M3 = {10.1038/304337a0},         Number = {5924},         Pages = {337--339},         Title = {Factors determining desert dune type},         Ty = {JOUR},         Url = {http://dx.doi.org/10.1038/304337a0},         Volume = {304},         Year = {1983},         Bdsk-Url-1 = {http://dx.doi.org/10.1038/304337a0}}      It gives an error, but when I change the contents to have quotes around them rather than curly braces it works fine. The problem is that most sources (for example Google Scholar, and all of the output from BibDesk) appear to use braces. Does anyone have any idea what's going on here? Is there a setting I can change somewhere to deal with this?


title: Is there a way to toggle LaTeX within MathType?

text: I understand that in Word, there is a simple way to toggle MathType objects so that they can be displayed and edited as LaTeX. Is there a way to do this _within_ MathType itself (e.g. for workflows that use other word processors, such as Pages)?


I want insert my university logo that is .eps format with xelatex. but that do not show. my TexLive version is 2014. Why do eps images do not show TexLive2014?


title: Natbib: how to replace the last comma in a citation list with "and"?

text: Natbib's `\citet` command currently has the following output when I type `\citet{maddison-cct,ridley-comparative}`:               Maddison [8], Ridley [13]      Is there another command I did not found, or is there a way to redefine it so as to obtain the following instead?               Maddison [8] and Ridley [13]      (and more generally, I'd like `\citet{x1,x2,...,xn}` to output `x1 [1], x2 [2], ..., xn-1 [n-1] and xn [n]`).


title: Problem with \leq displaying as \leqslant

text: I assume it has something to do with my custom macro package, but I'm not really sure. I've just noticed that all of my \leq display as \leqslant the only thing that I could think would effect it is the beginning of my macro.sty:               \ProvidesPackage{macro}     \RequirePackage{amssymb,amsmath,amsthm,fancyhdr,mathabx}     \RequirePackage{graphicx}     \usepackage[top=.75 in,bottom=.75 in, left=.75 in, right= .75 in]{geometry}      But this all seems pretty harmless. I'm on Ubuntu 10.04, coding in emacs, compiling by pdflatex (pdfTeX 3.1415926-1.40.10-2.2) through auctex. I'll be happy to provide any more information, or the rest of my macro document if it would help. My headings are pretty generic:               \documentclass[12pt]{article}     \usepackage{macro}     \author{}     \title{Abstract Algebra Homework 5}\begin{document}


title: pstricks and caa.cls

text: I have a TeX file that my prof gave me and I can't get it to work. First, I don't know what package allows me to use               \documentclass[12pt,reqno]{caa}.      Next, I have a bunch of `pscurves`, `pslines`, and such that give me `!undefined control sequence errors`. I have tried to compile using everything `texmaker.exe` allows me to use; i.e. `pdflatex`, `PS->PDF`, and such. Nothing works. I am using Windows, I have MiKTeX, I have tried MiKTeX package manager, typed keyword: `pstricks` and installed all packages that popped up for it. Not sure what to next. Thanks for any help.


title: Omitting the date from auto insert template and modifying the items to sentence case

text: I am using a template which insert the date automatically. How I can remove the date? Besides, in itemizing it in upper case and put the text in center. I would like to have items in a sentence case and left. the template:               \documentclass[paper=a4, fontsize=11pt]{article} % A4 paper and 11pt font size          \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs     \usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default     \usepackage[english]{babel} % English language/hyphenation     \usepackage{amsmath,amsfonts,amsthm} % Math packages          \usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template          \usepackage{sectsty} % Allows customizing section commands     \allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps          \usepackage{fancyhdr} % Custom headers and footers     \pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers     \fancyhead{} % No page header - if you want one, create it in the same way as the footers below     \fancyfoot[L]{} % Empty left footer     \fancyfoot[C]{} % Empty center footer     \fancyfoot[R]{\thepage} % Page numbering for right footer     \renewcommand{\headrulewidth}{0pt} % Remove header underlines     \renewcommand{\footrulewidth}{0pt} % Remove footer underlines     \setlength{\headheight}{13.6pt} % Customize the height of the header          \numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)     \numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)     \numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)          \setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text          %----------------------------------------------------------------------------------------     %   TITLE SECTION     %----------------------------------------------------------------------------------------          \newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height          \title{      \normalfont \normalsize      \horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule     \huge Spatial Planning in the Netherlands \\ % The assignment title     \horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule     }          \begin{document}          \maketitle % Print the title          %----------------------------------------------------------------------------------------     %   PROBLEM 1     %----------------------------------------------------------------------------------------          \section{What are the criteria that Needham (2007) uses to assess Dutch Planning?}     According to the article, there are two types of criteria for evaluation of Dutch spatial planning:               \subsection{Focusing on overall results and effects of planning. This category is consisted of three fundamental measures:}     \begin{itemize}     \item Accomplishment of goals and objectives of  spatial planning,      \item To which extent cost is utilized,      \item To what extent benefits and advantages of planning process are spread.       \end{itemize}               \end{document}      Itemize part: ![enter image description here](http://i.stack.imgur.com/AANey.png)


title: Need help making sure a given thesis template is in line with my uni's style requirements (margin, spacing, font, etc)

text: I'm still in the process of getting **Sunil Patel** 's **Thesis Template.zip** primed for writing. I've just overcome the unicode trouble and now **need to make sure** the template's _in line_ with my university's **style requirements**   * **Margin** : left 3 cm, on the right 2.5 cm, at the top 2.5 cm, bottom 2.5 cm   * **Spacing** : 1.5   * **Font size** : 12 pt   * **Font** : Times New Roman   * **Footnotes** : single-spaced and font size: 10 pt _**Where exactly_** do I need to make these changes (if changes are necessary at all)? * * * For instance, I **grep** 'ed (the ***.zip** 's contents) for " **margin** " and got the following list: > Chapters/Chapter1.tex > > lstpatch.sty > > Missing Packages/fancyhdr.sty > > Missing Packages/subfigure.sty > > Missing Packages/caption.sty > > Missing Packages/natbib.sty > > Missing Packages/listings.sty > > Missing Packages/vmargin.sty > > Thesis.cls plus some log-files. * * * **PS** : If you happen to know of an **alternative template** which looks similar to Sunil's and which might be (even more) beginner-friendly, plz do let me know.


title: Defining a custom ‘wrapfig’ environment

text: [ This is an updated version of http://stackoverflow.com/questions/3233031/latex-defining-a-custom-wrapfig- environment ] The `wrapfig` package interacts badly with the setup and teardown done by `\begin` and `\end`. Concretely, this is not typeset correctly:               \documentclass{article}     \usepackage{wrapfig}     \newenvironment{pullquote}       {\begin{wrapfigure}{o}{2in}\large}       {\end{wrapfigure}}     \begin{document}     \begin{pullquote}     Chicken chicken     \end{pullquote}     Chicken chicken chicken chicken,     chicken chicken chicken chicken.     Chicken chicken, chicken chicken     chicken chicken chicken chicken     chicken chicken chicken chicken.     \end{document}      The "pull quote" is displaced downward to the end of the document (or to the next wrapfigure, if any) and I get a warning about collisions between wrapping environments in the log file. But this _is_ typeset correctly (note the dirty-trick use of the internal macros defined by `\newenvironment`):               \documentclass{article}     \usepackage{wrapfig}     \newenvironment{pullquote}       {\begin{wrapfigure}{o}{2in}\large}       {\end{wrapfigure}}     \begin{document}     \pullquote     Chicken chicken     \endpullquote     Chicken chicken chicken chicken,     chicken chicken chicken chicken.     Chicken chicken, chicken chicken     chicken chicken chicken chicken     chicken chicken chicken chicken.     \end{document}      I am looking for concrete advice on how to fix this apparent bug in wrapfig, which AFAICT is unmaintained.


title: How to left align footnotes under tabularx in a minipage

text: I am new to LaTeX, trying to create a table using a tabularx in a two column format. I am creating the table in a minipage so that footnotes can appear at the bottom. Everything works out fine, but the footnotes under the table are right aligned, I prefer them left aligned with the table. I browsed through several posts and forums, but couldn't figure out. Any suggestions would help. Regards, Radhika               \documentclass[conference]{IEEEtran}      \usepackage{tabularx,booktabs}     \listfiles     \begin{document}          \makeatletter      \renewcommand\@makefntext[1]{%      \parindent 1em      \noindent     %\hb@xt@1.8em{\hss\@makefnmark}#1}      \hbox{\hss\@makefnmark}#1}     \makeatother          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     \newcolumntype{C}{>{\centering\arraybackslash}X}      \newcolumntype{L}{>{\raggedright\arraybackslash}X}          \begin{table}          X\dotfill X          \begin{minipage}{1\linewidth}     X\dotfill X     \centering     \caption{Questionnaire summary}     \begin{tabularx}{1\linewidth} {l c C C L}      \toprule      \textbf{PID}\footnote{Participant ID}&\textbf{Challenge}\footnote{on a five-point Likert Scale 1-Not at all challenging and 5-Very challenging} &\textbf{Difference}\footnote{difference perceived by the participant as the movement progressed from \textit{source} to \textit{target}} &\textbf{Usefulness of embedded object}\footnote{on a five-point Likert Scale 1-Not at all useful and 5-Very useful} &\textbf{Point toughest to reach}\footnote{brackets indicate the Segment number corresponding to the point} \\     \midrule      PID1&2&Yes&3&6 (Seg 5)\\      PID2&4&No&5&2 (Seg 1)\\      PID3&3&Yes&4&4 (Seg 3)\\      PID4&3&No&4&2 (Seg 1)\\     \bottomrule     \end{tabularx}     \label{questionnaire}     \end{minipage}     \end{table}     \end{document}               *File List*     IEEEtran.cls 2012/11/21 V1.8c by Harald Hanche-Olsen and Anders Christensen     ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.     tabularx.sty 1999/01/07 v2.07 `tabularx' package (DPC)     array.sty 2008/09/09 v2.4c Tabular extension package (FMi)     booktabs.sty 2005/04/14 v1.61803 publication quality tables      Not sure where things are going wrong? ![Table image generated](http://i.stack.imgur.com/ENq9V.jpg)


title: What does list mean in relation to skip? (What is David on about?)

text: In two previous question When is it good practice to use \unskip and What is a token? the default meaning of _token in LaTeX_ and the behaviour of `\unskip` were asked. However in the first question was answered with the following sentence: > _The`\unskip` primitive will remove the last skip from the current list_ What does _list_ mean in this regard?


title: How can I place H_2 on top of a N ? (aspartic and glutammic metal complexes)

text: Please consider the following code               \documentclass{article}      \usepackage{chemfig}      \newcommand*\circleatom[1]{\tikz\node[circle,draw,fill=green!30]{\printatom{#1}};}          \begin{document}     \definesubmol{&}{-[:90,,,,draw=none]}     \definesubmol{8anta}{-[:-80,,,,draw=none]}          \setlewisdist{4pt}     \definesubmol{Gly}{       H_{2}       -[:-90]\lewis{0:,N}       -[:225]H_{2}C        -[:-45]C(=[:-90]O)       -[:13]\lewis{3:1:7:,O}!&\circleatom{Me}}     \definesubmol{Aspartic}{       O=[:-90]C(-[:-25]\lewis{1:5:7:,O}!{8anta}\circleatom{Me})        -[:230]H_{2}C        -[:-90,,2,2]HC(-[:30,,,2]H_{2}N)       -[:-50]C(=[:-90]O)        -[:25]\lewis{1:3:7:,O}}     \definesubmol{Glutammic}{       O=[:-90]C(-[:-25]\lewis{1:5:7:,O}!{8anta}\circleatom{Me})        -[:230]H_{2}C        -[:-90,,2,2]H_{2}C       -[:-90,,2,2]HC(-[:30,,,2]H_{2}N)       -[:-50]C(=[:-90]O)        -[:25]\lewis{1:3:7:,O}}          \schemestart     \chemname{\chemfig{!{Gly}}}{Glycine}     \arrow{0}     \chemname{\chemfig{!{Aspartic}}}{Aspartic  acid}     \arrow{0}     \chemname{\chemfig{!{Glutammic}}}{Glutammic acid}     \schemestop     \end{document}      ![enter image description here](http://i.stack.imgur.com/rkGci.png) In the second and third molecules, I would like to show the electrons on N, but my attempts with the macro \lewis{...} were unsuccessful. Each time I insert \lewis near N, I always get a messed up molecule. I suspect I'm not writing the parentheses in the right place. Also, I would like to write the two hydrogens over the N. I tried with a "phantom" bond (those named "&" in the manual) but I cannot figure out how to shorten only that bond.


title: Figures are not aligning to the center

text: I have used the `float` package and using the following syntax:               \begin{figure}[H]           \centering              \include graphics[scale=0.50]{image .png}          \caption - {\it image}     \end{figure}      But the image is still not center aligned..I tried using text width too..Kindly suggest an answer


title: Why does the changebar package create a page full of "spsp" and how can this be fixed?

text: To place bars into the "Table of Contents" I use the changebar package, version 2005/09/18 v3.5c, and compile the document with pdflatex (TeXLive 2013, updated 2014/02/25) at least four times. (With `latex`, dvi output, the issue does not occur.) This works OK, but it also creates a page full of "spsp" (presumably from small point-lengthes) after the last page of the document (known problem). Using the afterpage and atbegshi packages I can get rid of that page by placing `\afterpage{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}` before `\end{document}`, but that neither tells me what is wrong nor how to correct it. The MWE is a bit longer, because a "critical toc length" is needed for the error to occur. Even a lot of `\cbend\pagebreak\cbstart` in the toc (to prevent the changebars to span a pagebreak) did not solve the problem. Increasing `\cb@maxpoint` neither solved the problem.               \documentclass[12pt]{report}     \usepackage[c5paper]{geometry}     \usepackage[color]{changebar}     \makeatletter     \newcommand{\cbgreen}{%     \write\@auxout{\string\@writefile{toc}{\string\cbend{}}}     \write\@auxout{\string\@writefile{toc}{\string\cbcolor{green}}}     \write\@auxout{\string\@writefile{toc}{\string\cbstart}}}     \newcommand{\cbred}{%     \write\@auxout{\string\@writefile{toc}{\string\cbend{}}}     \write\@auxout{\string\@writefile{toc}{\string\cbcolor{red}}}     \write\@auxout{\string\@writefile{toc}{\string\cbstart}}}     \begin{document}     \tableofcontents     \part{w}     \write\@auxout{\string\@writefile{toc}{\string\cbcolor{red}}}     \write\@auxout{\string\@writefile{toc}{\string\cbstart}}     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \part{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsubsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \subsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \section{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \paragraph{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsection{w}     \subsection{w}     \section{w}     \part{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \subsubsection{w}     \paragraph{w}     \paragraph{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \write\@auxout{\string\@writefile{toc}{\string\newpage}}     \part{w}     \cbgreen     \chapter{w}     \section{w}     \part{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \part{w}     \cbgreen     \chapter{w}     \cbred     \chapter{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \write\@auxout{\string\@writefile{toc}{\string\newpage}}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \part{w}     \cbred     \chapter{w}     \cbgreen     \chapter{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \cbred     \chapter{w}     \section{w}     \section{w}     \cbgreen     \chapter{w}     \section{w}     \write\@auxout{\string\@writefile{toc}{\string\cbend{}}}     \makeatother     \end{document}


title: How can a command take #1 as an argument?

text: I was wondering how some commands manage to take `#1` as an argument when **used** , not when declared. For instance, biblatex's `\DeclareFieldFormat` can be **used** like this:               \DeclareFieldFormat {postnote} {#1}      I have taken a look at `biblatex1.sty` (lines 3480--3506, v2.3, revison 28161) but couldn't figure out how it can do that. Where is the trick? This is what I want to achieve:               \foo {bar} {\textbf{#1}}      I want it to typeset **bar** in bold face; that is, to typeset whatever is given in the first argument in whatever format is given in the second one. ### From `biblatex1.sty`:               %---CUT---     \newrobustcmd*{\DeclareFieldFormat}{%       \@ifstar         {\blx@defformat\blx@defplainformat{ffd}*}         {\blx@defformat\blx@defplainformat{ffd}{}}}     %---CUT---          % {<macro>}{<class>}{<*>}          \def\blx@defformat#1#2#3{%       \@ifnextchar[%]         {\blx@defformat@i{#1}{#2}{#3}}         {\blx@defformat@i{#1}{#2}{#3}[*]}}          % {<macro>}{<class>}{<*>}[<entrytype>]{<name>}          \def\blx@defformat@i#1#2#3[#4]#5{%       \notblank{#3}         {\blx@resetformat{#2}{#5}}         {}%       \def\blx@defformat@a{#2}%       \def\blx@defformat@b{#4}%       \blx@xsanitizeafter{\def\blx@defformat@c}{#5}%       \afterassignment\blx@defformat@ii       #1}     %---CUT---


title: AUCTeX: How to edit enviroment templates

text: With (C-c C-e) AUCTeX allows to insert arbitrary environments. In my case I want to change the default aling-environemnt from               \begin{align}       \label{eq:145}          \end{align}      to insert comments in order to obtain blank lines like               %     \begin{align}       \label{eq:145}       %            %     \end{align}     %      Any suggestions? Greetings, R.


title: centering the a paragraph of text in a paper

text: I need to center the following paragraph inside the paper (at the center of the height of the paper) > DECLARATION > > I hereby declare that the work in this thesis is my own except for > quotations and summaries, which have been duly acknowledged. shall I use the `\vspace*{1\baselineskip}` moreover, I used the `geometry` package. Thank you.


title: Hyperlinked citation aliases for biblatex

text: Some time ago I made the (happy) switch from `natbib` to `biblatex`. However, one of the things that are not working as I expected are citation aliases, which in natbib allowed me to specify the text I wanted to display for specific citations. This would   1. add the item to the bibliography;   2. display the specified alias instead of the item's citation;   3. make the printed alias a link to the corresponding entry in the bibliography.   4. And since this is biblatex, I would like them to also add the appropriate backref if the `backref` option is used. I've tried using the `natbib=true` option when loading `biblatex` (as stated in section 3.7.9 of the documentation), but this does not solve problem **3**. To try my hand at solving **3** I made an attempt exemplified in the following MWE:               \documentclass{article}          \usepackage{pgffor}     \usepackage[backend=biber,style=authoryear,backref=true]{biblatex}     \begin{filecontents}{\jobname.bib}     @article{test,       author = {Author, A.},       year = {2013},       title = {Title},       journal = {Some Journal},     }     \end{filecontents}     \addbibresource{\jobname.bib}     \usepackage{hyperref}          \pgfkeys{       /bibalias/.is family, bibalias,       text/.store in = \bibaliastext,     }     \newcommand{\defcitealias}[2]{%       \pgfkeys{         bibalias,         #1/.style={text={#2}},       }     }     \newcommand{\citealias}[1]{%       \pgfkeys{bibalias, #1}%       \nocite{#1}%     %   \bibhyperref[#1]{\bibaliastext}%     }     \defcitealias{test}{an alias}          \usepackage{filecontents}          \begin{document}          This is a test for \citealias{test}.          \printbibliography          \end{document}      But it seems `\bibhyperref` does not work as I expected, since this stops with an `Undefined control sequence` error, and after reading the documentation more carefully, it seems it is only available during citation style definitions. It also has the problem that `\nocite` does not add backreferences to the bibliography ( **4** ). So, how can use citation aliases in biblatex, hopefully fulfilling all four criteria stated above?


title: Algorithms in front of the text!

text: I am writing a document using the `book` class. At some point, I need to place an algorithm in the text. I am using the `algorithm2e.sty` package to write my algorithms. So, I write               \begin{tabular}{cc}     \begin{minipage}{0.5\linewidth}          \begin{algorithm}[H]     \mbox{\textbf{KeyGen($\lambda$)}}       \\$sk \xleftarrow{\$} (2\mathbb{Z} + 1) \cap [2^{\eta-1},\;       2^{\eta})$\\       \Repeat{$x_{0}$ for ímpar $[x_{0}]_{r}$ for par}{$x_{i}         \xleftarrow{\$} D_{\gamma,\rho}(p)$ em $i = 0,...,\tau$}       $pk = \langle x_{0},x_{1},...,x_{\tau} \rangle$     \end{algorithm}          \end{minipage}     &          \begin{minipage}{0.5\linewidth}          \begin{algorithm}[H]     \mbox{\textbf{Encrypt(pk,m)}}      \\escolher um subconjunto aleatório $S \subseteq \{ 1,2,...,\tau \}$\\      $r \xleftarrow{\$} (-2^{\eta},\; 2^{\eta})$\\      $c \gets [m + 2r + 2\sum_{i\in S}x_i ]_{x_{0}}$     \end{algorithm}          \end{minipage}     \end{tabular}          \begin{tabular}{ccc}     \begin{minipage}{0.33\linewidth}          \begin{algorithm}[H]     \mbox{\textbf{Decrypt(sk,c)}}      \\$m' \gets (c\; mod\; sk)\; mod\; 2$     \end{algorithm}          \end{minipage}     &          \begin{minipage}{0.3\linewidth}     \begin{algorithm}[H]     \mbox{\textbf{Addition($c_{1},c_{2}$)}}      \\$c \gets c_{1} + c_{2}$     \end{algorithm}          \end{minipage}     &     \begin{minipage}{0.2\linewidth}          \begin{algorithm}[H]     \mbox{\textbf{Multiplication($c_{1},c_{2}$)}}      \\$c \gets c_{1} \cdot c_{2}$     \end{algorithm}          \end{minipage}     \end{tabular}      But, when I compile it, the algorithms appear in front of the text! How do I fix this? Best regards!


title: How can I change the font size in math equations?

text: I find that whenever I'm typing some equations into a document, and the equation gets a bit complex (let's say a fraction in a parentheses, squared, inside a square root, inside a fraction), the variables and whatnot that I put inside the "inner" parts of the equation get really, really, tiny. But if I set the font size to something a lot larger, the stuff on the "inside" gets tolerable, but the stuff on the "outside" (e.g., "x = lots of junk", x would be in the "outside") become gigantic! How can I make it more pretty like my textbooks, where all variables are at the same size regardless of whatever parentheses/fractions/radicals they're under?


title: Special characters ř and í in BibTeX

text: How do I type the characters ř and í in BibTeX? Some names of people contain them. I've used Detexifier, and it doesn't help much.


title: What are the Open source WYSIWYG Independent Web Equation Editors available on LaTeX/MathML

text: I am looking for a solution of an Equation Editor to be added to my site. The equation editor should be open source, WYSIWYG (users should be able to type out Equations as if in MS Equation Editor or MathType), convert it to LaTeX, store in my database, retrieve as per the command and render in HTML, should be web based where all files reside on my server, and should facilitate editing in WYSIWYG mode at any stage. I wish to integrate with PHP on a Linux Platform. I would like images also be handled by the editor in EPS format. I have tried many equation editors. These are either requiring knowledge of LaTeX or are online plugins (where the equation is converted to LaTeX on a third party server) or these are windows applications or desktop applications. Can any one suggest how to proceed and which components to use in which order or share his/her knowledge with us or suggest a professional who can help me, may be, on payment basis. Any help would be highly appreciated.


title: -shell-escape for gnuplot: it does not works when I launch pdflatex programatically

text: ## The situation and the issue When I launch `pdflatex` from another program, programatically, it seems that, even with the option `-shell-escape`, I am not able to launch `gnuplot`. I have asked to specialists about my program environment (how should I launch `pdflatex` programatically in a proper way?) and it seems that I have to ask some advice to the `LaTeX` community. This question could also be asked on stackoverflow, but it seems that the solution would come more likely from someone who knows/understands how `gnuplot` is launched by `pdflatex`. ## Question   * Is there a command line option to pdflatex to tell it where to find gnuplot?   * Do you understand what is going on? Is it a problem with `$PATH` or something like that?   * Do you know how can I fix the situation? ## Log from pdflatex Here are parts of the log from `pdflatex`: ![enter image description here](http://i.stack.imgur.com/JJruq.png) ![enter image description here](http://i.stack.imgur.com/Nsapr.png) ## Log from my program My program prints also the following message > sh: gnuplot: command not found ## More details My programing environment is `cocoa` and here is how I launch `pdflatex`:               NSTask * myTask ;          myTask = [[NSTask alloc] init];          NSArray * arguments = @[@"-shell-escape",                             nameLatexFile] ;          [myTask setCurrentDirectoryPath:[URLOfTheFolder path]];     [myTask setLaunchPath:@"/usr/texbin/pdflatex"];     [myTask setArguments:arguments];          [myTask launch];      ## Edit, answer to comments   * `$ gnuplot -V` gives `gnuplot 4.6 patchlevel 5`


title: Long paragraphs follow source indents in TeXShop

text: How do I make long paragraphs follow the source indents in TeXShop? This what I usually get:![alt text](http://i.stack.imgur.com/3uAOl.png) How do I make succeeding lines follow the indent of the first line? This is so that it would be easier to navigate the source.


title: Inconsistent behavior of boxes in amsmath's `gather`.

text: Recently I was working on a package (ytableau) and had a strange experience with the `gather` environment in amsmath. Namely, it screws with `\vtop` and, seemingly, with boxes that I reserve before entering the environment. Consider the following minimal test cases:               \documentclass{article}     \usepackage{amsmath}     \begin{document}      \newbox\mybox      \setbox\mybox=\vtop{\halign{&#\cr a & b \cr c \cr}}      ht = \the\ht\mybox, dp = \the\dp\mybox      \begin{gather}       ht = \the\ht\mybox, dp = \the\dp\mybox       \box\mybox      \end{gather}      \begin{gather}       \setbox\mybox=\vtop{\halign{&#\cr a & b \cr c \cr}}       ht = \the\ht\mybox, dp = \the\dp\mybox       \box\mybox      \end{gather}     \end{document}      The result should be as follows: you will see printed "ht = 6.94444pt, dp = 12.0pt" before the first `gather`, but inside it you will see only `ht = 0.0pt, dp = 0.0pt`. Where did my box go? If you insert the same diagnostic after `gather` you will note that it does not come back. In the second `gather`, you will see "ht = 0.0pt, dp = 21.94444pt" and the `\halign` will print an "a b" over a "c" as desired, but the whole thing will indeed be aligned so that the very top of the first line is at the very bottom of the text line established by the environment (compare with the other text and the label). Where did the height go? (Don't say "into the depth" :). ) This is really annoying because it absolutely violates what I understand `\vtop` to do: put the baseline of the box at the baseline of the top interior box. Printing that same `\halign` outside of `gather` (in a `\vtop`) puts the "a b" in the text, as it should be. This bug does not arise inside `align`. What did happen there (and in `gather`) was that I found that some of my macros were being double-evaluated. Presumably the AMS environments read their contents twice to get the proper typesetting? Unfortunately, I can't conceive of how that would cause the second error (note that the numbers change even if you don't print the box).


title: How do I create pasting diagrams in TikZ?

text: I've been toying with the idea of switching over from Xy-pic to TikZ for all of my diagramming needs, but one feature that's very important to me is the ability to create 2-categorical pasting diagrams (like the ones in Wikipedia's entry on 2-categories), as I can with Xy-pic's "twocell" commands (which, incidentally, I find to be a huge pain to deal with). How do I do these in TikZ? I'd be happy with just a reference to the relevant commands or an arXiv paper with good examples.


title: Umlauts or other special characters in TpX

text: I'm using TpX to create EPS graphics to be displayed in documents or presentations. At the moment, I'm preparing a presentation in German using the `beamer` class and include figures via the `\includegraphics` command, which works fine. There is one problem, however. When I insert a text into my figure using TpX, it will display the umlaut, which is also retained in the corresponding `.tpx` file. But in the presentation, which uses the `epstopdf` package, the umlaut is missing and replaced by a rather ugly box when inserting the figure via `\includegraphics{figure.eps}`. Here's a MWE:               \documentclass[babel]{beamer}     \usepackage[latin1]{inputenc}     \usepackage{epstopdf}     \usepackage{graphicx}     \usetheme{Darmstadt}          ...TITLE INFORMATION...          \begin{document}          \begin{frame}     \begin{center}     \includegraphics{figure.eps}     \end{center}     \end{frame}          \end{document}      When I open the `.eps` file as is, the space where the umlaut is supposed to appear is just empty, without a box around it. Then, in the compiled PDF presentation file, there is the aforementioned box. Umlauts that I enter in the LaTeX file itself are fine and appear as intended. Note that, in TpX, I have also tried to replace the umlaut with its equivalent, such as `\"{a}`. However, this will be rendered as `\"{a}`, not as the corresponding umlaut, so this does not solve the problem? Does anyone know of a possible solution? Thank you.


title: Table with multiple columns

text: I want to create a table in this format, but I haven't managed to get it to work. I dont need to have any colour, i would just like to have it shown as a plain table. ![Table Layout](http://i.stack.imgur.com/yh1fT.png)


title: Tex file with warning "underfull \hbox" produces a weird square sign

text: I have a TeX file to produce PDF, but there are many warnings (underfull or overfull) when I compile the file. For example, below picture shows a warning for underfull `\hbox`. Above is the TeX-code, below is the PDF.![enter image description here](http://i.stack.imgur.com/JE4RC.jpg) You can see there is a square sign (the left of black arrow).   I tried to use `\usepackage{microtype}`, but it did not work.   How I can get rid of this square? I am sorry the file is very long, and use own created package, it is difficult to post here, even a minimum...


title: Easiest way to insert ModernCV based CV into another Latex document

text: I have my CV done using the ModernCV template. I am now working on a research proposal that requires me to insert the CV in the middle of the proposal, but still keep the page numbering and headers consistent with the rest of the proposal. Is there a clever way to do it without rewriting the whole CV?


title: Change automatically generated Text in sources with natbib

text: In my source directory of the thesis I am currently working on, I have got a masters's thesis as one source. As type for this source I chose Master thesis and now Latex always writes "master's thesis" inside my german source directory. Is there a way to change this to "Masterarbeit"?


title: How can I embed equations in web page?

text: > **Possible Duplicate:**   >  Embedding LaTeX equations into a webpage I want to include equations in some of the web pages in my site. I am familiar with TeX syntax, so it would be rather natural to write the mathematical notation using TeX. I guess the equations could be transformed into png pictures and included in the text. Is there an open source software that I could use to generate the pictures? Or some other better way?


title: Specify path to sister directory in a style file

text: I'm about to share my LaTeX document and all its accessory files in such a way that it is self-contained and ready to compile. But I can't figure out how to refer to a sister folder from a `.sty` file. I have the following `.tex` file in the mother directory:               \documentclass{article}     \usepackage{./testfolder/testpackage}     \begin{document}     Test     \end{document}      And a `.sty` file called `testpackage.sty` in a daughter folder:               \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{./testfolder/testpackage}     \usepackage{libertine}     \endinput      So far, so good. But now I need to load another package from `testpackage.sty`, and the package I need to load is located in the sister folder relative to the folder `testpackage.sty` is in. So I try this: `.tex` file in the mother directory:               \documentclass{article}     \usepackage{./testfolder/testpackage}     \begin{document}     Test     \lipsum[1]     \end{document}      `.sty` file in daughter directory 1:               \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{./testfolder/testpackage}     \usepackage{libertine}     \usepackage{../testfolder2/testpackage2}     \endinput      `.sty` file in daughter directory 2 (sister directory of directory 1):               \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{../testfolder2/testpackage2}     \usepackage{lipsum}     \endinput      Trying to compile my `.tex` file results in this error: > LaTeX Error: File `../testfolder2/testpackage2.sty' not found. What am I doing wrong? According to LaTeX/Modular Documents, it should be possible to use `../` to specify sister directories. (I know there are conventions for how to illustrate directory paths, but I couldn't find anything by googling, so I gave that up for this question).


title: Latex, left indent numcases

text: I have this simple equation (representation a dynamic programming recursion):                \begin{numcases}     {Opt\left(P, i, \ell \right)=min }     \nonumber (1)\hspace{0.5 mm} Opt(P,i+1,\ell) + M(\ell,g)\label{eq:1}\hspace*{-10em} & \\     \nonumber (2)\hspace{0.5 mm} \min_{g \in L(v_{i+1})}\{Opt(P,i+1,g) + M(\ell,g)\}\label{eq:2}\hspace*{-5em} & \\     \end{numcases}      I have three questions: 1) How do I remove the equation number automatically added, I tried `\nonumber` but it didn't work. 2) More importantly, how do I control the left indent. Latex automatically centers the equations, but I am using a double column paper template and I would like the equation to be aligned to the left in this case, or at the very least control the left indent. 3) Is it possible in Latex to take any piece of latex code and rescale its output? For example I would like to place this exact equation but make it 90% of its original size.


title: PDF-format causes figure to be moved to end of chapter

text: I have tried the following code with various alterations to the positioning index:               \begin{figure}[!ht]     \includegraphics[width=5cm,trim={0 0cm 0 0cm},clip]{Img/CustomerDevelopment.pdf}     \centering     \caption{The figure shows an example of how a customer changes the policies affiliated with the company and how that changes his segment over his first 3 years.}     \label{fig:CustomerDevelopment}     \end{figure}      However, whatever I do my figure will always go to the end of the chapter and I would like them to stay near the text. If I open the PDF-document in Adobe Reader and save it as a .png that I then import in LaTeX it works perfectly. I would like the PDF-format though seeing as I want to be able to zoom in on the figures. Does anyone know how to solve this so I can use .pdf? I've included an image below using the `\fbox{` command to illustrate the issue. ![enter image description here](http://i.stack.imgur.com/gsskL.png)


title: ConTeXt: Disable Hyphenation, Enable Indentation, and Enable Sorting for Bibliography Entries (Items in List of Publications)

text: ## Enable Indentation * * * I've tried:               \setuplist     [pubs][       before={\indentation},     ]      and also:               \setuppublications[       indentnext={yes},       indenting={yes},     ]      Unfortunately, no effect. I would like both the number and the first line of a bibliography entry to be indented for every entry like this:                   1 ...     ...     ...         2 ...     ...         3 ...     ...      ## Disable Hyphenation * * * Again, doesn't work:               \setuppublications[       before={         \setupalign         [nothyphenated, flushleft]       },     ]      ## Enable Sorting * * * I have a requirement that bibliography entries should be sorted in the order in which they are cited across the document. How to achieve that?               \setuppublications[       sorttype={cite},     ]      has nothing to do with it, but the name of the option is quite misleading then. What does it actually do?


title: Command which replaces a certain character of its argument

text: How to define a command which replaces every certain character in its argument with another certain character? For example, I'd like to define the command `\myreplace{1-2-abc-345}` which gives me the output `1.2.abc.345` by replacing every `-` with `.`.


title: Is it possible to get a coil with stable number of winding?

text: I want to create an animation with a spring. The winding must be kept constant to make more realistic animation. The following MWE illustrates the current situation of `\pszigzag` where it cannot produce a coil with reliable constant winding. I set `7` (a prime number) for the winding but the output oscillates; the output windings are sometimes 6.5 and sometimes 7. The red arrows also show the end corners changing from up to down. Please carefully see the image below and compare among them. ![enter image description here](http://i.stack.imgur.com/UsR6W.png)               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-coil,multido}     \usepackage[nomessages]{fp}          \FPset\CoilArm{0.5}     \FPset\CoilWidth{.5}     \FPset\Windings{7}               \psset{coilarm=\CoilArm,coilwidth=\CoilWidth,linecolor=blue,linewidth=2\pslinewidth}          \def\SetFactorByLength#1{% #1: total length includes the arms         \FPeval\Factor{round((#1-2*CoilArm)/(CoilWidth*Windings):3)}\ignorespaces     }          \begin{document}     \begin{pspicture}[showgrid](15,-11)         \multido{\ix=5+1,\iy=-1+-1}{10}{%         \SetFactorByLength{\ix}         \pszigzag[coilheight=\Factor](0,\iy)(\ix,\iy)}     \end{pspicture}     \end{document}      Is it possible to get a coil with stable number of windings?


title: Stop counting pages and printing footers after X pages

text: I'm making my CV with the `europecv` package and I would like to customize one tiny detail, but I have no idea how. Let's assume my CV is 3 pages. After these 3 pages I have 2 more pages, they are basically attachments that lists all my projects. This makes the CV with 5 pages. The footer on all 5 pages will show `Page X / 5`. What I would like to do is to show `Page X / 3` on the first 3 pages, totally ignoring the footer on the last 2 pages. Is this possible somehow? General document structure:               \begin{document}         \begin{europecv}         % CV pages (content)         \newpage         % Extra pages (attachments)         \end{europecv}     \end{document}


title: How to force emacs with AUCTeX to show compilation in new buffer

text: So I am using AUCTeX with xetex in emacs and each time after I compile the file I get a split window showing the compilation process. I don't want to completely hide this since I find it useful for debugging, but I want it to appear in a different buffer and not bother me when there are no errors. Is this possible? Another option, although less great, would be to automatically hide it except when there are compilation errors. I have the option:               (setq TeX-show-compilation t)


title: Single quotes around math?

text: I am using the syntax package, and I want to define a grammar like:               Rule = Head -> Tail      but when I do this:               \begin{grammar}     <rule> ::=  <head> `$\rightarrow$' <tail>      I get an error saying that Missing $ was inserted. How can I single-quote a math character? Thanks


title: How to adjust the width of a \hdashline inside a pmatrix?

text: I'm using `\hdashline` from the `arydshln` package to draw a horizontal line inside a `pmatrix`: ![](http://i.stack.imgur.com/lx79K.png) How can I reduce the width of this line to prevent it from touching the outer parentheses?


title: Long subfigure references

text: In a certain part of my current document I need to reference a figure that is composed of 18 small pngs. Sometimes I need to reference some subfigures in the same sentence and I end up with text like this: > "see Figures 4.3d, 4.3e, 4.3g, 4.3m, 4.3n, 4.3p, 4.3q, and 4.3r" Is there any way to remove the unnecessary repetition of '4.3' and end up with something like this? > "see Figures 4.3d, e, g, m, n, p, q, and r" or like this? > "see Figures 4.3d-e, g, m-r" I'm aware that both are quite ugly solutions, so I'm willing to accept any better typesetting.


title: Wrap lines of code with curly bracket and add some text next to it

text: I am currently studying algorithmic complexity of some programs, I have to deal with lines and lines of code and it would be really nice and helpful if I could wrap some of those lines in a right (or left) curly bracket and note down the complexity of said lines (math formulas) next to it. I am using the `listings` package because in my opinion it does a fantastic job in showing code but to be honest I am not such a latex expert and that is why so far I have got only nasty errors and nothing done. I hope you can help me sort this out. **Edit** : Here it is what I would like to achieve on paper: ![enter image description here](http://i.stack.imgur.com/2oOhk.jpg)


title: Problem with table using \multirow

text: I'm getting some little problems when using `\multirow`: Here is my code:               \documentclass[a4paper,10pt]{article} % Default font size and paper size     \usepackage{multirow}     \begin{document}     \begin{tabular}{ |l| c| c| } \hline       \textbf{1} & \textbf{2} & \textbf{3} \\ \hline       \multirow{4}{*}{A} & 1 & 1 \\        & 2 & 2 \\        & 3 & 3 \\ \hline        \multirow{4}{*}{B}  & 1 & 1 \\           & 2 & 2 \\           \hline     \end{tabular}      \end{document}      Here is the preview: ![enter image description here](http://i.stack.imgur.com/L1zS5.png) Problems:   1. As you can see, in cell (2,1), the B is not properly positioned in the middle of the cell   2. How is it possible to separate only multirows in Row 1?