title: How can I illustrate decimal to binary conversion?

text: As part of my homework for discrete math I need to convert different decimal values, both positive and negative, to 8-bit binary representations using signed magnitude, 1's complement, and 2's complement. Could anyone suggest an elegant way to present my solutions? An example of handwritten technique is available this ![enter image description here](http://i.stack.imgur.com/eqHXf.jpg)


title: Quotation marks: Is there any difference between \grqq/\glqq and "` / "'?

text: I am currently employed at university to proof-read lecture notes. This means I read quite a lot of text and correct language errors / wrong references to tables / images, but I also try to improve the LaTeX source. I saw that the document makes use of two ways to quote:               \grqq{}My Text\glqq{}      and               "`My Text"'      Both quotes seem to be rendered exactly the same way. I have two questions: **1. What is the difference between those two ways to quote?** **2. What should I use (best practice) to quote?** I currently think that defining a new command like:               \newcommand{\quote}[1]{\glqq{#1}\grqq{}}      might be a good way. So I can grep through the source files and replace every instance of the other quotes. This way, I can be sure that every quote has a "matching quote". But I am not sure if this has any negative effects. (I've added the "quoting" and "csquotes" tags as StackExchange suggested, but I'm not sure if this is appropriate. I've not heard of csquotes before, but I think this might be an answer to the second question.)


title: pdflatex and enumlist counter problems

text: I am trying to use the line that is commented out, but it fails unless I don't use hyperref. The error message is rather cryptic as               ! Missing \endcsname inserted.     <to be read again>       I cannot seam to determine the cause of this.               \documentclass{article}       \usepackage{hyperref}       \usepackage{enumitem, calc}            \newlist{probenum}{enumerate}{1}       \setlist[probenum]{label=\textbf{\arabic*}.}          \def\horizenum#1#2#3{       \flushleft       \dimen0 \linewidth       \divide\dimen0 by #1\relax       \def\item{\hfil\egroup\penalty50 \hfill       \refstepcounter{#2}%       \leavevmode\hbox to \dimen0 \bgroup\space#3\space}%       \leavevmode\bgroup\hskip 0pt plus -1fill }          \def\endhorizenum{\hfil\egroup\endflushleft}          \begin{document}       \newcounter{test}       \setcounter{test}{0}       %\begin{horizenum}{2}{probenumi}{\textbf{\arabic{probenumi}.}}       \begin{horizenum}{2}{test}{\textbf{\arabic{test}.}}         \item Monday         \item Tuesday         \item Wednesday         \item Thursday       \end{horizenum}     \end{document}


title: Can enumerated lists be centred?

text: For enumerated list such as:               \begin{enumerate}     \item One     \item Two     \item Three     \end{enumerate}      the `center` and `centering` commands don't seem to work, and the list sticks to the left hand side of the page. Is it possible to centre such a list, or would I have to use something other than `enumerate`?


title: Date and time macros in Chinese

text: Is there a way to get time and date stamps, or other standard counters, to appear in Chinese? I am using `xeCJK`. Package `babel` (with `\selectlanguage{french}` etc. in context) makes it simple for the major European languages.


title: media9.sty not found

text: I've trying to install `media9` package, but I continue to get the error: `pdflatex> ! LaTeX error: File 'media9.sty' not found` I tried all that was suggested for *.sty file not found, but I just can't even see the media9 package on the package manager (even logged as administrator), nor to obtain any answer when I write in the command window `findtexmf media9.sty` I'm using TeXnicCenter 2.0 and MikTeX 2.9.


title: putting spaces within text block

text: I have a block of text that I would like to automatically break in blocks of equal length. Something like what `\num` does with numbers. What I need is a definition for what I called `\makeBlocks`. The MWE below should output: aaaaa bbbbb ccccc ddddd followed by abc def ghi               \documentclass{article}          \newcommand{\makeBlocks}[1]{???}          \begin{document}     \makeBlocks{5}{aaaaabbbbbcccccddddd}      followed by     \makeBlocks{3}{abcdefghi}     \end{document}


title: Bibliography using Texshop and Mendeley export

text: Latex does not seem generate any bibliography. I use the minimal working example:               \documentclass{article}     \begin{document}     \bibliographystyle{plain}     \citet{Blavatskyy2011}     \bibliography{library}     \end{document}      The error I get is:               Undefined control sequence.      The `library.bib` file is in the same directory as the `.tex file`. I use TexShop on Mac OS X, the `.bib` file is created with Menedeley. The exemplary entry is:               @article{Blavatskyy2011,     author = {Blavatskyy, Pavlo R.},     doi = {10.1287/mnsc.1100.1285},     file = {:Users/Chris/Desktop/Mendeley Desktop/2011\_Blavatskyy\_A Model of Probabilistic Choice Satisfying First-Order Stochastic Dominance\_Management Science.pdf:pdf},     issn = {0025-1909},     journal = {Management Science},     keywords = {2010,2011,accepted october 19,advance january 28,by peter wakker,decision analysis,first-order stochastic dominance,history,online in articles in,probabilistic choice,published,random utility,received march 8,strong utility},     month = mar,     number = {3},     pages = {542--548},     title = {{A Model of Probabilistic Choice Satisfying First-Order Stochastic Dominance}},     url = {http://pubsonline.informs.org/doi/abs/10.1287/mnsc.1100.1285},     volume = {57},     year = {2011}      What could be the problem? The Mendeley export? TexShop? Other?


title: Texmaker and .pdftex file type

text: I am trying to compile a `.pdftex` file type using TeXmaker. There doesn't seem to be too much on `.pdftex` files on the internet and I can't seem to compile it. Does anyone know how to handle `.pdftex` file types and in particular how to handle them using TeXmaker or LyX? I think they were originally created by my co-author using Scientific Workplace. As a disclaimer, I am not a very proficient user of LaTeX, normally I generate my `.tex` files in TeXmaker and then either press F6 (pdfLaTeX) or F2, F4, F8 (Latex, Dvi->Ps, Ps-PDF) to generate my final PDF file.


title: Help with a simple bar plot

text: I have some data in a table; the first column has some names; the second column associates a "category" to each name, and the third column associates a "section" to each name. All entries are alphabetic. Now I want to draw a simple bar plot showing the percentage of total names belonging to each one of the categories. I tried this:               \documentclass{article}     \usepackage{pgfplotstable}     \usepackage{filecontents}     \pgfplotsset{compat=newest}          \begin{filecontents*}{test.txt}     {Name A}    {Category One}      {Section One}     {Name B}    {Category Two}      {Section Two}     {Name C}    {Category One}      {Section Two}     {Name D}    {Category Two}      {Section Three}     {Name E}    {Category One}      {Section One}     {Name F}    {Category Three}        {Section Three}     \end{filecontents*}          \pgfplotstableread[header=false]{test.txt}\mydata          \begin{document}          \begin{tikzpicture}     \begin{axis}[     ybar,     width=16cm, height=10.5cm,     ]     \addplot table[x expr=\coordindex1,y expr=\coordindex2]{\mydata};     \end{axis}     \end{tikzpicture}          \end{document}      But this gives me: ![enter image description here](http://i.stack.imgur.com/BwgUh.png) So clearly I am misusing the specifications for the plot. What should I do to get the desired plot?


title: How to create custom section titles with a “<title> <number>” format in LaTeX?

text: I have the same problem like here: How to create custom section titles with a "<title> <number>" format in ConTeXt? But I would like to solve it in LaTeX. Is there a simple way to adapt code from the @phg's answer?


title: Write a package that is aware of the mainlanguage selected in babel or polyglossia

text: How can I make my package aware of the language choosen with `babel` or `polyglossia`, so that some auto-generated strings can be generated in respect to the current language? As an example, I have a macro `\my@string` that shall expand to “Caption” in english text, “Überschrift” in german text, or “titre” in french ones.


title: Errors using chemstyle in LaTeX

text: I am a total novice with no TeX or programming experience, trying to learn how to use LaTeX in general, but specifically attempting to use the 'chemstyle' package, so as to allow for automated numbering of my chemical compounds when drawn in ChemDraw and saved as '.eps' files containing temporary labels of 'TMP'. I am currently using MikTeX and TexStudio (also have TeXworks) and have attempted both manually installing the chemstyle package from CTAN and directly from the MikTeX repository with no apparent difference between the two. I have been using the tutorial here and typing the lines below in my preamble:               \usepackage[crop=off,runs=2]{auto-pst-pdf}     \usepackage{chemstyle}      I can't remember where I got it from but the inclusion of "crop=off" eliminates an intial error of:               pdfcrop: The Perl interpreter could not be found.     Process exited with error(s)      I have also attempted to enable shell escape in the command line, I think successfully, as I've read in a few places that it's necessary with this package. Unfortunately whether I use my own file or the example ones given in the tutorial, the file never compiles successfully and I get a lot of error messages concerning 'caption3.sty' such as:               Command \caption@ifinlist already defined. \@expandtwoargs\caption@@ifinlist}      as well as a warning about 'typearea.sty'. Below is a basic version of my document:               \documentclass[oneside,14pt,parskip=full]{scrbook}          \usepackage{graphicx}     \usepackage[left=2in,right=1.3in,top=1.3in,bottom=1.3in]{geometry}          \usepackage[crop=off,runs=2]{auto-pst-pdf}     \usepackage{chemstyle}          \usepackage{libertine}          \addtokomafont{chapter}{\Huge\scshape}     \addtokomafont{section}{\mdseries\LARGE\it}     \addtokomafont{subsection}{\fontsize{20}{24}\selectfont\bfseries}     \addtokomafont{subsubsection}{\fontsize{17}{20}\selectfont\mdseries\scshape}          \usepackage{fancyhdr}          \fancypagestyle{main}{ %     \fancyhf{}     \fancyhead[L]{\rightmark}     \fancyhead[R]{\leftmark}     \fancyfoot[C]{}     \fancyfoot[R]{\thepage}     \renewcommand{\headrulewidth}{0.4pt}}          \newcommand{\markedsection}[2]{\section[#2]{#2%     \sectionmark{#1}}     \sectionmark{#1}}     \newcommand{\markedchapter}[2]{\chapter[#2]{#2%     \chaptermark{#1}}     \chaptermark{#1}}          \fancypagestyle{plain}{%     \fancyhf{}     \fancyfoot[R]{\thepage}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}}          \usepackage[nottoc]{tocbibind}          \newcommand*{\TitleFont}{\scshape           \fontsize{35}{20}           \selectfont}          \title{\TitleFont Thesis}     \author{A Name}     \date{\today}     \publishers{Dept.\\Uni.}          \begin{document}          \frontmatter          \pagestyle{plain}     \maketitle     \tableofcontents     \listoffigures     \listoftables          \chapter{Acknowledgements}          Some thanks.          \chapter{Abstract}          An abstract.          \chapter{Glossary}          This is the glossary...          \mainmatter     \pagestyle{main}          \markedchapter{Intro}{Introduction}     \label{ch:intro}          Here is the introduction.          \markedsection{Sec1}{First Section}     \label{sc:sc1}          \subsection{First Subsection}     \label{subsc:subsc1}          \subsubsection{First Subsubsection}     \label{subsub:subsub1}          \backmatter          \chapter{Appendices}          \end{document}      Thank you in advance for any help you can give and apologies if I've left out any necessary information. Edit: The output message following an attempt to compile is as below.               Process started: "C:\Program Files\MiKTeX 2.9\miktex\bin\pdflatex.exe" -synctex=1 -interaction=nonstopmode "chemstyle".tex          This is dvips(k) 5.992 Copyright 2012 Radical Eye Software (www.radicaleye.com) ' TeX output 2013.11.12:1417' -> chemstyle-autopp.ps <C:/Program Files/MiKTeX 2.9/dvips/base/tex.pro> <C:/Program Files/MiKTeX 2.9/dvips/misc/alt-rule.pro> <C:/Program Files/MiKTeX 2.9/dvips/psfrag/psfrag.pro> <C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/libertine/lbtn_c7kyj5.enc> <C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/libertine/lbtn_s5bq4i.enc> <C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/libertine/lbtn_c6xmqr.enc> <C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/libertine/lbtn_xogrpz.enc> <C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/libertine/lbtn_p657rp.enc> <C:/Program Files/MiKTeX 2.9/dvips/base/texps.pro> <C:/Program Files/MiKTeX 2.9/dvips/base/special.pro> <C:/Program Files/MiKTeX 2.9/dvips/base/color.pro>.          <C:/Program Files/MiKTeX 2.9/fonts/type1/public/libertine/LinBiolinumT.pfb> <C:/Program Files/MiKTeX 2.9/fonts/type1/public/libertine/LinBiolinumTB.pfb> <C:/Program Files/MiKTeX 2.9/fonts/type1/public/libertine/LinLibertineTI.pfb> <C:/Program Files/MiKTeX 2.9/fonts/type1/public/libertine/LinLibertineT.pfb> <C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr12.pfb>[1] [1] [2] [3] [4] [5] [6] [7] [1] [2]          Process exited with error(s)


title: Roman page numbers in appendix in Lyx

text: I use LyX 2.0.5.1 I have a report with several chapters and 2 appendices. I have roman page numbering before chapter 1 (for table of contents, table of figures, etc) and I have arabic page numbering from chapter 1 until the end. However, I would like my 2 appendices to switch to roman page numbering, starting from i (1 in arabic numbering). This is the code that was generated by LyX for the 1st appendix:               \begin_layout Standard     \begin_inset Newpage newpage     \end_inset     \end_layout          \begin_layout Chapter     \start_of_appendix     Content of the Appendix 1.     \end_layout      I have tried to add the \pagenumbering{roman} in several places near the start of the appendix chapter but it does not work. Thank you very much.


title: Where do the local arara rules live under windows?

text: I know they go under `~/.arara` under unix platforms, but I tried having them under `%USERPROFILE%\\.arara`, and they are not getting picked up.


title: Is there a way to format the equation like this?

text: My friend is taking pre-calculus class, and I would like to create some notes for him. Is there a way I can do the following in latex? Right now I only have the very basic down. I want to make it look nicer and more personal. (The color can stay black, but I used a red pen to show what I wanted to do. Thank you all in advance.) ![enter image description here](http://i.stack.imgur.com/4TW6S.jpg)               $ax^2 \ + \ bx \ + \ c \ \ \ \ (where \ a \neq 1)$\\     $k_1 \ + \ k_2 \ = \ b \ \ \ \ and \ \ \ \ (k_1)(k_2) \ = \ ac$ \\ \\      $ax^2 \ + \ bx \ + \ c \ \ \ \ (where \ a \ = \  1)$\\     $k_1 \ + \ k_2 \ = \ a \ \ \ \ and \ \ \ \ (k_1)(k_2) \ = \ b$


title: How to get dots in between equation and equation numbers with equation is centrally aligned?

text: Add dots between equation and equation numbers without changing the equation's default center position?


title: microtype has issues with mathdesign \mathsf font

text: I am using               \documentclass{amsart}     \usepackage{microtype}     \usepackage[bitstream-charter,cal=cmcal]{mathdesign}      Sometimes ` \mathsf{...} ` produces                pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.      Appears when the `\mathsf` is typeset in the end of a line and only with certain characters (e.g. P,..). So, which fonts does mathdesign use for `\mathsf`? Should I replace it with other font? Suggestions? Solutions? minimal 'working' example:               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{microtype}     \usepackage[bitstream-charter]{mathdesign}          \begin{document}         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sdf$\mathsf P$ elementum, elit in varius viverra, mauris augue cursus purus, vel ullamcorper nisi orci pretium nunc.     \end{document}      This example is minimal, i.e. dropping `\usepackage[T1]{fontenc}` avoids the error.


title: How do I write a script (in Windows) that removes all the temporary LaTeX files in Vim?

text: Maybe my title is not so clear; I Googled a lot about cleaning up temporary files after a PDF is generated, and find it is not recommand to remove it completely in each compile. I do want to remove it in the final with one-or-two key press in Vim. So my question is: _Can we add some code to`_vimrc` such that I can define which kind of file shall be removed after the compile? (I mean success compile, auto-remove, at least when I ask to remove it by press key short.)_ I hope it will work both on Windows and Unix systems. (Maybe needing different **code**.)


title: Best way to add hanging indent to (almost) every paragraph

text: I want to have a hanging indent on every paragraph, but not on the section headers. I can achieve this with `titlesec` and `\leftskip`, but this solution feels dirty/hackish, and I'm sure there must be a better way. MWE:               \documentclass[12pt]{article}     \usepackage{parskip}     \usepackage{titlesec}     \titleformat{\section}[runin]{\bfseries\normalsize}{}{0pt}{\hspace*{-2em}\thesection }[\\]     \titleformat{\subsection}[runin]{\normalsize}{}{0pt}{}[:\\]     \leftskip=2em          \begin{document}     \section{Section Headings Not Indented}     Every line of this section should be indented the exact same amount. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean adipiscing lacus ut nibh laoreet malesuada. Nulla vehicula mauris eu imperdiet varius. Etiam pellentesque eros a urna pulvinar, nec condimentum lectus gravida. Suspendisse vehicula, mauris id fermentum iaculis, massa neque convallis neque, in vestibulum quam felis in enim.          Sed dapibus, nisl vitae consectetur sodales, augue sem laoreet urna, ut eleifend velit augue vel leo. Nulla facilisi. Suspendisse potenti. Phasellus scelerisque porta risus ut luctus. Ut lobortis magna purus, at rhoncus quam interdum quis. Sed vestibulum, leo non rhoncus sollicitudin, erat enim dignissim dolor, quis commodo nunc elit at arcu.          \subsection{also indented same as a paragraph}     Phasellus vitae ultricies augue. Vivamus non ipsum odio. Etiam id lectus non sapien hendrerit consectetur. Suspendisse porta magna at metus dignissim pharetra. Nulla bibendum mauris sit amet feugiat interdum. Nulla porta sollicitudin lorem eget pharetra. Etiam dictum, dolor vitae vulputate ultricies, quam nibh consectetur leo, nec ultricies felis tortor eget leo. In pulvinar felis nec diam fringilla rhoncus a at lacus.           \end{document}      I came across the `hanging` package and the `hangparas` environment, but that does not seem to work across multiple sections. I also considered simply adding a `\hangindent` and `\hangafter=0` to every paragraph, but that would be tedious and I would prefer a more global solution. If possible, I would also like to be able to undo these settings for a given section(s) (My appendices, specifically. Currently, I do this by preceding them with `\leftskip=0`). However, if that is impossible (or requires substantial additional effort), it's not a deal-breaker.


title: Help me fix this code

text: I wanted to try to learn how to define a lot of macros at one go. After I asked this on the chat room, I received some code from the awesome egreg to play with. Here is a link to working code. There after, I tried to generalise so that, the function `\definefoo` can define macros whose length could be arbitrary in the sense that, there is a uniform way to define `\ab`, `\abg`, `\abgd` and so on... I modified it after more discussions there. I hope the following non-working code also serves as a pseudocode for what I am trying to achieve:               \documentclass{amsart}     \usepackage{amsmath}     \makeatletter     \def\definefoo#1#2#3#4{%       \ifx\relax#4%          \ifx\relax#3%             \ifx\relax#2%                \expandafter\def\csname#1#1\endcsname##1{%                \csname greek#1\endcsname_{##1}}             \fi             \expandafter\def\csname#1#2\endscname##1##2{%             \csname greek#1\endcsname_{##1}%             \csname greek#2\endcsname_{##2}}          \fi           \expandafter\def\csname#1#2#3\endscname##1##2##3{%           \csname greek#1\endcsname_{##1}%           \csname greek#2\endcsname_{##2}%           \csname greek#3\endcsname_{##3}}       \fi       \expandafter\def\csname#1#2#3#4\endscname##1##2##3##4{%       \csname greek#1\endcsname_{##1}%       \csname greek#2\endcsname_{##2}%       \csname greek#3\endcsname_{##3}%       \csname greek#4\endscname_{##4}}     }          \let\greeka\alpha     \let\greekb\beta     \let\greekg\gamma     \let\greekd\delta     \let\greekl\lambda     \let\greekm\mu          \definefoo a\relax\relax\relax     \definefoo ag\relax\relax\relax     \definefoo abg\relax     \definefoo abd\relax     \makeatother     \begin{document}     $\abd{ij}{kl}{mn} \aa{ij}{kl} \aa{kl}$      \end{document}


title: Pgfplots - ugly marks when using dotted or dashed line

text: Recently I spotted that applying the option **dashed** or **dotted** to a plot results in having ugly / distorted marks or marks with dots (when applying dotted) around them. Here is a MWE:               \documentclass{minimal}     \usepackage{tikz,pgfplots}     \begin{document}     %     \begin{tikzpicture}     \begin{axis}     \addplot [mark=*,mark options={scale=2}] coordinates {     (0,2) (1,2)     };     \addplot [dashed,mark=*,mark options={scale=2}] coordinates {     (0,1.5) (1,1.5)     };     \addplot [dashed,mark=square*,mark options={scale=2}] coordinates {     (0,1) (0.5,1.2) (1,1)     };     \addplot [dotted,mark=*,mark options={scale=2}] coordinates {     (0,0.5) (1,0.5)     };     \addplot [dotted,mark=square*,mark options={scale=2}] coordinates {     (0,0) (1,0)     };     \addlegendentry{a}     \addlegendentry{b}     \addlegendentry{c}     \addlegendentry{d}     \addlegendentry{e}     \end{axis}     \end{tikzpicture}     %     \end{document}      Which will result in this: ![Zoomed in at 400%](http://i.stack.imgur.com/Bx6Uy.png) Depending on the pdf-viewer this 'ugliness' can be seen with pretty low zooming level (the internal TeXworks viewer makes it especially worse). Any discussion would be welcome! Greetings PS: don't mind the third mark in the middle row - tried out something and forgot to undo the change :) * * * * * * since I somehow screwed the sign up process up, this question I've asked is no longer my question, so I can't comment on it.. (maybe an admin could put it into my account? just for the sake of reputation, yeeey!) Anyhow, about the 'duplicate' thing percusse wrote - yes, you're right that it leads to the same solution but I've searched stackexchange and google for this issue and couldn't find anything useful. So one should consider changing the title of the other question to something like "ugly/bad looking marks" (or add some keywords) since for finding that answer one has already to know what causes the problem, i.e. the marks not being solid. Since I had no clue where this problem comes from I used the above mentioned (key-)words :) And thanks a lot y'all for answering it THAT quickly!


title: Knuth's line breaking algorithm

text: I'm trying to understand the basics of Knuth's line breaking algorithm. At the beginning of **Chapter 12: Glue** of his TeXbook, there is a figure like the one below. My question is: where did those Stretchs and Shrinks come from? ![Figure in Chapter 12 of the TeXbook](http://i.stack.imgur.com/TkD68.png)


title: Adjust spacing in table of content

text: I am very new to TeX. I have a Latex template for writing a thesis. I'm trying to report only the part of the template that I think are important.. please tell me if I'm omitting something! I am including chapters and automatically create the table of content in this way:               \frontmatter          \tableofcontents        % Indice          \input{cap1}     \input{cap2}     \input{cap3}     \input{cap4}      now, in `cap1.tex` I have added 2 preface chapter in this way:               \chapter{Preface}         \begin{flushright}\begin{small}         \end{small}\end{flushright}             Lorem ipsum ...          \chapter{Organization of this book}         \begin{flushright}\begin{small}         \end{small}\end{flushright}             Lorem ipsum ...          \clearpage{\pagestyle{empty}\cleardoublepage}          \mainmatter          \chapter{Introduction}     \begin{flushright}\begin{small}         \end{small}\end{flushright}             \section {Definition of the problem}                 Lorem ipsum ...      And this show exactly what I want to do but.. in the table of content I have a space between _Preface_ and _Organization of this book_ that I don't want. It is the normal space between the chapters but I want this first 2 preface chapter to be without space in the ToC. I have tried to change `\chapter` with `\section` but the 2 preface are indented. So.. how to remove the space between the 2 preface chapter?


title: Package: songs strange opening quotation marks

text: I'm typesetting a songbook, and I have to cite a title of the original melody just under the current title.               \documentclass[a4paper,12pt]{mwart}     \usepackage[lyric]{songs}     \setlength{\oddsidemargin}{0in}     \setlength{\evensidemargin}{0in}     \setlength{\textwidth}{6.5in}     \setlength{\topmargin}{0in}     \setlength{\topskip}{0in}     \setlength{\headheight}{0in}     \setlength{\headsep}{0in}     \setlength{\textheight}{9.1in}     \settowidth{\versenumwidth}{1.\ }     \pagestyle{empty}     \usepackage[utf8]{inputenc}     \usepackage{polski}     \linespread{1.05}     \usepackage[T1]{fontenc}     \usepackage[condensed,math]{kurier}          \newindex{titleidx}{titleidx}     \noversenumbers     \begin{document}     \begin{songs}{titleidx}     \beginsong{Pieśń o~tym przypomni}[by={Andrzej Depo, 1960 r.},                                       sr={Na melodię pieśni harcerskiej %                                           ,,Płonie ognisko i~szumią knieje''}]     \beginverse     Wiatr Wołynia niesie pozdrowienia,     z~wszystkich lasów, pól i~łąk,     pieśń nadziei nad Bugiem rozbrzmiewa,     myśli łączy w~jeden krąg.     \endverse      However the polish quotation marks ,, are replaced with two comas. ![strange comas](http://i.stack.imgur.com/ODn7G.png) I don't need any notes or melody hints in this songbook so maybe it is better to use verse environment and format the rest by hand?


title: How to override a subclass of book to get TOC on even page?

text: I am trying to get my table of contents on a verso page (i.e., an even- numbered one). I have seen several threads on similar topics here, and many of them recommend making your own command more or less like this:               \makeatletter     \def\clearevenpage{\clearpage\if@twoside \ifodd\c@page         \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}     \makeatother      This doesn't work for my document. I have also tried the solution based on the changepage and ifthen packages posted in this thread. If I just put `\null\clearpage` or `\hbox{}\newpage` before the `\tableofcontents` command, I just clears to a recto (odd-numbered) page instead so that I just get an extra blank page. I am using this subclass of the book class. I don't see anything in the cls file that obviously would cause this behavior, but I'm not that good at reading Latex code, so I'm probably missing something. Or is it the book class itself?


title: Bibliography list items alignement using Natbib alpha style

text: I am using the alpha style with `natbib` (author-year). My problem is that I am getting the labels aligned right in the Bibliography list items, but I want them left !! It may be useful to mention that I am using `bibtopic`! ![enter image description here](http://i.stack.imgur.com/8JZ39.png)


title: Titlesec: remove space after empty margin section

text: I'm using `titlesec` to assign some custom formatting to my sections. In particular I want to use margin `\section`'s, so that the title section is typeset on the left margin, and the text of that section starts at the same height as the tile. But I'm having a little problem with the spacing: when a `\section` is immediately followed by a `\subsection`, an unwanted vertical space is added and the title of the subsection does not align anymore with the title of the section (see code and picture bellow). How could I fix this?               \documentclass{article}     \usepackage{lipsum}     \usepackage{titlesec}     \titleformat{\section}[leftmargin]{\raggedright\scshape}{}{0pt}{}     \titlespacing*{\section}{2.5cm}{*2.5}{0.5cm}     \titleformat{\subsection}{\bfseries}{}{0pt}{}     \titlespacing*{\subsection}{0pt}{*2}{*1}     \begin{document}     \section{First}     \lipsum[1]     \section{Second}     \subsection{This is not nice}     \lipsum[1]     \subsection{This is fine}     \lipsum[1]     \end{document}      ![titlesec spacing bug](http://i.stack.imgur.com/QKqzO.png) **Update:** As I really need an answer to this (I'm using it in some document that I should deliver soon), I'll offer a bounty to anybody who can bring me an answer. For whoever decides to tackle this issue, I've navigated a bit into the source from titlesec and found some hackish way to get the desired result. It involves suppressing some `\leavevmode`, delaying an assignment to some spacing parameter _after_ the subsection is typeset, and making titlesec to typeset the problematic `\subsection` header directly into the document and not in a “box” for positioning. This regrettably, also causes problems with the indentation of the following paragraph. I would _love_ to see a solution simpler than this. Conceptually what I want to do is very simple: after the `\section` somehow tell titlesec to suppress any vertical spacing that would be inserted before the next `\subsection`. So I still hope that some simple solution exists but I'm missing it because I have not much experience on spacing, vertical/horizontal modes and how paragraphs are typeset. Even if the solution _has_ to be more complicated, the ideal would work well together with titlesec and do not break any of its other options. However, in the end I would also settle for a lesser solution which patches the definition of `\subsection` and makes it work at least in my example and my intended configuration given above.


title: Align unrelated arrays

text: How can I align arrays like the ones below so that they start at the same distance from the left edge of the paper?               \documentclass[a4paper,11pt]{article}     \usepackage[utf8]{inputenc}          \begin{document}            \begin{itemize}         \item Lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit l           \[\begin{array}{l}               a + b = c \\               a + c = b \\               a + b = c           \end{array}\]         \item Lorem ipsum dolor sit lorem ipsum dolor sit lorem \[ a + b + c + d + e + f = g \]         \item Lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit lorem ipsum dolor sit l           \[\begin{array}{l}               a = x \\               a + b = y \\               a + b + c = z           \end{array}\]       \end{itemize}          \end{document}      ![](http://i.stack.imgur.com/FQMnk.png)


title: How to typeset an exhibition catalogue

text: Perhaps this is too vague, but I have been so impressed with the results I was able to achieve based on a previous question, that I thought I would ask. Has anyone used TeX to typeset an exhibition catalogue? I'm looking for some base classes to build a nice layout that can alternate pages with large images and small textual captions, with pages of text with small or no images. This is an old-style example from 1955. Very classic and typography heavy, with separate image plates. http://www.aucklandartgallery.com/media/166104/cat4.pdf This is a more modern style and a nice compact design: http://www.aucklandartgallery.com/media/335251/cat69.pdf Any suggestions or guidance toward a good approach would greatly appreciated.


title: CircuiTikZ — create new component

text: How can I create a new component and include it in CircuiTikZ? For example a 4 bit adder?


title: Collision between mhchem and mathdesign

text: Maybe related to a package database update to last versions, I have a collision between the `mchem` package and other font-related packages such as `mathdesign`. Whenever I try to use the command `\ce{}` to insert chemical equations, the following error appears:               ! Missing control sequence inserted.     <inserted text>     \inaccessible     l.10 \begin{equation} \ce{2Al+3/2O2->Al2O3}     \end{equation}     Please don't say `\def cs{...}', say `\def\cs{...}'.     I've inserted an inaccessible control sequence so that your     definition will be completed without mixing me up too badly.     You can recover graciously from this error, if you're     careful; see exercise 27.2 in The TeXbook.      The minimun **not** -working example is the following:               \documentclass[a4paper,11pt]{article}     \usepackage[utopia]{mathdesign}     \usepackage[version=3]{mhchem}          \begin{document}          The following line causes pdfLaTeX to fail:     \begin{equation} \ce{2Al+3/2O2->Al2O3}  \end{equation}          \end{document}      I have tried the following:   * Searching mhchem.sty to find `\def cs{`: it's not there.   * Reading exercise 27.2 of _The Texbook_ : it just says to **not** omit the backlash and ends telling that you "Explain how to recover from this error..." (it's one of those marked with a curvy road sign, _for wizards only_ ").   * Changing the order of package loading.   * Uninstalling and reinstalling `mhchem`. To no avail. Does anyone know about this problem? Is a bug of the `mhchem` package? and last but not least, can any of you advanced wizards point me in the direction to solve this problem? Many thanks for reading so far =) **EDIT:** I got in touch with Martin Hensel and looks like the problem is indeed in `mhchem`, he told me that some people reported similar problems and sent me an updated version of the package that did work. I suppose that he will update the repositories soon. =) PS: Should a mod close this question?


title: \hyperlink doesn't jump in articlemode

text: \documentclass[hyperref]{extarticle}     \usepackage{beamerarticle}     \begin{document}     \begin{frame}[label=target-frame]{Test on hyperlink}     Just for test     \end{frame}     \begin{frame}     \hyperlink{target-frame}{Go to target frame}     \end{frame}     \end{document}      This code seems not have a hyperlink of the text: Go to the target frame, which in my expectation should be link to the target-frame. Did there any way to solve this?


title: How to draw this 3D picture ?

text: ![quad ](http://i.stack.imgur.com/MfJNU.png) i am working first time in latex, i don't know how to draw 3D diagram in latex. please some one help me how to draw this picture.


title: How to adjust row height in table?

text: I am generating Russian table and row height issue. Below is part of my code (MWE).               \documentclass[11pt,table,a5paper]{article}     \usepackage{graphicx}     \usepackage[framemethod=TikZ]{mdframed}     \usepackage[top=2cm, bottom=2cm, outer=2.1cm, inner=1cm,twoside, headsep=26pt]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{longtable}     \usepackage[english,russian]{babel}     \usepackage{multirow}     \definecolor{textcol}{rgb}{0,.412,.651}     \definecolor{rowcol}{rgb}{.04, .55, .87}     \begin{document}     \newcolumntype{M}[1]{>{\centering\arraybackslash}p{#1}}       {\renewcommand{\arraystretch}{1.8}\begin{longtable} {|p{3.35cm}|M{1.3cm}|M{1.87cm}|}      \hline      \rowcolor{textcol} \textbf{\textcolor{white} {данные}}&\textbf{\textcolor{white}{данные}}&\textbf{ \textcolor{white} {Страница}} \\      \endfirsthead      \rowcolor{textcol} \textbf{\textcolor{white} {данные}}&\textbf{\textcolor{white}{данные}}&\textbf{ \textcolor{white} {Страница}} \\      \endhead      \hline      \rowcolor{rowcol}      \parbox[t][1.058cm]{3.4cm}{\raggedright развитие постоянных зубов} & N/A&19\\      \hline      \rowcolor{rowcol}      \parbox[t][1.058cm]{3.4cm}{\raggedright ожирение (в раннем детстве)} & N/A&24\\      \hline      \end{longtable}}      \end{document}linecolor=goldenpoppy      ![enter image description here](http://i.stack.imgur.com/D51Mf.png) In the outout, row1 of table has more height than row2 while both are using same parameter 1.058cm. How can i fix this issue.


title: How to globally number pages automatically in LaTeX?

text: I am new to LaTeX so definitely naïve in this topic. How do I number each pages automatically in LaTeX. The current page numbering is carried out on a chapter basis. It would restart the counter in next chapter and begin numbering again. So, how can I maintain a global counter that counts page from the first page all the way to the last? My document class is `report`.               \documentclass[pdftex,12pt,a4paper]{report}      ---------------------I am update line -----------------------               \usepackage[top=3cm, bottom=3cm, left=3.5cm, right=3cm]{geometry}          % graphics images     \usepackage[pdftex]{graphicx}          % 1.5 line spacing     \usepackage{setspace}     \onehalfspacing          % maths symbols     \usepackage{amsmath}          % table package     \usepackage{multirow}          % source code listing     \usepackage{listings}     \usepackage{color}     \usepackage{xcolor}          \usepackage{caption}               % citation style     \usepackage{apacite}     \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}          \begin{document}               % cover     \input{cover_report.tex}          % title page     \input{title_report.tex}          % abstract     \setcounter{page}{1}     \pagenumbering{roman}     \input{abstract.tex}          % acknowledgement     \input{acknowledgements.tex}          % table of content     \tableofcontents     \addcontentsline{toc}{chapter}{Contents}          % list of tables     \listoftables     \addcontentsline{toc}{chapter}{List of Tables}          % list of figures     \listoffigures     \addcontentsline{toc}{chapter}{List of Figures}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{intro.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{background.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{design.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{implementation.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{analysis.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{limit_future.tex}          % intro chapter     \cleardoublepage     \pagenumbering{arabic}     \input{conclusion.tex}          % references     \bibliographystyle{apacite}     \bibliography{my_ref}          % appendix     \end{document}


title: Package for avoiding hyphen in text?

text: Is there any package which can be used for avoiding hyphen in text? Regards


title: Why can't TeX Live's size be reduced?

text: I understand that the following question has been answered Why is the MacTeX distribution so large? Is there anything smaller for OS X? but my question differs from it. I just installed MacTeX and it used over 4 gigabytes of space on my computer. I understand the full LaTeX uses many, many libraries, but this is as big or bigger than an operating system. So my question is: Why can't the developers of TeX Live create it so it has very low overhead? Details would be really appreciated. I can only imagine the possibilities such as including it in web browsers and other applications/plugins (keynote, powerpoint, etc.).


title: Why does \everypar not work?

text: I tried to put a \P (¶ sign) after each paragraph. Therefore, I chose the               \everypar={\P}      command. First of all, I figured out that LaTeX redefines it internally after               \begin{document}      Hence, I placed my code inside the document environment. However, I did not have the wanted effect. Please find the minimal code:               \documentclass{article}     \begin{document}       \everypar={\P}       \section{Intro} some text \par next paragraph \par\noindent even more       \section{Outro} the end of my document     \end{document}      My output shows the \P before the section numbering which totally confused me. I use MikTeX 2.9.4813 (x64) and TeXnicCenter to build my documents.


title: Defining new accents in LaTeX

text: The documents that I type include lots of references to complex numbers and their complex conjugates, such as `$j, \overline{j}$`. I would find it lots easier to be able to type something as `\\*j` to denote `\overline{j}`. Then `\\*` would work very much like an accent, applying only to the next symbol if no curly braces are present. However, using `\renewcommand{\\*}[1]{\overline{#1}}` doesn't yield satisfactory results at all: `(x^\\*j)` yields ![](http://i.stack.imgur.com/8JWJD.png). Ideas?


title: Quote environment with reference at the end right

text: I want to define a quote environment such that after the quote on the right occurs the author with page number. My solution is yet the redefinition of the quote environment               \usepackage{amsthm} % pushQED, popQED     \newenvironment{aquote}[1]{%       \pushQED{#1}%       \begin{quote}     }{%       \par\nointerlineskip\noindent\hfill(\popQED)%       \end{quote}%     }      with the following result: ![](http://i.stack.imgur.com/ZcSNl.png) The drawback is the `parskip` in front of the author, which wastes some space in the first quote, but is right in the second one. If I change my command to:               \newenvironment{aquote}[1]{%       \pushQED{#1}%       \begin{quote}     }{%       \noindent\hfill(\popQED)%       \end{quote}%     }      I get the following result: ![](http://i.stack.imgur.com/m0LFr.png) Now the placement of the author's name in the first quote is perfect, but in the second quote I want a `parskip` in front, like in my first example. How can I find out, whether the line has enough space to put the author without a `parskip` behind or if there is not enough space to introduce a `parskip` to put the author on the next line?


title: Texstudio: Page Number in the PDF Previw Panel

text: In Texmate, there is an amazing feature in that it shows the page number on the left of the preview PDF page. You can then simply jump to that page by clicking the number (see figure below). Is there something similar in Texstudio? ![enter image description here](http://i.stack.imgur.com/2cqjg.png)


title: Replacing entries in a csv list

text: I want to replace entries in a csv list, where the list parser can be **arbitrary** (eg: `,;:|`). An example follows:               \def\x{r;s;t;x;y;z}      In this list I want to efficiently replace `r,t,x` by `a,b,c` via, say,               \replaceentries\x{r;s;t}{a;b;c}      But I may also end up with unbalanced pairs, like in               \replaceentries\x{r;s;t}{a;b;c;d;e}      and I don't want `TeX` to complain. Please has anyone solved this problem before, or perhaps found a solution in a package? Otherwise, I think I can give it a try, but why reinvent the wheel?


title: chapter style latex horizontal line

text: I want a chapter style like this:                                           1     ------chapter name-------------                text text text text tex           t text text text text t      I have come this far:               \documentclass{book}          \usepackage{titlesec}          \newcommand*{\xdash}[1][3em]{\rule[0.5ex]{#1}{0.55pt}}          \titleformat{\chapter}[display]     {\Large}{\filleft\Huge\thechapter}{1ex}{\xdash[2em]}[]          \begin{document}          \chapter     {Introduction}          Text text text text          \end{document}      but I can not get it right. I want the horizontal line to be longer then the "normal" text and I want the line to be before and after the chapter name.


title: Font shape undefined when using autoinst

text: I want to create my fonts using `autoinst` script for use with `pdflatex`. For this I run the commands `autoinst example-regular.otf` `autoinst example- italic.otf` `autoinst example-bold.otf` and `autoinst example-bolditalic.otf`. Now I'm running `texhash`and `updmap --enable Map example.map` and all works. But when I try to use the font in all installed shapes like in the MWE               \documentclass[11pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     %\usepackage{microtype}     \usepackage{example}     %\pdfmapfile{=example.map}     \usepackage[LY1,T1]{fontenc}     \usepackage{lipsum}     \begin{document}     test\enspace\textit{test}\enspace\textbf{test}\enspace\textit{\textbf{test}}     \end{document}      I'll only get the regular font shape and for the other shapes warnings like `LaTeX Font Warning: Font shape 'T1/example-TLF/m/it' undefined (Font) using 'T1/example-TLF/m/n' instead on input line 10.` and this for all shapes so the result looks like the following: ![test](http://i.stack.imgur.com/70814.jpg)


title: Acronym option for accsupp package: (how) does this work?

text: I'm trying to use the `E` acronym feature option from the `accsupp` package. It is actually not really documented what it should do, but I would like to obtain something like the HTML `title` tag in images, related question: How can I get pdflatex to make tooltips attached to text, like HTML's abbr tag? The MWE below works as advertized if I replace `E` by `ActualText`, but with the option `E` it doesn't show anything special, nor does it give an alternate text on copy&paste. Am I doing something wrong, or is this just a non- implemented feature. I'm using Adobe reader version 9.3.2 under Linux.               \documentclass{article}          \usepackage{accsupp}          \newcommand{\acronym}[2]{%     \BeginAccSupp{method=escape,E=#2}%     #1%     \EndAccSupp{}%     }          \begin{document}          Test: \acronym{USA}{United States of America}.          \end{document}


title: LaTeX cookbook?

text: Has anyone written, or is anyone working on, a LaTeX cookbook? Specifically, a guide to writing intermediate/advanced LaTeX macros and solutions to other common tasks? I found a handful of resources on the Web, but these were all brief and basic and appeared to be written for beginners. I also found a document called "Advanced LaTeX", which looks good, but is only 23 pages, and is actually only intermediate rather than advanced. I would love to have on my shelf a thick book that covers hundreds of short practical topics, with lots of visual examples. Things I have wondered how to do—and eventually learned thanks to folks here who have kindly answered my questions—include: _Symbols_   * Using `\ooalign` to stack glyphs for finely-tuned custom symbols.   * Creating custom symbols with TikZ when a symbol can't easily be created by mixing existing symbols.   * Extracting a single glyph from a font without loading the font to use in a macro.   * Patching `\verbatim*` and `\verb*` to override a symbol. _Styles_   * Testing whether the current style is slant or italic.   * Using `\mathchoice` to ensure a macro displays properly in various math contexts. _General_   * Using `\makeatletter` and `\makeatother` for internal sub-macros.   * Detecting an optional argument inside a macro.   * Extracting specific characters from a macro argument string.   * Using `\futurelet` to query the next token.   * Using `\ifthenelse` to select different behaviors within a macro (I didn't even know about the `ifthen` package until yesterday, and I wish I'd known about it weeks ago).   * Using `\fbox` to debug heights, depths, and width issues. _Formatting_   * Custom vertical and horizontal spacing in the `tabular` environment.   * When and how to use `\parbox`.   * Subtle differences between `\hbox` and `\mbox`. _Words_   * Right and wrong ways to suppress ligatures within a tricky word (such as "shelfful" or "cufflinks"). Many of these things turned out to be easy, but some (like `\mathchoice`, `\ooalign`, and `\futurelet`) were difficult if not overwhelming at first attempt. Most common questions seem to have answers here on TeX.sx already, but the answers can be elusive when the magic word or phrase to search for is not known, or when the possibility itself is not known (I totally didn't know about TikZ/PGF, for example).


title: Tikz for large files

text: I have a question regarding the use of `TikZ`. I have five large sets of data (15000 points) and I want to use `TikZ` to plot my data, but obviously the amount of memory isn't sufficient. Can anyone give me any suggestions on how I can solve this problem? I have tried using `epslatex` with `gnuplot` but the thing is, I prefer to use `TikZ` since that way I don't have to worry about the fonts etc.


title: "Thanks" note (footnote) placed below right column even though there is enough space on the left

text: In this two-column document, the "thanks" note is placed below the _right_ column even though there is enough space below the left column, and a lot of space is inserted around the heading of the first section. If some of the text of the first section is removed, the note fits on the left, as expected. However, if text is _added_ (!) to the first section, the note is _also_ placed on the left (see the comments in the document). The same thing is true for changing the "thanks" note itself - both making it shorter _and_ making it longer will move it to the left column. The floating figure seems to be a relevant factor - I haven't been able to reproduce the problem without a figure (or a table). I tried the `bigfoot` package which in fact moves the footnote to the left column, but also inserts some space before the abstract and additionally leaves just the heading (without any of the text) of the second section in the left column, directly above the footnotes. Additional space is indesirable because the conference paper length is limited, and the heading without text seems like exceptionally bad layout to me. In another question, `\makeatletter \@doclearpage \makeatother` is suggested for footnotes. I have been able to reproduce the same problem with a footnote instead of a "thanks" note, and this solution seems to work in this case. However, I haven't been able apply it to a "thanks" note.               \documentclass[12pt,letterpaper,twocolumn]{article}     %\usepackage{bigfoot} % Moves the note to the left, but messes up the layout     \begin{document}          \title{Lorem ipsum}     \author{John Doe\thanks{         Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor         incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis         nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi         consequat. Quis aute iure reprehenderit in voluptate velit esse cillum         dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non         proident, sunt in culpa qui officia deserunt mollit anim id est laborum.         % Enable the following lines and the note fits in the left column.         %Duis autem vel eum iriure dolor in hendrerit...         }}          \maketitle          \begin{abstract}     Lorem ipsum     \end{abstract}          \section{First section}          Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor     incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud     exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute     iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla     pariatur. Excepteur sint obcaecat cupiditat non proident.          % Remove the first line, and the "thanks" note fits in the     % left column. Enable the second line, and it fits as well (!).     Duis autem     %vel eum iriure dolor in hendrerit...                    \section{Second section}          \begin{figure}     A figure     \end{figure}          Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor     incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud     exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute     iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla     pariatur. Excepteur sint obcaecat cupiditat non proident.          \end{document}      Version is MiKTeX 2.9, the problem is identical for LaTeX and pdfTeX.


title: Which document class / package was used to typset this CV?

text: Could somebody point me to the appropriate LaTeX document class / package which was used to create this CV file? I know that this is border line acceptable question but I really like to reproduce the source code. Edit: I linked my new CV instead of the one I tried to reverse engineer.


title: How do you write aspirated consonants?

text: I am working on a linguistic topic and need to be able to describe phones with aspiration. As described in wikipedias article on Aspirated consonants there is a UTF8 character for the diacritic of aspiration, ʰ. But in latex it only appears as a question mark and it cannot be escaped with a slash. How do you write it?


title: How can one dynamically insert the number of subsections of the current section?

text: In a certain section of my document, I want to reference the number of subsections in this section ("In the following X subsections ..."). Is there any way to do this programmatically?


title: vertical alignment of text with slides class

text: I would like the content of each slide to be aligned at the top of each slide. How can one achieve that? By default the text is centered vertically, and that looks sloppy. There are many answers about how to do it in with `beamer` package, but I am using the plain simple `slides` class because I don't need the wealth of `beamer`'s features.


title: Trouble with subfloats/subcaption/subfigure

text: I compiled my tex file in Linux without any problems (text edior: Xemacs). I'm now running the file in TeXWorks with MikteX. I used the `subfig` package and the following worked perfectly:               \subfloat{\label{fig:a}}{\includegraphics[scale=0.12]{somefigname.jpg}}      or               \subfloat[n=50]{\label{fig:a}}{\includegraphics[scale=0.14]{someotherfigname.jpg}}      I kept getting the 'undefined control sequence' error after trying to compile it in Win7. Having done some research, I installed the caption package (by running `pdflatex caption.ins`) and changed the `\subfloat` command above to `\subcaption`. Now instead of the error above, I'm getting two new: `! Package caption Error: For a successful cooperation we need at least version ``2004/02/13 v1.2' of package listings, but only version ``2002/04/01 1.0 (Carsten Heinz)' is available.` The second one is:               ! LaTeX Error: Counter too large.      When trying to install the `caption` package through mpm, I keep getting the 'connection failure' error. I'm kind of lost here and have no idea what to do. Any suggestions?


title: Table overlapping text in conference document class

text: I have a problem with my table overlapping my text. I give the MWE and a picture of the result:               \documentclass[conference]{IEEEtran}     \usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor     \usepackage{amsmath} % matrices     \usepackage{comment}      \usepackage{amsfonts}     \usepackage{cite}     \usepackage{caption}          \begin{document}          \section{Conclusions and future work}          The results indicated that aerial gamma-ray spectrometry and topographical data can be used to detect soil types up to approximately 44 \% accuracy using multinomial logistic regression. An increase in the accuracy was achieved using 8-nearest neighbour classifier, which achieved approximately 50 \% accuracy. We noted that especially sandy till and sphagnum peat had good prediction accuracies when compared with other soil types. When considering low water permeability soil types, the prediction accuracy was higher.          There is a possibility to use aerial Light Detection and Ranging (LiDAR)\  data instead of the NTS elevation model. This would enable surface texture features and better post-processing capability to predict the actual soil types. This remains a subject of the further study.                Given the predicted hydraulic conduction layer, additional expert rules or machine learning methods can be used to select the soil type from several possible. Such expert rules exists but are not yet implemented.                \begin{table}         \small         \captionsetup[table]{skip=15pt}         \renewcommand{\arraystretch}{1.2}         \begin{center}                  \vspace{0.3cm}                  \begin{tabular}{| p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} |            p{8mm} | p{8mm} | p{8mm} | }             \hline             \cellcolor{gray!25}1206 & 731 & 225 & 228 & 244 & 43 & 11 & 19 & 12 & 8 \\ \hline             18448 & \cellcolor{gray!25}90820 & 43255 & 2299 & 10058 & 2299 & 835 & 395 &                11627 & 11042 \\ \hline             1530 & 14061 & \cellcolor{gray!25}19642 & 36 & 1161 & 1631 & 2599 & 1460 & 5512 &       3860 \\ \hline             0 & 6 & 0 &\cellcolor{gray!25} 167 & 35 & 0 & 0 & 0 & 0 & 2 \\ \hline             0 & 1 & 0 & 3 &\cellcolor{gray!25} 1 & 0 & 0 & 0 & 0 & 9 \\ \hline             0 & 0 & 0 & 0 & 0 &\cellcolor{gray!25} 0 & 0 & 0 & 0 & 0 \\ \hline             162 & 1804 & 504 & 44 & 181 & 547 &\cellcolor{gray!25} 4195 & 999 & 457 & 4 \\              \hline             0 & 0 & 0 & 0 & 0 & 0 & 0 &\cellcolor{gray!25} 0 & 0 & 0 \\ \hline             429 & 3444 & 3029 & 28 & 609 & 369 & 68 & 73 &\cellcolor{gray!25} 7948 & 7078 \\            \hline             765 & 8403 & 8707 & 15 & 1727 & 148 & 0 & 0 & 17252 &\cellcolor{gray!25} 27969 \\       \hline             \end{tabular}         \end{center}     \end{table}               \begin{table}         \small         \captionsetup[table]{skip=15pt}         \renewcommand{\arraystretch}{1.2}         \begin{center}             \captionof{table}{Test}              \vspace{0.3cm}                  \begin{tabular}{| p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} | p{8mm} |            p{8mm} | p{8mm} | p{8mm} | }             \hline             \cellcolor{gray!25}1206 & 731 & 225 & 228 & 244 & 43 & 11 & 19 & 12 & 8 \\ \hline             18448 & \cellcolor{gray!25}90820 & 43255 & 2299 & 10058 & 2299 & 835 & 395 &                11627 & 11042 \\ \hline             1530 & 14061 & \cellcolor{gray!25}19642 & 36 & 1161 & 1631 & 2599 & 1460 & 5512 &       3860 \\ \hline             0 & 6 & 0 &\cellcolor{gray!25} 167 & 35 & 0 & 0 & 0 & 0 & 2 \\ \hline             0 & 1 & 0 & 3 &\cellcolor{gray!25} 1 & 0 & 0 & 0 & 0 & 9 \\ \hline             0 & 0 & 0 & 0 & 0 &\cellcolor{gray!25} 0 & 0 & 0 & 0 & 0 \\ \hline             162 & 1804 & 504 & 44 & 181 & 547 &\cellcolor{gray!25} 4195 & 999 & 457 & 4 \\              \hline             0 & 0 & 0 & 0 & 0 & 0 & 0 &\cellcolor{gray!25} 0 & 0 & 0 \\ \hline             429 & 3444 & 3029 & 28 & 609 & 369 & 68 & 73 &\cellcolor{gray!25} 7948 & 7078 \\            \hline             765 & 8403 & 8707 & 15 & 1727 & 148 & 0 & 0 & 17252 &\cellcolor{gray!25} 27969 \\       \hline             \end{tabular}         \end{center}     \end{table}                         \vspace{1cm}          \begin{thebibliography}{9}           \vspace*{2mm}     \bibitem[Azz94]{Azz94}       A. Azzalini, P.J. Diggle.       \emph{Prediction of soil respiration rates from temperature, moisture and soil type}.       Journal of the Royal Statistical Society - Series C: Applied Statistics,       1994.              \vspace*{2mm}     \bibitem[Gao10]{Gao10}       H. Gao, Q. Tang, X. Shi, C. Zhu, T.J. Bohn, F. Su, J. Sheffield, M. Pan, D.P. Lettenmaier, E.F. Wood.       \emph{Water budget record from variable infiltration capacity     (vic) model. Algorithm Theoretical Basis Document     for Terrestrial Water Cycle Data Records},       2010.              \vspace*{2mm}     \bibitem[Gon05]{Gon05}       M. G\"onen, G. Heller.       \emph{Concordance probability and discriminatory power in proportional}. Biometrika,     92:965–970,       2005.             \vspace*{2mm}     \bibitem[Kiss04]{Kiss04}       R. Kiss.       \emph{Determination of drainage network in digital     elevation models, utilities and limitations}. Journal of     Hungarian Geomathematics, 2:16–29,       2004.           \vspace*{2mm}     \bibitem[Ram03]{Ram03}       A.T. Ramli, A.T. Rahman, M.H. Lee.       \emph{Statistical prediction of terrestrial gamma radiation dose rate based on geological features and soil types in Kota Tinggi district, Malaysia}.       Department of Physics, Faculty of Science, Universiti Teknologi Malaysia Skudai, Johore 81310, Malaysia,       2003.           \vspace*{2mm}     \bibitem[Scul04]{Scul04}       P. Sculla, J. Franklin, O.A. Chadwick.       \emph{The application of classification tree analysis to soil type prediction in a desert landscape}.       Ecological Modelling 181.       Department of Geography, Colgate University, 13 Oak Drive, Hamilton, NY 13346, USA, 2004.           \vspace*{2mm}     \bibitem[Schu05]{Schu05}       R.P.O. Schulte, J. Diamond, K. Finkele, N.M. Holden, A.J. Brereton.       \emph{Predicting the soil moisture conditions of Irish grasslands}.       Irish Journal of Agricultural and Food Research.       Teagasc, Johnstown Castle Environmental Research Centre, Wexford,       2005.              \vspace*{2mm}     \bibitem[Zach12]{Zach12}       J.V.A. Zachary.       \emph{Using topographic and soils data to understand and predict field scale moisture patterns}.       Graduate thesis, Iowa State University,       2012.               \end{thebibliography}                    \end{document}      ![enter image description here](http://i.stack.imgur.com/0jCsJ.png) In the conference document class the paper is divided into two columns. But what if I want to add a big picture or table that would require the whole width of the page? How can I make the text to follow the aligning as is specified in the conference document class but so that it wouldn't overlap the table or picture? Thnx for any help!


title: How to get this side by side?

text: I have the following code:               $ax = b \Leftrightarrow$      and               \begin{tabbing}         $a_{11}x_1 + $ \= $a_{12}x_2+\dots +$ \= $a_{1n}x_n$ \= $= b_1$\\         \> $a_{22}x_2 + \dots +$ \> $a_{2n}x_n$ \> $= b_2$\\         \> $\ddots$ \> $\vdots$ \> $\vdots$\\         \> \> $a_{nn}x_n$ \> $= b_n,$     \end{tabbing}      But how can I get, that these two parts are side by side? Thank you very much!


title: Is changing \lineskiplimit to some negative value a good idea, and what the value might be?

text: I'm writing a (large) document using Linux Libertine for text and Asana for math. I have a 11pt font with `\baselineskip=14pt`. However, not so seldom it happens that the default settings of `\lineskip=1pt` and `\lineskiplimit=0pt` cause lines (with some math and sub/superscripts, of course) to be further apart than usual (and I don't like it, especially since I want to have grid typesetting (which I achieve in my set of macros by carefully redefining `\section`s etc.)). My question is: assuming that I carefully proofread the whole thing (which I do), is it possible that I break something else somewhere else by setting `\lineskiplimit` to some negative value? (I mean some non- trivial interactions between various parts of LaTeX.) And if you consider this a good idea, what value would yo recommend? I know this question is a bit vague, so if you have an idea to make it more TeX.SE-conforming;), feel free to edit it/suggest something in the comments.


title: Difference between \let\foo\relax and \def\foo{} for disabling

text: When I want some macro to (temporarily) do nothing, I normally write               \let\foo\relax      But somebody asked me why I don't just do               \def\foo{}      and I realized I couldn't answer his question. So, I have two questions:   1. Can somebody give a practical example of when the two would be different;   2. For the purpose of disabling a macro, which of the two is preferred? Here's an example of how I normally use this:               \let\print@style\relax     \def\setprintstyle#1{\def\print@style{#1}}     \def\print#1{\print@style#1}


title: How to write greek letters in BibTeX entry?

text: I'm a LyX user. I have an article title with the following text: β-glucosidase I have this entry in BibTeX so I tried to type `\beta-glucosidase` or `{\beta}-glucosidase` but they don't work. I tried many research on internet and this website, I can't find out why the command `\beta` does not work. I do not want that it appears in italic like `{$\beta$}` Any suggestion?


title: Is it safe to abbreviate \begin{foo}...\end{foo} with something like \bfoo ... \efoo

text: Can I safely do this:               \newcommand\bfoo{\begin{foo}}     \newcommand\efoo{\end{foo}}      where `foo` is a standard LaTeX environment? Probably the `verbatim` environment breaks, but others as well? That way one could write               \bfoo     inside the foo environment     \efoo      instead of the longer               \begin{foo}     inside the foo environment     \end{foo}      I'd appreciate a technical statement, not a "I wouldn't do this, because it is unreadable". For a fact, I just want to know its implications and I wouldn't do this, because I think it is not very readable.


title: Using the erdc with MiKTeX on Windows (trouble with mathgifg and font setup)

text: I'm trying to use the erdc class for a document I've been typesetting, which currently uses the memoir class. erdc depends on mathgifg, which in turn requires Fraklin Gothic and Georgia fonts, which are TTF. These have to be installed independently, via conversion with ttf2pt1/ Unfortunately, upon installing the mathgifg.map file for assigning/mapping fonts, and copying the converted pfb files following the manual, LaTeX complains with this:               <C:/Program Files/MiKTeX 2.9/fonts/type1/itc/franklingothic/fradm.pfb>     !pdfTeX error: pdflatex (file fradmcn.pfb): cannot open Type 1 font file for reading      ==> Fatal error occurred, no output PDF file produced!      The files are there, including fradmcn.pfb, which confuses me, since the message indicates it is "missing". I'm hitting a wall with the mathgifg package, and conversion was done with a Windows distribution of the tool with moderately recent freetype libraries. **Update** : I did run updmap and texhash. The initexmf with updmap opens a completely blank config file. Is this normal? I must give a heads up on mathgifg: it comes with its own mathgifg.map file, see mirrors.ctan.org/install/fonts/mathgifg.tds.zip


title: Grey (not black) shadow box?

text: I would like to change the default color of a shadowbox to grey. How to do that with no problem of equation "style"/"management" inside the shadowbox ? Thank you very much


title: \cellcolor overwrites table lines

text: I have a table which I want to fill with multiple colors, each cell possibly different from another. Which means, I can't make use of e.g. `\columncolor` (as in this post). While the table without any colors looks just fine (code at the end): ![empty table](http://i.stack.imgur.com/I2ilU.png) ...the table with one or more filled cells overwrites the table grid. ![filled tables](http://i.stack.imgur.com/K7brB.png) **So my question is:** Is there a way to, for example, redraw the grid after filling the cells or something? * * * **EDIT:** _added complete code instead of code fragments_ Relevant LaTeX code:               \documentclass[11pt]{article}          \usepackage{color}     \usepackage{colortbl}     \usepackage{multirow}          \newlength{\Oldarrayrulewidth}     % Cline redefining to add line thickness     \newcommand{\Cline}[2]{%       \noalign{\global\setlength{\Oldarrayrulewidth}{\arrayrulewidth}}%       \noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%       \noalign{\global\setlength{\arrayrulewidth}{\Oldarrayrulewidth}}     }               \definecolor{intnull}{RGB}{213,229,255}     \definecolor{inteins}{RGB}{128,179,255}     \definecolor{intzwei}{RGB}{42,127,255}     \definecolor{intdrei}{RGB}{0,85,212}     \definecolor{intvier}{RGB}{0,51,128}     \definecolor{intfunf}{RGB}{0,34,85}               \begin{document}     % Empty table     \begin{tabular}{*{5}{!{\vrule width 1.5pt}p{1.5cm}}!{\vrule width 1.5pt}l}     \centering 4 &     \centering 10 &     \centering 24 &     \centering 48 &     \centering 72 &\\ \Cline{1.5pt}{0-4}      &  &  &  &  & Optic tectum \\ \Cline{1.5pt}{3-5}      &  &  &  &  & Retina \\ \Cline{1.5pt}{3-5}      &  &  &  &  & Myomeres \\ \Cline{1.5pt}{0-4}      &  &  &  &  & Arches \\ \Cline{1.5pt}{0-4}     \end{tabular} \\          \hspace*{1cm}          % Partically filled table     \begin{tabular}{*{5}{!{\vrule width 1.5pt}p{1.5cm}}!{\vrule width 1.5pt}l}     \centering 4 &     \centering 10 &     \centering 24 &     \centering 48 &     \centering 72 &\\ \Cline{1.5pt}{0-4}      & \cellcolor{intnull} &  & \cellcolor{intvier} &  & Optic tectum \\ \Cline{1.5pt}{3-5}      & \cellcolor{intnull} &  & \cellcolor{intnull} &  & Retina \\ \Cline{1.5pt}{3-5}      & \cellcolor{intnull} &  & \cellcolor{intdrei} &  & Myomeres \\ \Cline{1.5pt}{0-4}      & \cellcolor{inteins} &  & \cellcolor{inteins} &  & Arches \\ \Cline{1.5pt}{0-4}     \end{tabular}          \end{document}


title: How to put label on top of an inference rule (bussproofs package)?

text: I use bussproofs (instead of mathpartir) to layout inference rules. bussproofs can place labels to the left and to the right of a rule, but not on top of a rule (like mathpartir can do). Is there an easy way to place the label on top of a rule in bussproofs? For example, the following will layout a rule with its label on the left.               \begin{prooftree}       \AxiomC{$a$}       \LeftLabel{Name-of-Rule}       \UnaryInfC{$b$}     \end{prooftree}      I am looking for a bussproofs version of the following mathpartir-based latex code:               \inferrule[Name-of-Rule]{a}{b}      Here is an example document using mathpartir which produces the desired result (label is on top and left aligned with the rule):               \documentclass{article}     \usepackage{mathpartir}     \begin{document}          \begin{mathpar}       \inferrule[Foo]{A \quad B}{C}     \end{mathpar}     \end{document}      ![Result of mathpartir](http://i.stack.imgur.com/dcMfV.png) Here is an example using bussproofs, I do not know how to get the label on top of the rule.               \documentclass{article}     \usepackage{bussproofs}     \begin{document}     \begin{prooftree}       \AxiomC{A}       \AxiomC{B}       \LeftLabel{Foo}       \BinaryInfC{C}     \end{prooftree}     \end{document}      ![Result with bussproofs](http://i.stack.imgur.com/TSFDw.png)


title: Font Info Program Name Clash Probem

text: I have had problems getting the **autoinst** program to install an **OpenType** font family in my **TeX/LaTeX** tree. After making desperate and frustratingly long efforts I discovered that my system had two different **otfinfo** programs: (a) The **otfinfo** program used by the **openmpi** --- **/usr/lib64/mpi/gcc/openmpi/bin/otfinfo** ; and (b) the **otfinfo** program used by the autoinst program --- **/usr/bin/otfinfo**. I discovered, after doing **otfinfo --help** , that **autoinst** had been trying to use the **otfinfo** program which is meant for use by the **openmpi**. I work in a SUSE 13.1 environment. There may be other TeX/LaTeX users who may have experienced problems with the **autoinst** program, as I did, probably due to the name clash problem. I succeeded in using the **autoinst** program by renaming the **otfinfo** program which is meant for use by the **openmpi**. However, I consider this to be a temporary solution. (I may need the other **otfinfo** program soon.) Does someone have an idea of how one could get the two **otfinfo** programs to live together happily in a system under the same name?


title: Possible solution to make tabulars fill page vertically!

text: I wrote this code which fills a tabularx with blank lines until the end of the page. It worked but has one problem: When the space to fill is less than one line (e.g. paperwidth=180pt), it inserts one line, and predictably savepos "loops" and its labels don't stop changing when compiling multiple times. How can be improved? MWE:               \documentclass{article}     \usepackage{tabularx}     \usepackage{zref-savepos}     \usepackage{calc}     \usepackage{geometry}     \newlength{\Start}     \newlength{\End}     \newlength{\Diff}     \newbox{\ParBox}     \geometry{paperheight=300pt,vmargin={0pt,0cm},hmargin={0cm,0cm},footskip=0pt,headsep=0pt,headheight=0pt}     \begin{document}     \setlength{\parindent}{0cm}     \setlength{\Start}{\zposy{start}sp}%     \setlength{\End}{\zposy{end}sp}%     \setlength{\Diff}{\Start-\End}     \savebox{\ParBox}{\parbox[t][\Diff]{2cm}{\mbox{}}}%     \begin{tabularx}{10cm}{|lXl|}\hline     . & start \the\Start{} - end \the\End & . \\     . & filled space \the\dp\ParBox & . \\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     .&.&.\\     & \framebox{\usebox{\ParBox}} &\\     \hline     \end{tabularx}\par     \vspace*{-\Start}     \vspace*{-\End}     \zsaveposy{start}%     \vfill\zsaveposy{end}%     \end{document}


title: Error with \newcommand and \section

text: I'm trying to typeset an article. In the preamble, I defined these two things:               \newcommand{\leftexp}[2]{{\vphantom{#2}}^{#1}{#2}}          \newcommand{\hr}{\leftexp{*}{\mathbb{R}}}      However, when I try to use `$\hr$` in a section, as in:               \section{Constructing $\hr$}      I get an error:               Incomplete `\iffalse`; all text was ignored after line 1.      Any idea what could be causing this? Everything works just fine if I don't have the `$\hr$` in the section (e.g. It typesets just fine if I have `\section{Constructing $\mathbb{R}$}`, say).


title: Error of "missing \item" in enumerate when using custom bullets?

text: I'm using `enumerate` to type up homework solutions, based on the following MWE. When I remove the `[(a)]` from the `enumerate`, there isn't an error, but when I add it, I get the "perhaps a missing `\item`" error. How can I fix this? I don't want to add an `\item` in front of the solution, since it isn't part of the list per se, and I don't want to remove the custom bullet because in my full document, this is part of a nested list.               \documentclass[12pt]{article}          \begin{document}     \begin{enumerate}[(a)]     \item $n(n+1)/2 \in O(n^3)$          True, because $n(n+1)/2$ is of order 2, which is less than order 3.           \item $n(n+1)/2 \in O(n^2)$          \end{enumerate}     \end{document}


title: How can I add abstract to table of contents

text: I believe it is correct to add the abstract to my TOC but I don't know how. This Answer talking about adding the abstract chapter to the TOC. I'm using Lyx and if I output to .tex file this is what I see.               \documentclass[english]{report}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{babel}          \makeatother          \usepackage{babel}     \begin{document}          \title{My Title}               \author{My Name}          \maketitle     \tableofcontents{}     \begin{abstract} %% This isn't a chapter!      My Abstract isn't a chapter. * * * Abstract is created with `begin{abstract}` unlike in questions I **LINKED** to and have been marked as a duplicate. In that example abstract is a chapter.   Does this affect the correct use of getting my Abstract into the TOC? * * * > Assuming that the abstract and acknowledgement contents is typeset using a > \chapter*{...}, Well it isn't, So what do I do in my case?


title: Centering an image vertically

text: I'm currently having a few problems with centering an image on a page (both vertically and horizontally) while enlarging the image so that it is taking the whole width of the page. I'm managing to center the picture horizontally, but not vertically. The code below shows the version I made that centers the image horizontally. My question is here what can I do to center it also vertically? I'm having an srcbook class .tex:               \documentclass[11pt,a4paper,BCOR10mm,DIV11,toc=listof,parskip=full]{scrbook}          \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{booktabs}                 \usepackage{multicol}         I'm currently positioning the image like this:               \centerline\noindent\makebox[\textwidth]{\includegraphics[width=\paperwidth]{MyImage.jpg}


title: Getting Started to Xetex for Devangari?

text: I have learn LaTeX for a while. Now, I want to type Indic scripts using Tex and I found that XeTeX is the best because it supports unicode and opentype fonts. But the problem is there are not any single tutorial which gives on how to get XeTeX working. Normally, when a Unicode text file is sent for XeTeX it works but all ligatures and conjuncts are NOT considered. After a long search I found one which uses a mix of romanized way and original devangari, when is posted below as example 1. I just want to type in display as english character are typed for the .tex file as example 2. **Example 1: Using a mix of romanized mapping or something like that.**               % This is a Unicode file.     \documentclass[12pt]{article}     \usepackage{multicol} % just to get narrow columns on one page     \usepackage{polyglossia} % the multilingual support package     % for XeLaTeX - includes Sanskrit.     % Next, from the polyglossia manual:     \setdefaultlanguage{english} % this is mostly going to be English text, with     \setotherlanguage{sanskrit} % some Sanskrit embedded in it.     % These will call appropriate hyphenation.     \usepackage{xltxtra} % standard for nearly all XeLaTeX documents     \defaultfontfeatures{Mapping=tex-text} % ditto     \setmainfont{Gandhari Unicode} %could be any Unicode font     % Now define some Devanagari fonts:     % John Smith's Nakula, input using Velthuis transliteration     \newfontinstance     \velthuis [Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}     % John Smith's Sahadeva, input using Velthuis transliteration     \newfontinstance     \sahadeva [Script=Devanagari,Mapping=velthuis-sanskrit]{Sahadeva}     % John's Sahadeva, input using scholarly romanisation in Unicode     \newfontinstance     \sahadevaunicode [Script=Devanagari,Mapping=RomDev]{Sahadeva}     % Microsoft's Mangal font (ugh!), input using standard romanisation in Unicode.     \newfontinstance     \mangal [Script=Devanagari,Mapping=RomDev]{Mangal}     % Somdev's RomDev.map is used above to get the mapping     % from Unicode -> Devanāgarī. Zdenek Wagner's velthuis-sanskrit.map     % is used to get the Velthuis->Devanāgarī mapping. These are the files     % that XeTeX uses to make all the conjunct consonants without needing     % any external preprocessor (like the old devnag.c program).     % % Set up the font commands:     %     \newcommand{\velt}[1]{{\velthuis \textsanskrit{#1}}}     \newcommand{\saha}[1]{{\sahadeva\textsanskrit{#1}}}     \newcommand{\sahauni}[1]{{\sahadevaunicode\textsanskrit{#1}}}     \newcommand{\mangaluni}[1]{{\mangal\textsanskrit{#1}}}     % \textssanskrit, above, is a Polyglossia command that gets Sanskrit hyphenation right.     % ... and here we go!     \begin{document}     \begin{multicols}{2} % narrow cols to force plenty of hyphenation     \large % ditto.     \begin{enumerate}     \item[1]     With Xe\LaTeX\ it's easy to typeset Velthuis encoded Devanagari like the following example, without using a preprocessor:     \velt{sugataan sasutaan sadharmakaayaan pra.nipatyaadarato 'khilaa.m"sca vandyaan|     sugataatmajasa.mvaraavataara.m kathayi.syaami yathaagama.m samaasaat||} Bodhicaryāvatāra 1,1.     NB: automatic hyphenation.     \item[2]     A different Devanāgarī font:     \saha{sugataan sasutaan sadharmakaayaan pra.nipatyaadarato 'khilaa.m"sca vandyaan|     sugataatmajasa.mvaraavataara.m kathayi.syaami yathaagama.m samaasaat||} Bodhicaryāvatāra 1,1.     \item[3]     Another sentence: \saha{ratnojjvalastambhamanorame.su muktaamayodbhaasivitaanake.su|     svacchojjvalasphaa.tikaku.t.time.su sungandhi.su snaanag.rhe.su te.su||} 2,10.     \item[4]     Now, thanks to Somdev's RomDev.map, we can input in Unicode, using standard scholarly transliteration, and get Devanāgarī generated for us automatically:     \sahauni{āsīdrājā nalo nāma vīrsenasuto balī||\par }     \item[5]     Plain Unicode input, no tricks:     āsīdrājā nalo nāma vīrsenasuto balī||     \item[6]     Plain Unicode romanisation input, no tricks:     \mangaluni{āsīdrājā nalo nāma vīrsenasuto balī||\par }     Plain Unicode Devanāgarī input, no tricks:     {\mangal आसीद्राजा नलो नाम वीरसेनसुतो बली|\par}     \end{enumerate}     \end{multicols}          \noindent     English and Devanāgarī are both doing okay. The only thing that isn't hyphenating well yet is Sanskrit in roman transliteration.          Other nice stuff becomes easy. E.g., define a command \verb|\example| that prints a romanised word in Nāgarī, and then repeats it in romanisation, in parentheses:          \verb|\newcommand\example[1]{\sahauni{#1}~(\emph{#1})}|\newcommand\example[1]{\sahauni{#1}~(\emph{#1})}          Input: \verb|\example{ekadhā}|          Output: \example{ekadhā}     \end{document}     %that's all folks!      ![](http://i.stack.imgur.com/xGpUy.png) Example 2: What I want tutorial to focus on to be like ? As in standard latex               \documentclass{article}     \begin{document}     \section{संस्कृतम्}     जीवनस्य लक्ष्यमेव संस्कृतस्य वर्धनम्     \subsection{कोऽम्}     संस्कृतं (Sanskrit) पृथिव्‍यां प्राचीना समृद्घा शास्त्रीया च भाषा मन्‍यते। विश्‍ववाङ्‌मयेषु संस्‍कृतं श्रेष्‍ठरत्‍नम् इति न केवलं भारते अपि तु समग्रविश्‍वे एतद्‌विषये निर्णयाधिकारिभि: जनै: स्‍वीकृतम्। महर्षिणा पाणिनिना विरचितम् "अष्‍टाध्‍यायी" इति संस्‍कृतव्‍याकरणम् अधुनापि भारते विदेशेषु च भाषाविज्ञानिनां प्रेरणास्‍थानं वर्तते। संस्‍कृतशब्‍दान् एव उत्तरभारते दक्षिणभारते च स्वमातृभाषास्य संयोजयन्‍ति। संस्कृतात् प्राय: सर्वा अपि भारतीयभाषाः उद्भूताः।     \end{document}      What i really what to focus is input of devangari letters in same as that of english letters. **I don't want to write saṁskr̥taṁ (or any romanized tricks) to get संस्कृतं as output.** I just that I type संस्कृतं to get संस्कृतं and you type english in latex to get english as output. So guys, thanks in advance for reading this much. Is there any nice tutorial and any help for me to get started typesetting devangari unicode with xetex?


title: Changing Font and Make Header for a Thesis

text: I want to set the font to 14pt in my Master Thesis, and make a header contains the following: > Chapter# chapter Name I use a style file and a a .cls one. I have asked another question in : The word CHAPTERS: in Table of contents before appendices The answer there may help with this one. A MWE is as follows               \documentclass[ms]{osudissert96}     \usepackage{amssymb,amsfonts,amsmath,amscd,mathrsfs}     \usepackage{url}     \usepackage[dvips]{color}%colortext     \usepackage{longtable}% Using longtable environment     \usepackage{ifthen}% Gives \ifthenelse     \usepackage{graphicx}     \usepackage[labelfont=bf]{caption}     \usepackage{algorithm}     \usepackage{algorithmicx}     \usepackage{multirow}     \usepackage{tablefootnote}     \graphicspath{{figures/}}% Define the path to the figures colorlinks,     \usepackage[]{mcode}     \usepackage{subcaption}     %\usepackage[toc,page]{appendix}     \usepackage[titletoc,toc,page]{appendix}     \newtheorem{mydef}{Definition}     \usepackage{acronym}     \usepackage{booktabs}               % Fix referencing of nested enumerations (put a dot between counters)     \makeatletter     \renewcommand{\theenumii}{\arabic{enumii}}     \renewcommand{\labelenumii}{\theenumi.\theenumii}     \renewcommand{\p@enumii}{\theenumi.}     \makeatother               \makeatletter \@addtoreset{footnote}{chapter} \makeatother % Clear the footnote counter at every new chapter          % The following adds the hyperlinks and makes the page navigator in the pdf viewer cool     \usepackage[breaklinks, hyperindex,pdfborder={0 0 0}]{hyperref}          % This will make chapter titles show up in uppercase (however, they will be normal case in the TOC)     \renewcommand\typesetChapterTitle[1]{\uppercase{#1}}          % Notation:     %\def\listofnotation{\input symbols.tex \clearpage}     %\def\addnotation #1 #2#3{#1\> \parbox{5in}{#2 \dotfill  \pageref{#3}}\\}     %\def\newnot#1{\label{#1}}                              %% To speed up compilation, you can comment all commands that include chapters you're interested in till you finish each chapter separately, or use the includeonly command     %\includeonly{ch1-intro}          \include{commands}               \begin{document}          \setcounter{tocdepth}{3}          \tableofcontents     \listoffigures     \listoftables     \newpage               \chapter{CH1}          \renewcommand\pagenumbering[1]{}     \begin{appendices}          \chapter{MATLAB Code}\label{App:Matlab_Code}     \end{appendices}     \end{document}


title: How can I add annotations at the end of each line of a listing?

text: (I'm new to LaTeX.) I'd like to annotate each line of a (Java) listing (typeset with `listings`) to specify the computation time associated with it. However, I can't simply edit the file and add the annotations in the code itself, because those annotations contain special characters that get my IDE really upset. Therefore, I have to add those annotations in LaTeX, somehow. Hence my question: how can I add a comment at the end of a line in a listing?


I am using TexShop on Mac OS X Mavericks, I need to type mathematical formulas and greek symbols like `\omega`. I try to include the `ashmath` package from TexShop (using PdfTex):               \usepackage{ashmath}      But I get the error: `LaTeX Error: File 'ashmath.sty' not found`. I checked on TexLive Utility, and `ashmath` is already installed: ![enter image description here](http://i.stack.imgur.com/7YIIk.png)


title: Different headers for odd and even pages

text: Please help me to design pages with a different title on odd and even pages: I mean I would like to have for example   * name of author on odd pages.   * name of article on even pages. How can I do it? Many thanks,


title: Distance between top edge of paper and header

text: _EDIT_ : Please apologize me. I forget to add two lines to MWE I think very essential to handle the problems. Please re-check the MWE. There is parameter defining distance between bottom edge of top margin and first baseline of body, called `\topskip`. Existence of such parameter encourage me to search for parameter defining distance between top edge of paper to (first line of) header text. The aim is to set such a distance to 1.5cm. At first, I think `\voffset` could be used, from fancyhdr documentation. After some experiment, including elimination of extra 1 inch to 2.1 cm, I find that it will create kind of inconsistency on top margin with option-setting in `geometry` package loading. Before setting `\voffset`, the top margin (distance from top edge of paper to body) is 3 cm. After setting, the margin shrink 0.6 cm roughly. Moving `\voffset` setting before `\geometry` loading has no effect. Setting `\headheight` to eliminate too-small-warning, adding `\includeheadfoot` option as suggested by this make top-margin larger than 3 cm. The requirement is, **to make the distance between top edge of paper to top edge of header text 1.5 cm, meanwhile preserving top margin of paper 3cm**. _Note that top margin here is distance between top edge of paper to top edge of paragraph/text body/main_ Here is MWE before setting `\headheight` and `\includeheadfoot`.               \documentclass[12pt, a4paper, onecolumn, oneside, final]{report}          \newlength{\theDistance}     \setlength{\theDistance}{1.5cm}     \addtolength{\theDistance}{-2.1cm} %instead 1 inch extra in fancyhdr documentation     \setlength{\voffset}{\theDistance}     %\usepackage[paper=a4paper,headheight=0pt,left=4cm,top=3cm,right=3cm,bottom=3cm,showframe]{geometry}     \usepackage[paper=a4paper,headheight=27.1pt,left=4cm,top=3cm,right=3cm,bottom=3cm, includeheadfoot, showframe]{geometry}     \setlength{\footskip}{0.5cm}     \setlength{\topskip}{8.2pt}              \usepackage{fancyhdr}     \fancypagestyle{plain}     {%          \fancyhf{}%          \fancyfoot[C]{\thepage}%          \fancyfoot[R]{\footnotesize {\fontfamily{phv}\selectfont{\bo{Dummy University}}}}          \renewcommand{\headrulewidth}{0pt}         \renewcommand{\footrulewidth}{0pt}     }%          \begin{document}     Some text blah blah blah     \end{document}


title: help with creating a page of equations using (LaTeX?)

text: I am looking to create a template where I can quickly generate pages of basic math equations. LaTeX seems like a good place to start typesetting math equations but I am completely stumped with the syntax. My thoughts are to first build a template, use python to generate the template code with random numbers, convert to PDF, then print. here is an example of what I have come up with so far, but trying to nest this within another table created issues.               \halign{\hfil # & # \hfil \cr 4\cr \underline{+2}\cr}      This produces ![rendered example](http://i.stack.imgur.com/EhnbR.png). Are there any other languages or tools that I could use to meet my goals? I'm all ears.


title: Extracting the contents of text in a specified environment into a new file

text: Imagine I have a complete latex file and I want to extract only the text that appears in a specified environment (i.e., within a custom `hypothesis` environment) For example:               \begin{document}     ...     Lots of stuff that I don't want extracted     \begin{hypothesis}      The content that I want to extract     \end{hypothesis}     ...     Lots more stuff I don't want to exract     ...     \begin{hypothesis}      Some more content that I want to extract     \end{hypothesis}     \end{document}      **The question:** What's a simple way of taking a complete latex source file and extracting just the text in a specified environment and saving it to a new text file? Although I'm not an expert I've heard a lot of people talk about Perl scripts being good for string manipulation. I also sometimes use regular expressions. Thus, in addition to a specific solution to the above problem, I would be interested to hear about general approaches to related LaTeX text manipulation tasks. **Update:** Copying and pasting is not a desired option because the environment occurs over 20 times in a 20,000 word document.


title: TiKZ calendar: Easter related holidays

text: I wrote some code for finding the date of Easter. Now I want to use it with the TiKZ calendar to mark the Easter related holidays. Here's what I have so far:               \documentclass{scrartcl}     \usepackage[T1]{fontenc}     \usepackage{libertine}     \usepackage[margin=5pt,a5paper,landscape]{geometry}     \setlength{\parindent}{0pt}          \usepackage{tikz}     \usetikzlibrary{calendar}          \usepackage{expl3}          \ExplSyntaxOn          %% Knuth's AoCP, vol 1, 2nd ed, pp 155--156     \int_new:N \l_easter_Y_int     \int_new:N \l_easter_G_int     \int_new:N \l_easter_C_int     \int_new:N \l_easter_X_int     \int_new:N \l_easter_Z_int     \int_new:N \l_easter_D_int     \int_new:N \l_easter_E_int     \int_new:N \l_easter_N_int     \int_new:N \l_easter_M_int          \cs_new:Nn \easter_sunday:n {            \int_set:Nn \l_easter_Y_int { #1 }            \int_set:Nn \l_easter_G_int {         \int_mod:nn { \l_easter_Y_int } { 19 } + 1       }            \int_set:Nn \l_easter_C_int {         \int_div_truncate:nn { \l_easter_Y_int } { 100 } + 1       }            \int_set:Nn \l_easter_X_int {         \int_div_truncate:nn { 3 * \l_easter_C_int } { 4 } - 12       }            \int_set:Nn \l_easter_Z_int {         \int_div_truncate:nn { 8 * \l_easter_C_int + 5 } { 25 } - 5       }            \int_set:Nn \l_easter_D_int {         \int_div_truncate:nn { 5 * \l_easter_Y_int } { 4 } - \l_easter_X_int - 10       }            \int_set:Nn \l_easter_E_int {         \int_mod:nn { 11 * \l_easter_G_int + 20 + \l_easter_Z_int           - \l_easter_X_int } { 30 }       }            % \int_mod:nn behaves strangely.       \int_compare:nNnT { \l_easter_E_int } < { 0 }       {         \int_add:Nn \l_easter_E_int { 30 }       }            \int_compare:nNnTF { \l_easter_E_int } = { 25 }       { % true         \int_compare:nNnT { \l_easter_G_int } > { 11 }         { % true           \int_incr:N \l_easter_E_int         }       }       { % false         \int_compare:nNnT { \l_easter_E_int } = { 24 }         { % true           \int_incr:N \l_easter_E_int         }       }            \int_set:Nn \l_easter_N_int { 44 - \l_easter_E_int }            \int_compare:nNnT { \l_easter_N_int } < { 21 }       { % true         \int_add:Nn \l_easter_N_int { 30 }       }            \int_add:Nn \l_easter_N_int {         7 - \int_mod:nn { \l_easter_D_int + \l_easter_N_int } { 7 }       }            \int_compare:nNnTF { \l_easter_N_int } > { 31 }       { % true         \int_sub:Nn \l_easter_N_int { 31 }         \int_set:Nn \l_easter_M_int { 4 } % April       }       { % false         \int_set:Nn \l_easter_M_int { 3 } % March       }          }          \ExplSyntaxOff          \begin{document}          \begin{tikzpicture}       \calendar[dates=2012-04-01 to 2012-05-last, week list];     \end{tikzpicture}          \end{document}


title: Left justify parts of resume using res.cls

text: I'm creating a resume using the `res.cls` package and I'm using the `margin` style option, which specifies that section titles are to the left of the body text. This essentially makes it look like there are two columns -- the left column where the section titles are and the right where the body is. This is fine for most of the resume, however, in certain places, I would like to have the body text be all the way to the left of the page. For example, I want a line which says "This information is current as of DATE", justified to the left of the page, not just the left of the body column. Does anyone know how I can do this?               \documentclass[margin,line]{res}     \oddsidemargin -.5in     \evensidemargin -.5in     \textwidth=6.0in     \itemsep=0in     \parsep=0in     \newenvironment{list1}       {\begin{list}{\ding{113}}{%         \setlength{\itemsep}{0in}         \setlength{\parsep}{0in}         \setlength{\parskip}{0in}         \setlength{\topsep}{0in}         \setlength{\partopsep}{0in}         \setlength{\leftmargin}{0.17in}}}       {\end{list}}     \newenvironment{list2}       {\begin{list}{$\bullet$}{%         \setlength{\itemsep}{0in}         \setlength{\parsep}{0in}         \setlength{\parskip}{0in}         \setlength{\topsep}{0in}         \setlength{\partopsep}{0in}         \setlength{\leftmargin}{0.2in}}}       {\end{list}}     \begin{document}     \name{Name \vspace*{.1in}}     \begin{resume}     \section{\sc Research Interests}     Bayesian statistics, spatial and spatio-temporal statistics,      statistical methods for environmental and public health data,      statistical computing, statistical methods for large datasets.      {Current information as of May 2012}     \end{resume}     \end{document}      Also, here is a link to the template I'm using: http://biosun1.harvard.edu/~paciorek/computingTips/Latex_template_creating_CV_.html


title: error while importing tex file to lyx

text: i'm getting this error message An error occurred while running: `/Applications/LyX.app/Contents/MacOS/tex2lyx" -f "nrcd.tex" "nrcd.lyx` while importing tex file to lyx 2.0.6 can anyone help please?


title: Is there any way of adding my name at the top of each page without fancyhdr

text: I'm just trying to figure out a way to add my name at the top of each page without using the package `fancyhdr`, since I'm having problems with the installation of this package.


title: Error when inserting a PDF page into a Beamer presentation

text: I'm using `pdfpages` to insert a page from a pdf file into my Beamer presentation, but the result is a completely empty page. Here is smaller version of the file:               \documentclass{beamer}     \usepackage{epstopdf}     \usepackage{xypdf}     \usepackage{eso-pic}      \usepackage{everyshi}      \usepackage{beamerthemesplit}     \usepackage{pdfpages}           \begin{document}     \includepdf[pages={61}]{IA_Residential_Full_FINAL.pdf}     \end{document}      Not sure if it matters, I'm using MikTeX with pdfLaTeX. I've searched the web and haven't been able to figure what I'm doing wrong.


title: Random shuffle itemize

text: Is there an environment (or macro for itemize) that shuffles all items randomly each time the pdf is generated?


title: In ModernCV, how to define a command in the cls style file to allow lines with right-aligned word.

text: I am using ModernCV for my CV. I want to achieve something like the following example (please note that the address "`align2@rightMargin.com`" is aligned to the right margin): ![Example](http://i.stack.imgur.com/lMh23.jpg) Please note the last word is not necessarily an email address but any other word. In the example above what I used is the `\hspace` command, so I have to estimate the `hspace` manually everytime I change length of the sentence. I notice `\raggedleft` may be the right command, but I don't know how to make a command like `\cvline` in the ModernCV `cls` file to achieve the above example. Any help will be highly appreciated.