title: Text alignment on multirow when it breaks between pages

text: How can I get properly displayed text on multirow cells, when they break between pages? Here the example http://web-engineering.com.ua/mtest.pdf Text '/importp' on the end of first page prints unproperly. I don't know on which cell page will be broken. here code               \begin{tabularx}{\linewidth}{l|l|l|X|}          \hline\noalign{\vskip-\arrayrulewidth}\endhead     \noalign{\vskip-\arrayrulewidth}\hline\endfoot          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode=bookmark|thumb|none} & \multicolumn{1}{|m{0.15\newtblsparewidth}}{} & \multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{nameddest=<name>} & \multicolumn{1}{|m{0.15\newtblsparewidth}}{} & \multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{highlight=<lt>,<rt>,<top>,<btm>} & \multicolumn{1}{|m{0.15\newtblsparewidth}}{} & \multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{fullscreen=yes|no} & \multicolumn{1}{|m{0.15\newtblsparewidth}}{} & \multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{usept=yes|no} & \multicolumn{1}{|m{0.15\newtblsparewidth}}{} & \multicolumn{1}{|m{0.37\newtblsparewidth}|}{If \textbf{yes}, then all values for positioning such as \textit{top, left, right, btm, wd, ht,} etc. are absolute and measured in points(1/72 inch).               Otherwise these values will be interpreted as a  count of pixels at 100\% zoom. This behavior is default for Adobe  Acrobat/Reader. In this case, to receive absolute value in points,  Acrobat calculates it by:              V(pt)=V(from\_cmd)\(\ast{}\)72.0/(disp\_resol)              The  \textit{disp\_resol} parameter is used in global ‘Preferences/Page  Display/Resolution’ location (both in Acrobat and PDF-XChange Viewer).} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\texttt{PDFXCview.exe /A "page=10\&zoom=200,250,100" mypdffile.pdf}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/close}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{When this command is used, viewer will close files specified by arguments <filename1>{\dots}<filenameN>. If any of these files was modified, behavior of the viewer depends of command parameter (\textbf{save}, \textbf{discard} or \textbf{ask}). If \textbf{save} parameter was used, documents which should be closed will be saved. If \textbf{discard} was used – all modifications will be lost. And with \textbf{ask} argument, viewer will ask what to do.              If all files opened into the viewer will be closed by /close command, application will be closed too.              \textbf{For  example,}              \texttt{PDFXCView.exe /close c:\textbackslash mydocument.pdf}              \texttt{PDFXCView.exe /close:save c:\textbackslash mydocument.pdf}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{6}{0.13\newtblsparewidth}{\textbf{/print}}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{When this command is specified, PDF file(s) specified by parameters <filename1>{\dots}<filenameN> will be printed. Printing parameters differ depending on arguments used:} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{default=yes|no} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If this argument is used and its value is \textbf{yes}, viewer will reset printing settings before printing documents. Otherwise if the last is used, stored parameters will be applied. Default value: \textbf{yes}.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{showui=yes|no} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Defines if printing progress will be shown. Default value: \textbf{no}.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{printer=<printername>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Specifies the printer on which documents should be printed. If not specified, default system printer will be used. Please note, if printer name contains spaces or \textbf{\&} character, it should be enclosed into quotes.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pages=<pagesrange>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Specifies the pages range(s) which should be printed. Syntax  of range is the same as on print dialog. If argument is omitted, all  pages will be printed.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{For  example,}              \texttt{PDFXCView.exe /print:showui=yes c:\textbackslash mydocument.pdf}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/printto}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Almost  the same command as \textbf{/print}, but destination printer should be  specified not as command argument, but as command line parameter  followed by \textbf{/printto} command.              \textbf{For example,}              \texttt{PDFXCView.exe /printto "Raster-XChange" c:\textbackslash mydocument.pdf}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/exportp}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{This command exports current viewer’s settings into the file specified by setting\_file\_name parameter.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{3}{0.13\newtblsparewidth}{\textbf{/importp}}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{This  command imports viewer’s settings from the file specified by  setting\_file\_name parameter. Please note, all your current settings will  be overridden and lost.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{web=yes|no} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  this argument is used and its value is \textbf{yes}, then imported  settings will be stored into browser-plugins registry location at exit  of the application.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{For  example,}              \texttt{PDFXCView.exe /importp c:\textbackslash mysettings.dat}              \texttt{PDFXCView.exe /import:web=yes c:\textbackslash mysettings.dat}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{filename1, filename2, {\dots} filenameN}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{PDF  file name(s) which should be opened, closed or printed. Please note, if  filename contains spaces, it should be enclosed into quotes ("")} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/RegServer, /UnregServer}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Special commands used for registering and unregistering viewer’s COM interfaces.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{3}{0.13\newtblsparewidth}{\textbf{/makeassoc}}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Makes PDF-XChange Viewer as default PDF-viewer.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{web=yes|no} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  this argument is used and its value is \textbf{yes}, it enables displaying  PDF in Internet browsers by PDF-XChange Viewer.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{For  example,}              \texttt{PDFXCView.exe /makeassoc}              \texttt{PDFXCView.exe /makeassoc:web=yes}} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/makeiassoc}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Enables displaying PDF in Internet Browsers by PDF-XChange Viewer.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/storeassoc}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Stores existing PDF-associated application (if it is not PDF-XChange Viewer) that can be restored in the future.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/restoreassoc}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Restores a previously stored PDF-associated application.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\textbf{/usep}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{Opens  the viewer with the settings from the file specified by  <settings\_filename> parameter.  \textbf{For  example,}              \textbf{relative paths:}              \texttt{settings.dat}              \texttt{mysettings.dat}              \texttt{MyFolder\textbackslash settings.dat}              \textbf{full paths:}              \texttt{"c:\textbackslash PDF-XChange Viewer Settings\textbackslash settings.dat"}              \texttt{"\textbackslash \%UserProfile\%\textbackslash PDF-XChange Viewer Settings\textbackslash settings.dat"}              \texttt{"c:\textbackslash  Documents and Settings\textbackslash \%UserName\%\textbackslash PDF-XChange Viewer Settings\textbackslash settings.dat"}              \textbf{Note:}  If there are no settings (or they are incorrect, or they cannot be  found under the given name), viewer will be opened with the default  ones. While shutting down, viewer will try to save the current settings  to the given direction. If the settings could not be saved, an error  message will be shown.} \\ \hline         \multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{10}{0.13\newtblsparewidth}{\textbf{/runjs}}} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{command scheme:}              \texttt{/runjs[:[newinst[=<yes|no>]][\&showui[=<yes|no>]][\&minui[=<yes|no>]][\&log=[=<yes|no>]]]  <scriptfilename> <filename> [<filename2>{\dots}  <filenameN>]}} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{options:}} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{newinst=<yes|no>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  this argument is used and its value is \textbf{yes}, then application  process will be started for executing this command. If this option is  not specified or its value means \textbf{no}, then the application process  can be used for executing this command.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{showui=<yes|no>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  specified without any value or value means \textbf{yes}, then the  application is displayed with UI. Otherwise this command will be  executed without UI.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{minui=<yes|no>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  \textbf{showui} have been specified before and this option is specified  without any value or the value means \textbf{yes}, then the application  displays minimized UI (like a tab in the task bar).} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{log=<yes|no>} & \multicolumn{2}{|m{0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{If  specified without any value or the value \textbf{means} yes, then the  application creates a log of executing of this command. The log file  "\_RunJSLog.txt" will be placed to our program folder.} \\ \cline{2-4}          \multicolumn{1}{|l}{} & \multicolumn{3}{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}{\textbf{parameters:}} \\ \cline{2-4}      \end{tabularx}


title: ALign the caption of table to the left

text: I have this issue with the caption of a table aligning to the center of the page. I want to align it to the center of the table. How can I do it? ![enter image description here](http://i.stack.imgur.com/hMXAi.png)


title: How to draw a black arrow?

text: How to draw a black arrow , please ? I've tried using this `$\Rightarrow$`, but it wouldn't work properly. Thanks a lot!


title: How can I adjust the position of multiple \vdots after multiple \begin{cases}?

text: Here's a MWE:               \documentclass[12pt]{article}          \usepackage{amsfonts, amsthm, amsmath, amssymb}          %=====          \begin{document}          \begin{multline*}     \\     %     \text{Text}     \begin{cases}     AAA\\      AAA     \end{cases}\\     %     \text{Text}     \begin{cases}     AAA\\      AAA     \end{cases}\\     %     \text{Text}     \begin{cases}     AAA\\      AAA     \end{cases}\\     %     \vdots\vdots\vdots\vdots\\     %     \end{multline*}          \end{document}      I would like to be able to properly align the multiple `\vdots`. I think it would be fine if I could manually adjust the position of the multiple `\vdots`. The first `\vdots` should be aligned with "Text". As regards the rest of the `\vdots`, each should be aligned with one letter A. How can I do this?


title: Embed LaTeX math equations into Microsoft Word

text: Let's say I have a (comparatively) lovely-looking document in LaTeX, full of lovingly typeset, (relatively) complex equations. Now, let's say some Philistines come along one day and decide that the document has to be put into Microsoft Word (2007). ...after the usual mourning period associated with such events, let's say I value my job (more specifically, the bread it provides) enough to get all the text and tables formatted and references organised into the Word document. -...related questions here and here- Now I'm looking at the equations with fear and dread. One option of course is to just lift screenshots from the original document, but this is painstaking if I need to refer to parts of the equation in the text. Also, I might need to edit equations on the fly. **Anyone know of a free application which allows embedding LaTeX math into MS Word?** I've looked at Aurora and TexPoint which do roughly what I want... they build LaTeX images from source and embed them into the Word document, allowing to edit the source later... but both are commerical. ...any help in these troubling times will be greatly appreciated. **EDIT:** Just a note that Aurora offers a 30-day free trial and is working out really nicely... but still, it's not free. Might be a good solution for those with short-term needs, or money.


title: How can I generate some Latex output (equation) to be imported in MS Word?

text: Let's say I want to make a document in Microsoft Word (don't asks why), but for the formulas I want to use LaTeX and then paste it as a picture in my word document, how would I go about doing that? I would prefer not to download programs. Is there just a site where you can type something in LaTeX and just copy it as an image? I'm not a computer expert so if it's easy to do yourself I'd like to hear how to. Sort of like this site only with the ability to make it an image.


title: How do I export LaTeX generated formulas to other documents besides PDFs such as MS-Word?

text: > **Possible Duplicate:**   >  Embed LaTeX math equations into Microsoft Word What I ultimately want to do is take the formulas I made, and use them anywhere, like copy/pasting them into MS-Word, or into Excel, or PowerPoint, or whatever else. (This was what I was trying to do originally). The problem is if I copy/paste from the PDF I made, it will not show up on MS- Word, or it shows up in weird characters. So I was thinking along the lines of an image or something. Either way I don't care how its done, but I would like to grab the nice formulations I generate with MiKTeX, and paste them into documents I have, how can this be done?


title: The easiest way to write TeX in MS Word?

text: Is there some way I can use MS Word with the TeX formulas? On Math.SE I've learned the syntax `$\frac{\partial u}{\partial x}$` etc.. But I do not know how to create a LaTeX document. Is there some way I can use this syntax in MS Word?


title: Mark on document where input starts and what is the filename

text: I have a master document, and use many `input{...}` commands to compile the total document from many parts. I would like to mark on the working document, the start of each new `input`, and, what the filename was at that point. I could renew the `\input{..}` command, but I do not want the mark to disrupt what would otherwise be the standard ouput, ie, the mark should be an underlay / watermark. Is there a package that does this, I am thinking something similar to what the `showkeys` package does. I had the following in mind, to create a label whenever input is used, relying on `showkeys` do do the underlying marking on the document, but it isn't working:               \let\oldinput\input     \newcounter{inputcounter}\setcounter{inputcounter}{0}     \renewcommand{\input}[1]{%         \stepcounter{inputcounter}%         \label{inp:\theinputcounter:#1}%         \oldinput{#1}%     }


title: LaTeX graphic[sx] package with eplain fails with driver dvipdfmx

text: According to UK TeX FAQ, in order to get bounding box support (with `.xbb` and `.bb` files) with dvipdfm[x] and non-eps graphics files, one must specify the driver as in:               \usepackage[dvipdfmx]{graphicx}      Unfortunately this fails with               Forbidden control sequence found while scanning...\newif...      I believe that this is caused by plainTeX's definition of \newif to be "outer". So a few questions:   1. Could this be considered a bug in `miniltx` / eplain?   2. What is the advantage in a package like `graphic[sx]` in using `\newif` in an "inner" way? In other words, is it worth breaking plainTeX to make it usable in an "inner" way?   3. What is the least invasive/easiest way to resolve? For answer to #3, I can only think of doing the following:               % Save the plain format's \newif     \let\plainnewif = \newif          % Re-def \newif without \outer     \catcode`@ = 11     \def\newif#1{\count@\escapechar \escapechar\m@ne       \expandafter\expandafter\expandafter        \def\@if#1{true}{\let#1=\iftrue}%       \expandafter\expandafter\expandafter        \def\@if#1{false}{\let#1=\iffalse}%       \@if#1{false}\escapechar\count@}     \catcode`@ = 12          % latex packages (assumes the use of eplain)     \beginpackages         \usepackage[dvipdfmx]{graphicx}     \endpackages          % Restore plain format's \newif     \let\newif = \plainnewif


title: Can't insert code in my beamer slide

text: I want to put some PHP code in my slide with the package listings but I have this error message:               Argument of \frame has an extra }.<inserted text>\par }      My latex code :               \documentclass{beamer}          \usepackage[utf8]{inputenc}      \usepackage[T1]{fontenc}     \usepackage[frenchb]{babel}     \usepackage{setspace}     \usepackage{color}     \usepackage{listings}          \usetheme{CambridgeUS}               \begin{frame}     \begin{large}         Contexte : \newline \pause     \end{large}          \begin{itemize}         \item Avertir Drupal     \end{itemize}     \begin{lstlisting}          // Gestion du contexte ete2013     // Utilisation d'un nouveau template     if (%variables['ctpage'] == "ete2013") {         variables['template_files']=array('page-ete');     }     \end{lstlisting}     \end{frame}


title: Using mcode within a beamer frame

text: I have a presentation that I would like to include some matlab code in. For that purpose I have included the mcode package, that basically configures the listings package. My problem is that the environment mode does not work inside a frame. When I run the code below as it is (or with article documentclass) everything is as expected.               \documentclass{beamer}     \usepackage[framed,autolinebreaks,useliterate]{mcode}     \begin{document}     %\begin{frame} % code breaks if I include theese     \begin{lstlisting}     for i = 1:3         disp('cool'); % comment with some §\mcommentfont\LaTeX in it: $\mcommentfont\pi x^2$§     end      \end{lstlisting}     %\end{frame} % code breaks if I include theese     \end{document}      If I uncomment the begin/end frame lines I get the following error:               Runaway argument?     ! File ended while scanning use of \lst@next     ! Emergency stop     !  ==> Fatal error occurred, no output PDF file produced!      The same happens if I use `\frame{...}` instead of `\begin{frame}...\end{frame}`.


title: Horizontal Alignment in LaTeX

text: \documentclass[12pt]{article}     \usepackage[paperwidth=8.5in,paperheight=14in,left=1cm,right=1.5cm,top=1cm,bottom=0cm]{geometry} %margins     \usepackage{amsmath,polyglossia,fontspec}     \setmainlanguage{english}     \setotherlanguage[numerals=western]{urdu}     \setotherlanguage[numerals=western]{arabic}     \setmainfont{Times New Roman}     \newfontfamily\urdufont[Script=Arabic,Scale=1.2]{Jameel Noori Nastaleeq}     \newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade}     \parindent=0in % no spacing at the start of paragraphs     \begin{document}     Here is some text in arabic      \\     \hfill     \textarabic{     اَللَّھُمَّ    إِنِّیْ     }     \end{document}      I am trying to start the Arabic from right to left but it seems \hfill is not working. So if there is another way to do this do tell me kindly.


title: acmsmall: accented upper-case characters and line spacing

text: I am currently using the acmsmall document class. I have noticed that upper-case accented characters such as "Å" and "Ä" will result in uneven line spacing. MWE:               \documentclass[prodmode]{acmsmall}     \usepackage[nopar]{lipsum}          \begin{document}         \lipsum[1] \AA test \lipsum[2] \"Atest \lipsum[2]     \end{document}      Moreover, the style enforces the author-year format of citations, which makes it impossible to avoid such characters in running text (some authors happen to have accents in their names). What kind of kludges are available to avoid ugly line spacing in this situation? * * * **Edit:** A related question: Can I somehow easily _find_ all instances of uneven line spacing, other than trying to spot them by staring at the PDF file? For example, can I add some special code in the preamble to make sure that Latex prints a warning whenever there are "too high" characters (or, for example, equations)?


title: Spacing between figures and texts

text: I'm having some issues dealing with figures. It happens that when I have a page with some text and then it comes a figure, with H property, who doesn't fits into the same page as the text, the text itself gets spreaded in that page. ![here](http://dl.dropbox.com/u/5930625/original.jpg). Is there a way I can remove theses spaces? What I'd like is that the end of the page would be left blank (even though some people may not think it is the best thing to do). ![Here](http://dl.dropbox.com/u/5930625/como_quero.jpg) is the image with what I would love to have as the output. Is there any way I can do this?


title: Overfull hbox with British English

text: I write in British English and occasionally I get an overfull hbox warning because LaTeX does not know how to break a word correctly in its British form. For example, the word 'analysing' causes an overfull hbox because LaTeX will not break the word, whereas 'analyzing' is broken into 'analyz-ing' and the hbox warning goes away. what is the best solution to this? Is there a way to have LaTeX recognise British English and correctly break words?


title: Dashed loop in TikZ

text: How can I draw a dashed loop in TikZ? I tried               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}       \node (X) [circle, draw] {X};       \draw (X) to [in=60, out=120, dashed, loop] ();     \end{tikzpicture}     \end{document}      Unfortunately, the `loop` only "listens" to the options `in` and `out`, but not to `dashed`. The resulting loop is not dashed: ![enter image description here](http://i.stack.imgur.com/jZ5B7.png)


title: How can I represent the curved shape of a surface?

text: ![surface](http://i.stack.imgur.com/IqCVg.jpg) How can I give third dimension to the green surface, with shadings of color or light effects, using tikz or pgfplots? The matter is that the green surface looks (is) _flat_ as the red one, while I would like it to look like the plot of an arbitrary real function of two variables (over the domain in red). This is why I also would not mind pgfplots. It does not really matter to see axes in transparency or not. My latest code in Addendum 2. **Addendum** Consider the following picture: ![image 2](http://i.stack.imgur.com/7wKLA.jpg) I would like my green surface to look like the blue one in this latter. I see that the blue surface has a different contour line than the orange one (it is not the same closed curve translated only) and this help rendering "volume". But to change this would not be a problem to me: I would like to understand instead how to shade the green surface in my picture the same way the blue one is in the second image. This second picture is not as good as we can do with TikZ/PGF, but I think the shade of blue is shaped properly to give the idea of curvature. This is what I want to achieve, with any syntax. **Addendum (2)** The following is the best I could do so far (shading method is very weak...). ![image 3](http://i.stack.imgur.com/FxD02.jpg)               \documentclass[border=5mm,tikz=true]{standalone}          \usepackage{tikz,pgfplots}          \usetikzlibrary{decorations.shapes}          \begin{document}          \begin{tikzpicture}[scale=1.25]     \draw [dotted, fill=green!15] plot [smooth cycle] %         coordinates {(-1.14,-1)(-0.84, -.18) (-0.04, 0.3) (2.24, 0) %         (4.48, -0.56) (4.48, -1.46) (3.38,-1.84)(0.38, -1.28)};     \draw [dotted, fill=red!15] plot [smooth cycle] %         coordinates {(-1.04, 1.54) (-0.52, 2.66) (1.22, 3.22) %         (4.48, 2.1)(4.44, 1.14) (3.38, 0.98) (0.84, 2.26)};     %\shadedraw [color=red!15, inner color=red!5, outer color=red!15] (1,3) circle (2mm);     \draw [dotted, fill=red!15] plot [smooth cycle] %         coordinates {(-1.04, 1.54) (-0.52, 2.16) (1.22, 2.72) %         (4.48, 2.1)(4.44, 1.14) (3.38, 0.98) (0.84, 2.26)};     \draw[thick,->] (0,0) -- (-2,-1.5) node[below] {$x$};     \draw[thick,->] (0,0) -- (5,0) node[right] {$y$};     \draw[thick,->] (0,0) -- (0,3) node[above] {$z$};     \filldraw (4.2,3.2) node[left] {$z=f(x,y)$};     \draw [dashed] (3.2,-1) -- (3.2,1.1);     \draw [dashed, lightgray] (3.2,1.1) -- (3.2,2.2);     \filldraw (3.2,-1)circle (2pt) node[left] {$\left(x_0,y_0\right)$};     \filldraw (3.2,2.2)circle (2pt) node[left] %          {$\left(x_0,y_0,f\left(x_0,y_0\right)\right)$};     \end{tikzpicture}          \end{document}      I'll post updates, thank you for any hint.


title: Fancy Table of Contents

text: How can I make a table of contents like the following? ![enter image description here](http://i.stack.imgur.com/VUKzY.jpg) MWE:               \documentclass[10pt,a4paper,openany]{book}     \usepackage{titletoc,xcolor}          \titlecontents{chapter}% <section-type>     [0pt]% <left>     {}% <above-code>     {\fcolorbox{blue}{blue}{\color{white}\bfseries\chaptername~ \thecontentslabel}}% <numbered-entry-format>     {}% <numberless-entry-format>     {\bfseries\hfill\contentspage}% <filler-page-format>          \begin{document}     \tableofcontents          \chapter{First Chapter}     \section{First Section}     \section{Second Section}          \chapter{Second Chapter}     \section{First Section}     \section{Second Section}     sample     \end{document}


title: Setting up a document in Lyx

text: I use Lyx 2.1, document class : report. I want to set the document as follows: font: Times New Roman   size: 12 points   space between the title and paragraph : 6 before and after


title: Rotating (and mirroring) draw lines in a custom node tikz shape?

text: Consider the following MWE:               \documentclass{standalone}          \usepackage{tikz}          \makeatletter     \pgfdeclareshape{circtest}{ %       \inheritsavedanchors[from={rectangle}] %       \inheritbackgroundpath[from={rectangle}] %       \inheritanchorborder[from={rectangle}] %       \foreach \x in {center,north,north east,north west,south,south east,south west,east,west}{ %         \inheritanchor[from={rectangle}]{\x} %       } %       \foregroundpath{ %         \pgfpathmoveto{\pgfpointanchor{\tikz@fig@name}{center}} %         \begin{pgfscope}[ %             rotate=90, % nope     %         rotate around={90:(0,0)}, % nope           ] %           \foreach \angle [count=\xi] in {0,3,...,360} %           {%             \draw[ %               rotate=90, % nope               color=blue!\xi] (\angle:2cm) -- (\angle:3cm);           }         \end{pgfscope} %       } % end \foregroundpath     } %               \begin{document}     \begin{tikzpicture}            \node[circtest] (ctest) at (5,0) {};            \begin{scope}[ %           rotate=90, % ok       %       rotate around={90:(0,0)}, % ok         ] %         \foreach \angle [count=\xi] in {0,3,...,360} %         {%           \draw[ %       %         rotate=90, % ok             color=black!\xi] (\angle:1cm) -- (\angle:2cm);         }       \end{scope}          \end{tikzpicture}     \end{document}      ![test01.png](http://i.stack.imgur.com/jCBE5.png) The black ring is the one in `{tikzpicture}`/`{scope}`, and its coordinate system is rotated, as expected. However, using nearly the same syntax in `\pgfdeclareshape` ends up _not_ rotating the coordinate system - which can be seen on the blue ring, which is a node of the custom `circtest` type. Here basically, I want to specify (eventually) arguments with a dimension of angle, but I'd want my specification of 0 degrees to refer to "12 o'clock", and I'd want the coordinate system to be counterclockwise. I'm aware that in this case, I could just say `\angle+90` inside the `\pgfdeclareshape` \- but I'd rather use something like `rotate=90` inside a scope for legibility reasons. Is there a way I could use such a syntax with a custom, `\pgfdeclareshape`d node?


title: How to have a real random pattern?

text: How to have a new recalculated random pattern ? this one is the same translated everywhere. **Edit** I perfectly understand that the pattern **_is calculated once_** and drawn **_several times after_**. My question is, how to change this : use the mecanism of the pattern to paint an area with, but **_to force a recalculation of the pattern at each drawning_**. For an usual pattern it is useless, but in this case **_one could extract the code and switch the order and insert the pattern calculation and drawing inside the loop that fill the area_** : a sort of pattern-bis that one could use as normal pattern synthax. I don't know Tex progamming enough to do that if it possible. Of course such a work will diserve a bounty ! ![enter image description here](http://i.stack.imgur.com/M5EX0.png)               \documentclass[tikz,margin=3pt]{standalone}     \usetikzlibrary{patterns}          \pgfdeclarepatternformonly{Rnd}     {\pgfpointorigin}{\pgfpoint{1cm}{1cm}}     {\pgfpoint{.5cm}{.5cm}}     {\foreach \i in {1,...,100} {%         \pgfpathcircle{%             %\pgfpoint{.25cm}{.25cm}}{.4pt}             \pgfpoint{rnd*.5cm}{rnd*.5cm}}{.25pt}}         \pgfusepath{fill}     }          \begin{document}     \begin{tikzpicture}          \draw[pattern=Rnd] (0,0) rectangle (5,5) ;     \end{tikzpicture}          \end{document}


title: Can I typeset greek letters in text mode using Latin Modern Fonts?

text: I use lualatex and utf8 source. I want to use the Latin Modern fonts (including math). If I include e.g. the character ε in my source file; it does not appear in the output. I've tried changing the font to TeX Gyre Pagella (with fontspec) and the ε appears as I want. I assume the Latin Modern font I'm using does not support greek characters. Now; obviously someone has created greek glyphs for Latin Modern Math, so I'm surprised the text mode greek letters are incomplete in Latin Modern. Is there anything wrong with doing e.g.               \setmainfont{latinmodern-math.otf}      or some other hacky workaround? Is there just no way of typesetting greek characters in text mode with Latin Modern? I don't want to have to surround _every_ greek letter with $$ (I appreciate the irony of trying to write greek letters with a font that has _latin_ in the name, but I'm surprised the solution isn't more obvious) MWE:               \documentclass{minimal}          \usepackage{fontspec}     \setmainfont{Latin Modern Roman}     \usepackage{unicode-math}     \setmathfont{latinmodern-math.otf}          \begin{document}     This text appears fine.     The following does not, only the capital omega appears: ∆πΩε.     This math does appear as expected, however: $∆πΩε$.     \end{document}


title: How can I make whole document in italics

text: I need to make whole document in italics. May be with few sections in normal font. How to configure the preamble for such thing? I don't want every line/paragraph include in `\textit` or `\emph`.


title: TIPA: suppress tonestembar no longer works in fontspec

text: Most of the features in tipa from TeXLive2009 seem to be part of fontspec in TeXLive2012 -- if you activate both, you get an error message: "Command sups already defined". The following code to suppress the side tonestembars on tone letters worked fine with tipa in TeXLive2009, but no longer works with fontspec in TeXLive2012:               \makeatletter     \renewcommand\@tonestembar{%       \setbox0\hbox{\tipaencoding\char'277}%       \hbox{\vrule height \ht0 depth \dp0           width 0pt}}     \makeatother      You get an error that tonestembar is undefined, and the tonemarks are printed with the sidebar attached. Is there any way of tweaking this code to persuade TeXLive2012 to suppress the tonestembars? **MWE latex (works):**               \documentclass[a4paper,12pt, oneside]{article}          \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage{mathptmx}          \usepackage[tone]{tipa}  %  tone invokes the tone letters     % Fix tonemarks to show marks without sidebars.     \makeatletter     \renewcommand\@tonestembar{%       \setbox0\hbox{\tipaencoding\char'277}%       \hbox{\vrule height \ht0 depth \dp0 width 0pt}} % no stem     \makeatother          \begin{document}          This is an example of the tonemarks without the stembars:          \textbf{babubibuba [~\tone{11}\, \tone{55}\, \tone{33}\, \tone{55}\, \tone{11}~]}          \end{document}      **MWE xetex (doesn't work):**               \documentclass[a4paper,12pt, oneside]{article}          \usepackage{fontspec}     \defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}     \setmainfont{Charis SIL}          % \usepackage[tone]{tipa}  % IPA letters - tone invokes the tone letters     % Fix tonemarks to show marks without sidebars.     \makeatletter     \renewcommand\@tonestembar{%       \setbox0\hbox{\tipaencoding\char'277}%       \hbox{\vrule height \ht0 depth \dp0 width 0pt}} % no stem     \makeatother          \begin{document}     \fontspec[Renderer=Graphite]{Charis SIL}          This is an example of the tonemarks which are showing the stembars in spite of using the suppression code that works in latex:          \textbf{babubibuba [~\tone{11}\, \tone{55}\, \tone{33}\, \tone{55}\, \tone{11}~]}          Changing ``renewcommand'' to ``newcommand'' to get rid of the error message``@tonestembar undefined'' makes no difference.          \end{document}


title: Using “and” instead of ampersand in natbib in-text citations (“\citet”)

text: My bibliography compiles well, excerpt that for multiple authors with in text citations, an '&' is displayed, instead of a required 'and'. All solutions on this site I've found so far have failed. I prefer to maintain present packages; e.g. not Biblatex. My university follows APA-style requirements. Multiple authors citations should thus display '&' only in the bibliography and in parenthetical citations; in text citations use 'and'. For my thesis-document I use the 'Dissertate' class template as found on Github https://github.com/suchow/Dissertate. My bibliography-style is defined as apalike2, with package natbib. NB I Use the latest version (1.6.12) of Texpad as a typesetter. I'm rather novice to TeX but here I try to give a MWE:               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{Dissertate}[2014/01/24 v1.0 Dissertate Class]     \LoadClass[12pt, oneside, letterpaper]{book}     \RequirePackage{hyperref}          \RequirePackage{Harvard}     \renewcommand{\bibnumfmt}[1]{[#1]}     \renewcommand\bibname{References}          %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[School=Harvard]{Dissertate}          @article{YeoM2012,     title={Complex problem solving through Action Learning: Implications for HR development},         journal={International Journal of Human Resources Development and Management},     volume={12},     number={4},     pages={258-273},     author={Marquardt, Michael and Yeo, Roland},     year={2012},     }     \begin{document}          \citet{YeoM2012}          \end{document}


title: moderntimeline gap with color

text: the answer found in moderntimeline - same entry, two time spans help me make a gap in my moderntimeline cv entry. However it does not allow changing the colour as in original tlcventrys I tried modifying by adding **[color1]**               ...     \newcommand{\gaptlcventry}[9][color01]{%     ...      how can I choose the colour of that entry? how can I modify the newcommand define in the linked answer?


title: hyperlinks for tcolorbox

text: I'm trying to get hyperlinks working for tcolorboxes. But when I click on the link in the pdf documents, I'm getting an error on console `Failed to lookup label` error. I tried both phantom and label with tcolorbox. None of them worked. The minimum working code is here.               \documentclass[12pt]{book}     \usepackage{tcolorbox}     \usepackage{hyperref}     \usepackage{lipsum}          \begin{document}          \begin{tcolorbox}[title=Lipsum, phantom={\phantomsection{\label{lipsum}}}]     \lipsum[1]     \end{tcolorbox}          \clearpage     \newpage          Lipsum is \hyperlink{lipsum}{here}     \end{document}


title: Fixed font size and document background alpha channel

text: I am creating an app that shows off some formulas I pre-render with latex on sharelatex.com. ShareLatex gives me the documents as vector pdf's, but I have a problem. Here are some examples of what I have(Yay basic physics): ![enter image description here](http://i.stack.imgur.com/HddwP.png) ![enter image description here](http://i.stack.imgur.com/vu3gY.png) and as you can see, there images does not have the same font size, which makes them look bad on a device when placed next to each other (because they're really uneven) Here is my .tex:               \documentclass[border=5pt]{standalone} %Else some of the characters gets cut off     \usepackage{courier}     \fontsize{10pt}{12pt}\selectfont     \begin{document}          $f=\frac{c}{\lambda}$          \end{document}      The question is: How can I get my latex document formulas to always have the same, fixed, font size, no matter the size of the formula? If not, how can I get a transparent document/no borders, so I can know the original size of the document and up/downscale them after that to fit them to the same size?


title: Subformula numbering problem in ConTeXt

text: The second formula has **no number**. Is it a bug?               \starttext          \startsubformulas[eq:equation]          \placeformula[eq:first]     \startformula         c^2 = a^2 + b^2     \stopformula          \placeformula[eq:second]     \startformula         c^2 = a^2 + b^2     \stopformula          \stopsubformulas          \stoptext


title: Labels do not increment

text: In my document, I have a lot of short case studies, which I would like to number, just like figures. So I am using this:               \subsubsection{Case study \ref{cs:this}: Title}     \begin{figure}     \label{cs:this}      \end{figure}      But this just copies the (sub)section number in the reference. So I have multple "1.1" case studies, etc... I would like them to be numbered X.Y, where X is the section number and Y is the case study number. So for example, in section 1, I would have case studies 1.1-1.10, in section 2 case studies 2.1-2.7, etc... Those case studies can be a part of section or subsection. My secnumdepth is 2. And later I would like to have a list of case studies, where I would include all figures with labels beginning with `cs:`. Is that possible as well?


title: How to format the name of a nomenclature

text: I am using the `nomencl` package to make a list of abbreviations. I would like the name of the nomenclature, "Abbreviations", to be formatted and numbered in the same way as a `\section{}`. For example:               \documentclass{article}          \usepackage{nomencl}     \makenomenclature          \begin{document}          \section{Introduction}          \nomenclature{A}{First one}     \nomenclature{B}{Second one}     \renewcommand{\nomname}{Abbreviations}     \printnomenclature          \section{Methods}     \end{document}      I would like this to produce: * * * 1 Introduction 2 Abbreviations A First one B Second one 3 Methods * * * How can I do that ?


title: Creating a directed graph with some cosmetic structure

text: Via utilizing Tikz, I would like to create a graph such as the following : ![graph](http://i.imgur.com/yF0jxIa.png?1) So I would like to have a classical directed graph, where there is some text in each node. Moreover there is a single frame associated to each node, and the frame is filled with a bunch of bullet points. Additionally, three optional but desired properties:   * Nodes all being the same size. It would also be great if they could hold the text inside of them properly, thus nodes size being adjusted wrt. the node with the largest text.   * Being able to the frame at the desired position of node (See difference between A,C versus B in graph). A set of options like up,down,left,right and the pairwise combinations could suffice instead of coordinates-wise placement.   * Frame size being adjusted wrt. number of bullet points(See varying frame sizes from the graph). With my current knowledge I'm only able to create the generic directed graph consisting of the nodes and the edges. I will try to figure how to achieve all these(assuming there's a way) by reading documentation, however I would highly appreciate if someone can lend a hand.


title: Section title coloring code makes Table of content numbered

text: I was looking for a way to have a colorbox as background of section titles. The following answer that I got on this thread was succesful in doing just that. But it has a side effect that is rather unpleasant, which is to put a number in front on the Table of Contents that corresponds to the section it is now in. For exemple, if I put my table of contents in the Section 3, it will show correctly the list of all section, but "Table of content" is preceded by a "3". If I put it in the Section 4, then it will be preceded by a "4" I think that my program has to do with the way the printing of the colored section title was programmed, but since I am a total beginner, I have a hard time to figure how I could change that and not lose the formatting it provides Here is the code I used. Thanks a lot                   %This is for a section, but you can extend it easily for subsections with a similar scheme:          \documentclass[a4paper]{scrbook}     \usepackage{xcolor,lipsum}     \usepackage{titlesec}          \titleformat{name=\section}[block]       {\sffamily\large}       {}       {0pt}       {\colorsection}     \titlespacing*{\section}{0pt}{\baselineskip}{\baselineskip}          \newcommand{\colorsection}[1]{%       \colorbox{blue!20}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ #1}}}          \begin{document}          \lipsum[1]     \section{This is the title}     \lipsum[2]     \end{document}     %If you want white on colored text, just modify the \colorsection command, for example as          \newcommand{\colorsection}[1]{%       \colorbox{blue}{\parbox{\dimexpr\textwidth-2\fboxsep}{\color{white}\thesection\ #1}}}


title: ylabel style when axis y line=right

text: When I'm using `axis y line=right`, it appears `ylabel style` is not applied, as illustrated by this MWE:               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}     \begin{document}     \Large     \begin{tikzpicture}     \begin{axis}[ylabel={Y label},ylabel style={font=\tiny}]     \addplot coordinates {(0,0) (1,1) (2,2)};     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}     \begin{axis}[ylabel={Y label},ylabel style={font=\tiny},axis y line=right]     \addplot coordinates {(0,0) (1,1) (2,2)};     \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/xXwOm.png) Whereas the `ylabel style` for the left plot is indeed `{font=\tiny}`, this style is not applied for the `axis y line=right` case. Is this by design, or is this a bug? How do I apply a `ylabel style` when I have `axis y line=right`? * * * Excerpt from `pdflatex`'s logfile:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex 2013.4.4)          (...)          Package: pgfplots 2013/03/17 v1.8 Data Visualization (1.8-3-gaf58a29)


title: Small script letter 'f'

text: I am desperately trying to find the following 'script f' glyph (see below) to display on LaTeX but have been failing. Which CTAN package should I install to get this character in math mode?? Many thanks! ![Script f sample](http://i.stack.imgur.com/HMKVY.png)


title: Texmaker: Specifying keyboard shortcuts

text: I like to use the shortcuts `Ctrl`+`Shift`+`=` for `^{}` and `Ctrl` \+ `Shift` \+ `-` for `_{}`. For some reason, when I enter in the key combos for `^{}`, Texmaker reads it as `Ctrl`+`+`, which works fine. However, for `_{}`, `Ctrl`+`Shift` \+ `-` is interpreted as `Ctrl`+`Shift` \+ `_`, which doesn't make sense. It should be like `Ctrl`+`Shift`+`-` (as it was in TexStudio) or `Ctrl` \+ `_`, as it had done with the `+`/`=` key. Is there a way to 'type in' the combination, i.e. write in the keyboard combo instead of having the program grab the keys. I really liked TexStudio for that ability, but it just kept on inserting useless spaces and placeholders for shortcuts.


title: defining a centered shadowboxed listings environment

text: I'm trying to define a environment for code listings wrapped in a shadowbox and centered in the line. Using this code, I can generate the kind of output that I want:               \documentclass[twocolumn]{article}     \usepackage{listings}     \usepackage{fancybox}     \usepackage{lipsum}     \begin{document}     \lipsum[4]     \begin{center}       \shadowbox{%         \begin{lstlisting}[gobble=6]           line of code           line of code         \end{lstlisting}%       }     \end{center}     \lipsum[4]     \end{document}      This produces output like this: ![code listing in a shadowbox in a center environment](http://i.stack.imgur.com/ZsPbr.png) My problem arises when trying to abstract this into an environment. I've seen the some related questions:   * How to center a listing? The answer in this question suggests using `tabular` environment to center the listing, which works, but in the present case, the `shadowbox` serves the same purpose (being just big enough to hold the listing).   * How to center a lstlisting In this question the `tabular` technique doesn't work, but the answer shows how to save the contents of the listing in an `Sbox` (from `fancybox`) and set it in a `parbox` in a `centerline`.   * adjustbox and lstnewenvironment This question actually involves creating frames around listings, and seems to be the most relevant to my question. The answer depends on `adjustbox`, which supports a simple frame, but not the shadowbox from fancybox.   * Why does pdfLaTeX fail when I try to use `begin{lstlisting}` inside a user-defined environment? The answer here points out that it's tough to define environments in which `verbatim`-like environments will appear, and so it's best to use `lstnewenvironment`. Based on these approaches, I've gotten as far as unsuccessfully trying to use `lstnewenvironment`. Just trying to get a centered listing, as below, fails (error message follows):               \documentclass[twocolumn]{article}          \usepackage{listings}     \usepackage{fancybox}     \usepackage{lipsum}     \usepackage{adjustbox}          \lstnewenvironment{CenteredShadowboxListing}[1][]{%       \begin{center}%         \lstset{#1}%       }{%       \end{center}%     }          \begin{document}     \lipsum[4]     \begin{CenteredShadowboxListing}[gobble=2]       line of code       line of code     \end{CenteredShadowboxListing}     \lipsum[4]     \end{document}      This fails with the error:               ! File ended while scanning use of \lst@BOLGobble@.     <inserted text>                      \par      <*> mwe.tex      How can I define an environment that includes a code listing, puts a shadowbox around it, and centers the box?


title: Use LaTeX3 variables within TikZ picture

text: I’m new to LaTeX3 and don’t understand why the following doesn’t work               \documentclass{article}          \usepackage{xparse}     \usepackage{tikz}          \ExplSyntaxOn          \tl_new:N { \g_tobi_color_tl }     \tl_set:Nn { \g_tobi_color_tl } { red }          \tl_new:N { \g_tobi_radius_tl }     \tl_set:Nn { \g_tobi_radius_tl } { 1em }          \NewDocumentCommand { \usevar } { m }      {       \tl_use:c { g_tobi_#1_tl }      }          \ExplSyntaxOff          \begin{document}     Color: \usevar{color}          Radius: \usevar{radius}          \tikz \fill [\usevar{color}] circle [radius=\usevar{radius}] ;     \end{document}      Is it a conflict between L3 and TikZ? And is it possible to fix this? The “classical“ way works fine:               \documentclass{article}          \usepackage{tikz}     \usepackage{etoolbox}          \makeatletter          \def\var@color{red}     \def\var@radius{1em}          \newcommand{\usevar}[1]{%      \csuse{var@#1}%     }          \begin{document}     Color: \usevar{color}          Radius: \usevar{radius}          \tikz \fill [\usevar{color}] circle [radius=\usevar{radius}] ;     \end{document}


title: Report document class with upper right page numbers and modifying chapter title format

text: I'm writing a lengthy masters thesis paper and am requiring some annoying editing of my TeX document. I need to have all of my main headers (table of contents, list of figures, list of tables, bibliography, and chapter headers) to be centered and at the top of their respective pages. Also, I must have the page numbers in the upper right corner of all pages. Unfortunately at the moment I'm not able to do both simultaneously. Here is my MWE:               \documentclass[12pt]{report}     \usepackage{fancyhdr}     \usepackage{setspace}     \usepackage[top=1in,bottom=1in,right=1in,left=1.5in]{geometry}     \usepackage{geometry}     \usepackage{graphics}     \usepackage{graphicx}     \usepackage{float}     \usepackage[hang, raggedright]{subfigure}     \usepackage{amsmath}     \usepackage{xfrac}     \usepackage{indentfirst}     \usepackage{caption}     \usepackage{tabu}     \usepackage{siunitx}     \usepackage[subfigure]{tocloft}     \usepackage{caption}     \usepackage{titlesec}          \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{2}          \renewcommand\cftchapfont{\mdseries}     \renewcommand\cftchappagefont{\mdseries}          \captionsetup[table]{labelsep=space}     \captionsetup[figure]{labelsep=space}          \fancyhf{}     \renewcommand{\headrulewidth}{0pt}     \rhead{\thepage}     \pagestyle{fancy}     \assignpagestyle{\chapter}{fancy}     \setlength{\headheight}{15pt}          \renewcommand{\contentsname}{\hfill {\bf{\large TABLE OF CONTENTS}} \hfill}     \renewcommand{\listtablename}{\hspace{2in}\bf\large LIST OF TABLES}     \renewcommand{\listfigurename}{\hspace{2in}\bf\large LIST OF FIGURES}     \renewcommand{\bibname}{\hspace{2.1in}\bf\large REFERENCES}          \titleformat{\chapter}[display]{\normalfont\Large\bfseries\centering}{CHAPTER \thechapter}{-12pt}{\Large}     \titlespacing*{\chapter}{0pt}{-12pt}{24pt}     \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}          \begin{document}          \tableofcontents     \clearpage     \listoftables     \clearpage     \listoffigures          \doublespacing     \chapter{A Chapter}     some text          \clearpage     some text on another page     \end{document}      This is of course part of a much larger document (my thesis paper is currently 114 pages long...) but here I've included all of my preamble and a small working document to show my problem. If I remove this line:                \titleformat{\chapter}[display]{\normalfont\Large\bfseries\centering}{CHAPTER \thechapter}{-12pt}{\Large}      from the code then I do in fact get a page number in the upper right corner of the page (for just chapter headers), but of course I still need to have my headers centered and at the top. And I'm not sure how to get the table of contents, list of figures, and list of tables at the top right corner of the page. I appreciate any and all help I can get on this matter and please ask if you need more information about my code.


title: Issue with fancyhdr and child documents for KOMA report

text: I have a strange problem with fancyhdr and report (KOMA) together with child documents. Individually for each child document, the headers are like I want them to be, but when I compile them all through my master document, all headers are lost and I am left with the default style (empty header, page number in footer) I have checked that all options are identical for all children and the master. I am using Lyx 2.0.5 and the document class is 'report (KOMA)' for all children and the master. EDIT: Just tried to compile it using the standard 'report' document class and now it worked. This must mean that the problem is related to the KOMA script. This is my preamble               \usepackage[small,bf,margin=10pt]{caption}     \usepackage[dutch,british]{babel}     \usepackage{graphicx}     \usepackage{amsmath}     \numberwithin{equation}{section}     \usepackage{fancyhdr}          \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}     \fancyhead[LO]{\rightmark}          \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}     \fancyhead[RE]{\bfseries \leftmark}          \fancyhead[RO,LE]{\bfseries \thepage}     \renewcommand{\headrulewidth}{0.4pt}      As mentioned, it works fine for the individual documents, but not for the master. Does anyone know what could be the problem?


title: List of Symbols?

text: I'm trying to make a list of symbols that looks a lot like the one shown here But I'm having some trouble making 2 columns that are spaced in that manner for the 2 pages I have for my list. Can anybody give me a quick tip on how I may be able to implement this, while keeping the 2 column format only for these two pages?


title: Image on top of another one in Beamer

text: I am trying to place an image on top of another in beamer. I am using               \documentclass[slidestop,compress,mathserif,12pt,xcolor=dvipsnames]{beamer}     \graphicspath{{images/}}     \definecolor{LHCblue}{RGB}{4, 114, 255}     \usecolortheme[named=LHCblue]{structure}     \usepackage[bars]{beamerthemetree} % Beamer theme v 2.2     \usepackage{kerkis}     \usepackage{multimedia}     \usepackage{subfigure}     \mode<presentation>     %frame     \newcommand*\oldmacro{}%     \let\oldmacro\insertshorttitle%     \renewcommand*\insertshorttitle{%          \oldmacro\hfill%       \insertframenumber\,}%/\,\inserttotalframenumber     \setbeamertemplate{footline}[frame number]     %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     \setbeamercovered{higly dynamic}     \usetheme[watermark=ntua-logo.jpg]{Ilmenau} % Beamer theme v 3.0     \useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top          \useinnertheme{circles} %rectangle bullet points instead of circle ones     \usepackage{beamerthemebars}     \setbeamercolor{navigation symbols dimmed}{fg=red!80!black}     \setbeamercolor{navigation symbols}{fg=red!80!black}     %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     \title[July 2012 H4 Test Beam\hspace{3cm} Stony Brook, NYC]{July 2012 H4 Test Beam}     \author[Stamatopoulos N. Athanasios\hspace{2.5cm}{athanasios.stamatopoulos@cern.ch}]            {Stamatopoulos N. Athanasios}     \institute{NTUA/CERN}     \logo{%       \makebox[0.99\paperwidth]{%         \includegraphics[width=1cm,keepaspectratio]{cern_logo_white.jpg}%         \hfill%         \includegraphics[width=1cm,keepaspectratio]{ntua-logo.jpg}%       }%     }          \usepackage{textpos}     \usepackage{tikz}     \usetikzlibrary{%     calc,%     fadings,%     shadings%     }          \usetikzlibrary{arrows,snakes,shapes}     %\usepackage{enumitem}     %\usepackage{paralist}           \begin{document}          \begin{frame}     %\uncover<1->{\begin{figure}     %  \begin{center}     %    \includegraphics[width=10cm]{layers1}     %  \end{center}      %\end{figure}}     %\hspace{-15cm}     %\uncover<2->{     %\begin{figure}     %  \begin{center}     %    \includegraphics[width=10cm]{layers}     %  \end{center}      %\end{figure}}     \hspace{-15cm}     \begin{figure}         \centering         \uncover<1->{\includegraphics[width=10cm]{layers1}}%         \llap{\raisebox{0cm}{%  move next graphics to top right corner          \uncover<2->{ \includegraphics[width=10cm]{layers}}%         }}     %    \caption{My overlay figure.}       \end{figure}       \end{frame}          \end{document}      ![](http://i.imgur.com/DBRAL.png) I also tried using just the `figure` enviroment with `\hspace{}` between two images but it didn't work.{Code in comment}


title: How to place a node of a certain shape with one side on a line in TikZ

text: I would like to have an arrow shaped node to be positioned with its tail on the vertical axis of my reference frame. Here' were I got:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.arrows}     \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}     \draw [->] (-2.5,0) -- (2.5,0) node [below] {$\theta$};     \draw [->] (0,-.5) -- (0,3) node [left] {$f$};     \draw [->,thick] (1.5,0) node [below] {$t$} -- (1.5,1.5);      \node [single arrow,draw=none,fill=black!20] at (0,2)  {\tiny{\texttt{Integration interval}}};     \end{tikzpicture}     \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/1KLj8.jpg)


title: Remove space before colorbox

text: I've made the command               \newcommand{\pink}[1]{\colorbox{red!20}{#1}}      to highlight in pink. It works fine for words and sentences, but if I want to highlight a subpart of a word, e.g.               laugh\pink{ing}      it adds a space before ing (this is for a linguistics lecture) Is there any way to override this?


title: Problems in suppressing "series" field

text: I can't manage to suppress the field "series" with biblatex. I get the error:               ERROR: Package keyval Error: series undefined.      This is my code:               \usepackage[         backend=bibtex,         series=false,         isbn=false,         url=false,         doi=false,         eprint=false,     ]{biblatex}


title: Using "listings" package to colorize the source code of ANTLR grammar file?

text: I use `listings` package in my diploma thesis for source code. Besides the mainstream languages like Java and C# I also need to include the sources of the language grammars (.g) which are pure mark-up languages in the following format:               options {         language=Java;         //backtrack=true;         // please comment it in for correct lexer generation!         // the definitions of many operators require backtracking!     }                // program blocks          program         : (declaration)+         ;          declaration          :  metaDeclaration         |  actionDeclaration         |  globalDeclaration         |  eventDeclaration          ;             metaDeclaration         : 'meta' metaParam STRING? ';'         ;          metaParam          : 'version'         | 'name'         | 'icon'         | 'color'         | 'private'         ;          globalDeclaration         : 'var' varIdentifier ':' typeIdentifier             codeblock         ;      What I want to reach is the following (or similar) colorizing of my code (see picture): ![ANTLR highlighing](http://i.stack.imgur.com/uz6bR.jpg) How can I do it? Is there any preset language template I could use? **EDIT** : I am aware of how to add own languages by adding new keywords and color rules. What I am missing are the following:   1. How to set the lines beginning with double slash to be commentaries (probably take C template?)    2. All strings should be green. String are character sequences beginning and ending with single quotes, like in the example above. The content doesn't matter and should be always colored with one color.   3. All literals should be dark blue. Literals are non-strings written completely in upper case (see "STRING" in my code)   4. Options should be black. Those follow the following pattern: text followed by curly brackets, in curly brackets the parameters are assigned as "param = value" (see options)   5. Everything that doesn't fit the above rules should remain magenta (= rules, many examples above). I have an idea how to accomplish the first point, but I need help with the rest of customization.


title: Problem with ToC in LyX

text: I'm writing my thesis on LyX. My ToC looks like this: ![enter image description here](http://i.stack.imgur.com/oQJ8o.png) Why are sections and sub-sections page numbers not aligned on the right but below each entry? I'd like to have them aligned on the right and I'd also like to have dotted lines.               \documentclass[12pt,a4paper,english]{article}      \usepackage[T1]{fontenc}      \usepackage[latin9]{inputenc}      \setcounter{secnumdepth}{2}      \setcounter{tocdepth}{2}      \usepackage{setspace}      \onehalfspacing          \makeatletter     \pdfpageheight\paperheight      \pdfpagewidth\paperwidth          \date{}     \makeatother     \usepackage{babel}           \begin{document}          \tableofcontents{}              \section{\textit{Introduction}\protect \\ }              \section{\textit{Literature review}\protect \\ }              \subsection{\textit{Optimal Corporate LP}\protect \\ }      \end{document}


title: Weird behavior when using small caps and slanted fonts with fontspec in XeLaTeX

text: I use XeLaTeX and the `fontspec` package. Now, I like to use Linux Libertine as standard font. The slanted (not italics) characters are stored in a different font. Now, to use them with `\slshape`, I have to select them explicitly:               \setmainfont[         SlantedFont={Linux Libertine Slanted O},         SmallCapsFeatures={Letters=SmallCaps},         Mapping=tex-text, Numbers=OldStyle, Variant=01, Ligatures={TeX, Common}, Contextuals=WordFinal,         % Style=Alternate, Ligatures={Rare, TeX, Common}                 ]{Linux Libertine O}      As you can see, the slanted font is selected in the `SlantedFont={Linux Libertine Slanted O}` argument. When I use `\slshape` in my document now:               {\slshape \lipsum[1-2]}      It creates the correct slanted text. _(`\usepackage{lipsum}` is further up in the file.)_ Now, when I want to use small caps I use `\scshape`:               {\scshape \lipsum[3-4]}      The text is slanted small caps! To circumvent this, I have to comment out the `SlantedFont` argument in `\setmainfont`, this makes the small caps upright, but I lose slanted text capabilities. How do I make both behave corectly?


title: \usepackage{lmodern} changes textcomp's \textbullet and \textopenbullet in a beamer file

text: I use `\textbullet` and `\textopenbullet` (from textcomp package) in a beamer file. It gives just what I expect: ![enter image description here](http://i.stack.imgur.com/Fts3U.png) However, when I add the lmodern package in the preamble (to avoid font warnings and discrepancies), it changes into some ugly squares: ![enter image description here](http://i.stack.imgur.com/24ACA.png) Is it possible to use lmodern AND get nice bullets? MWE:               \documentclass[10pt]{beamer}          \usepackage{lmodern}     \usepackage{textcomp}          \begin{document}     \begin{frame}     \frametitle{MWE}     \textbullet\textopenbullet     \end{frame}     \end{document}


title: makeindex - sorting by page number

text: I'm trying to create an index of notation for my paper. I'd like to sort the index items chronologically by order of appearance. In other words, if I have the symbol `$Z$` occurring on the second page, the symbol `$C$` on the `8th` page and the symbol `$P$` on the last page I would like the index to appear as               Z, 2      C, 8     P, 97      Do you know how to do it automatically?


title: Adding word 'Table' before each entry in list of tables

text: I need to prefix each entry in list of tables and figures with appropriate text - table or figure for each. Also I need to remove chapter numbers from list, because tables are numbered consequently through the whole report. I managed to do everyting I need with this simple commands:               \renewcommand{\thetable}{\arabic{table}}     \renewcommand{\thefigure}{\arabic{figure}}          \makeatletter     \providecommand\phantomsection{}% for hyperref          \newcommand\listoftablesandfigures{%         \chapter*{List of Tables and Figures}%         \phantomsection     %\addcontentsline{toc}{chapter}{List of Illustrations}%     %\section*{Figures}%     %\phantomsection     %\addcontentsline{toc}{section}{\protect\numberline{}Figures}%     \@starttoc{lof}%     \bigskip     %\section*{Tables}%     %\phantomsection     %\addcontentsline{toc}{section}{\protect\numberline{}Tables}%     \@starttoc{lot}}     \makeatother      Now only one thing remains: to be consistent with text in list of tables and figures.


title: "Table"/"Figure" in items of List of tables/figures

text: > **Possible Duplicate:**   >  Adding word 'Table' before each entry in list of tables Hello guys the list of figures and tables in my thesis is listed as (I use `\listoftables` and `\listoffigures`)               Table          1.2 Name1                 But I want it to be like               Table           Table 1.2 Name1                 I appreciate any help.


title: How do I control the space between the figure number (or table number) and the caption on the list of figures (list of tables) page?

text: On my list of figures and list of tables pages there is no space between the figure number (or table number) and the caption. I would like to control this spacing. I would also like to control the alignment of the caption. So if the caption runs into other lines then these should be aligned with the first line. How can I control these?


title: Use letter environment in memoir documentclass

text: I'm typesetting a novel that includes correspondence between characters. For the overall book, I'm using the `memoir` documentclass. To typeset the correspondence, however, I'd like to use the letter environment (or something equivalent) because of the built-in macros such as `\address` and `\signature`. But the letter environment doesn't seem to be defined outside the letter document class. Short of re-defining the letter environment, is there a recommended way to typeset these correspondences? Many thanks in advance for any help you can offer.


title: Need for loading of expl3 code?

text: Consider the following example:               \documentclass{article}          \usepackage{pst-plot}     \usepackage[locale=DE]{siunitx}          % Self-brewed macro.     \def\andel#1{%       \calculate{#1/(\Nord+\MidtVest+\Oestjylland+\Syd+\Fyn+\Oest+\Bornholm+\Lorry)*100}     }     \def\seere#1#2{%       \psframe[dimen=middel,fillstyle=solid,fillcolor=red!45]%         (!2 #1 mul 1 sub \bredde 2 div sub 0)%         (!2 #1 mul 1 sub \bredde 2 div add #2)       \rput(!2 #1 mul 1 sub #2 5 add){\scriptsize\num{#2 000}}       \rput{90}(!2 #1 mul 1 sub #2 2 div){%         \scriptsize\SI[round-mode=places,round-precision=1]{\andel{#2}}{\percent}%       }     }          % PSTricks stuff from Herbert.     \makeatletter      \def\pst@@@vlabel#1{%        \edef\@xyDecimals{\psk@yDecimals}%        \ifodd\psk@labels % labelss=all||y (0,2)        \else%          \ifnum#1=0 \psvlabel{\expandafter\@LabelComma#1..\@nil}%          \else \psvlabel{\expandafter\@LabelComma#1..\@nil\psk@ylabelFactor}%          \fi        \fi%     }%     \makeatother          % LaTeX 3 syntax.     \ExplSyntaxOn       \cs_new_eq:NN \calculate \fp_eval:n     \ExplSyntaxOff          \begin{document}          \begin{figure}     % Column width.     \def\bredde{0.7 }     % Constants.     \def\Nord{86}     \def\MidtVest{87}     \def\Oestjylland{107}     \def\Syd{147}     \def\Fyn{102}     \def\Oest{125}     \def\Bornholm{16}     \def\Lorry{210}      % Settings.      \centering      \psset{xunit=0.56cm,yunit=0.04cm}       % Drawing.       \begin{pspicture}(-2.5,-42)(19.1,238)        \psaxes[          xAxis=false,          Dy=20,          dy=20,          ylabelFactor={\cdot 10^3}        ]{->}(0,0)(16,230)        \psaxes[          yAxis=false,          ticks=none,          mathLabel=false,          xLabels={           ,Nord,           ,Midt-Vest,           ,{\O}stjylland,           ,Syd,           ,Fyn,           ,{\O}st,           ,Bornholm,           ,Lorry,          },         xLabelsRot=90        ]{->}(0,0)(16,230)[Tv-stationer,0][Seere,90]        \multido{\i=20+20}{11}{\psline[linestyle=dotted](0,\i)(16,\i)}        \seere{1}{\Nord}        \seere{2}{\MidtVest}        \seere{3}{\Oestjylland}        \seere{4}{\Syd}        \seere{5}{\Fyn}        \seere{6}{\Oest}        \seere{7}{\Bornholm}        \seere{8}{\Lorry}       \end{pspicture}     \end{figure}          \end{document}      ![output](http://i.stack.imgur.com/SEqKt.jpg) Is it possible to make the calculations in the `\andel` macro and use it in the `\SI` macro without having to load the following code?               \ExplSyntaxOn       \cs_new_eq:NN \calculate \fp_eval:n     \ExplSyntaxOff


title: Problem with XeLaTeX and Devanagari font

text: I am writing a document in Devanagari. I am using Google's newly released font: http://www.google.com/get/noto/pkgs/NotoSansDevanagari-hinted.zip   I used the following code sample to incorporate that font into my document; however, the compound letters in Devanagari (e.g. प्र, श्र) seem to be broken. The same compound letters can be written in the same font outside LaTeX document perfectly fine.   Here is my sample code:                   \documentclass{article}         \usepackage{fontspec}         \usepackage{xunicode}         \usepackage{xltxtra}         \usepackage{titlesec}         \usepackage{polyglossia}         \newfontfamily\devanagarifont[Script=Devanagari]{Noto Sans Devanagari}         \newfontfamily\englishfont[Script=Latin]{cmr10}              \setmainlanguage{sanskrit}         \setotherlanguages{english}              \begin{document}         \section{प्रतिक्रिया}         श्र क्र प्र              \end{document}         This results in such a garbled output: ![enter image description here](http://i.stack.imgur.com/lpq7A.png)    These letters are rendered properly in LaTeX if I use other Devanagari fonts (e.g. Lohit Hindi, Nakula). Can someone explain me how to render these letters in Noto Sans itself?


title: Install separate packages latex

text: i'm starting to use latex, but i'm confusing about install it. I know its not an application but how in others computers languages, there is a way to install separated programms like only the compiler to .dvi or only pdflatex? because when i install tex live it's install a lot of other programs.


title: Using \maketitle twice in the same article

text: I need to write a single, short PDF file that contains two distinct parts. I don't want to mess with PDF joins and hacks, as I need both parts to share page numbers, citations, etc. However, I want to use an article-like style for the sections and so on - A report style is an overkill. Is there a way to run `\maketitle` twice on the same document? Without additional hacks it yields no result (since that it is redefined to `\relax` after the first expand).


title: Check if LuaTeX is running

text: I want to check if my tex document is compiled with LuaTeX (or any other Lua TeX compiler). The simple approach from the TeXbook is to check the `\directlua` macro against `\@empty`, like               \ifx\directlua\@empty{\errmessage{...}}\fi      If I'm running `luatex`, everything is fine. If I run `tex`, the compilation fails with my `\errmessage` \-- fine. But if I run `latex`, my error does not occur, but the compilation fails because of the undefined `\directlua` environment. Which `\ifx` statement works for all TeX dialects? And why not the one which works fine with plain TeX, the one from above? Thanks in advance :) **UPDATE** An solution for this is very easy, but I don't know if it's causing any problems in the future.               \ifx\directlua\pgf@gd@undefined@donotuse{%       \errmessage{an error}\fi      works well with TeX and LaTeX. Is there a way which is more elegant and doesn't need any additional packages? Otherwise I will post this as answer.


title: Escaping square braces

text: I want to use some text as the optional parameter to some command. The text includes square braces (`[` and `]`), but since the optional parameter goes within square brackets, unexpected things happen. **More info:** I want an itemized list whose bullets are citations like [GMR85]. I used this command:               \begin{itemize}       \item[[GMR85]] ...     \end{itemize}      but it takes the first `]` as the end of optional parameter. Any way to escape `]` ? **Edit:** I specially want this to work in `beamer`. My current result is like: ![](http://i.stack.imgur.com/Tqws3.png) Note how `]` is not included the label. ## EDIT 2 This _bug_ has been solved in the latest versions of `beamer`.


title: Does TikZ use the same internal mechanism as PSTricks to produce vector based pdf outputs?

text: Currently I am using PSTricks. From this forum, I see many people using TikZ. I have done a little exploration that TikZ can produce vector images in PDF format only in one step using pdftex. To produce the same vector images in PDF, PSTrick must be compiled in 3 steps, i.e., latex -> dvips -> ps2pdf. According to The current state of the PSTrick project: > TeX as a typesetting machine cannot make full use of the possibilities of > PostScript. There cannot be a direct interaction between TeX and PostScript; > it is more of a one way communication from TeX to PostScript. The interface > between these two systems is the DVI converter dvips which converts the DVI > output of TeX into the PostScript format. Here we use DVI output only as an > intermediate format; it is not really of interest. On the TeX side the user > has to reserve some space (a box) which is filled on the PostScript side > with a graphic or some text. If this space is not reserved the everything > will be printed over the text, depending on the current point before the > PostScript-related code. This PostScript code must be transferred from TeX > via the DVI output with the macro \special. Its contents are ignored by TeX > and passed to PostScript where it will be executed by a PostScript > interpreter such as GhostScript or Distiller. From the quote, PSTricks need an intermediate phase,i.e., using DVI output. Shortly speaking, this intermediate output forces PSTrick to be compiled using 3 steps. If Tikz using the same internal mechanism as PSTrick does, why TikZ can be compiled in 1 step?


title: Replace paragraphs with boxes

text: I would like to replace the paragraphs of a compiled document with framed boxes. Although I read the /tex/latex/base documentations I have no idea how to tackle this problem. In detail I want to implement the following:   * Given an arbitrary .tex file as input.   * Output a compiled document where all paragraphs are replaced by framed boxes of their respective sizes and the actual sizes are written to a secondary file. My questions/uncertainties would be   1. As this system must not require user interaction to change the .tex input, I cannot rely on additional user commands. Forcing the user to add a command around each paragraph is not possible.   2. Furthermore, there are no commands around paragraphs that I can substitute with a command redefinition. Thus I cannot use the method that the 'draft' options use.   3. The box sizes depend on the actual output of the compilation and I am not sure if document classes even have the ability to access this information.   4. Can someone give me hints on how to start tackling this problem? Additional questions (which are not so important but related):   * Can the same be done for every line to output a document where each line is a framed box?   * In the end I would like to have the following: For an arbitrary .tex file as input I generate another .tex file where all paragraphs are substituted with box commands and the compiled output of both .tex files (when using the paragraph to box method) should look the same.


title: Why do font substitutions need to happen even with vector fonts?

text: I often get warnings saying `Size substitutions with differences up to ... have occurred`, even while using fonts like Palatino, which as far as I understand are defined to be arbitrarily scalable. Why do such substitutions happen at all? Also, is there a systematic way of figuring out which variation of the font is causing the problems, and to manually force the compiler to include the correct sizes? I have very basic knowledge about how fonts are handled in the TeX backend, so if my questions don't make sense at all, please feel free to enlighten me. **Edit:** I am not looking for a way to make the warnings go away on any particular document I compile. As long as the result looks correct, I usually ignore all such warnings. I am just trying to understand why this happens, even when using a package like `mathpazo`. If it's still helpful, I have provided an MWE created from the last document I encountered this in.               \documentclass{article}     \usepackage{mathpazo,amsmath,stmaryrd}     \begin{document}     $\text{$a$}$     \end{document}      From the answers already given, I would guess that some macro somewhere ends up using a bitmap font.


title: How does the LaTeX compile chain work exactly?

text: This might be a simple or out of place question, but I have run into so many subtleties of document compilation, that I really just need to understand this from the ground up. **Could someone please explain to me what a standard LaTeX compile chain / chain of events / latex make works? I'd also like to know where font-loading fits in, when tikz gets run, labels get assigned, why pdflatex vs latex etc.** I've seen some online references to 2 * latex, 1 * bibtex, 1 * latex, but I'm looking for a diagram to explain to me how this works, or a reference that explains this in-depth, so I can debug this myself on the command line, instead of being annoyed by an editor with insufficient error message (Process started,Process exited with error(s)) **This may sound like a very basic question, but I need an answer - as trying to fix this caused almost a day of writing downtime that could hopefully be avoided in future, if I had a causal chain I could check.** My apologies for not doing everything through the CLI to begin with.


title: Edged arrows with tikz-qtree

text: I've seen this nice little example tree drawn with LaTeX, afaik not tikz. Can I draw similar arrows with tikz-qtree by specifying start and end point only? ![example tree](http://i.stack.imgur.com/HfCaR.png)


title: \usepackage[group-separator={,}]{siunitx} Not working with longtable?

text: I have a table with very long counts (in the millions), so I would like to add commas. I have tried to use `siunitx` in a variety of ways in the preamble:   1. `\usepackage[group-separator={,}]{siunitx}`   2. `\usepackage{siunitx} \sisetup{group-separator={,},group-minimum-digits={3},output-decimal-marker={.}}`   3. `\sisetup{ group-digits=true, group-separator={\,}, } \pgfkeys{/pgf/number format/.cd, set thousands separator={\,}}%` But none of these insert the commas. Could the problem be that I am using `longtable`? When I specify \number{} around each table item, the commas are inserted, but there are too many tables to do this manually. Here is an example:               \documentclass[12pt]{article}      \usepackage[group-separator={,}]{siunitx}     \usepackage{lscape,longtable}     \begin{document}     \begin{center}     {     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \begin{longtable}{l*{3}{cc}}     \hline\hline\endfirsthead\hline\endhead\hline\endfoot\endlastfoot                 &\multicolumn{2}{c}{Managed Care}&\multicolumn{2}{c}{No Managed 1Care}&\multicolumn{2}{c}{Total}\\                 &       Count&          \%&       Count&          \%&       Count&          \%\\     Adult       &     7178237&        23.0&     6715828&        37.5&    13894065&        28.3\\     Aged        &     1278137&        49.5&     3482900&        58.3&     4761037&        55.7\\     Child       &    20562118&        60.9&     7015119&        29.4&    27577237&        47.8\\     \end{longtable}     }     \end{center}     \end{document}


title: Using Multibib with Beamer

text: For the defense of my PhD, I have to finish my presentation with a complete list of my publication. In the manuscript, I used the multibib package to generate automatically the list and it works fine. Now when I am using it in Beamer, it get a bit lost but it is understandable as you might see below. ![Example on the literature slide](http://i.stack.imgur.com/ZofoY.jpg) What I expect from the package was to generate its own slide/title instead of a section and paste the proper bibliography instead of just damping everything on the slide and create some empty section. Again I understand this behaviour, but I want to know if there is a workaround or another way to generate my list of publications. Here is the code I used:               \documentclass[pdf,10pt,xcolor=table]{beamer}          \usepackage[square]{natbib}     \usepackage{multibib}     \newcites{pub}{{Journal}}     \newcites{confintwith}{International conferences with lecture committee}     \newcites{confint}{International conferences without lecture committee}     \newcites{confnat}{National conference with lecture committee}          \begin{document}          \section{Summary and Perspectives}          \begin{frame}[t,allowframebreaks]         \frametitle{List of publications and conferences}         \scriptsize         \nocitepub{Bontemps2013}         \bibliographystylepub{abbrvnat}         \bibliographypub{Chapter/Bibliography}              \nociteconfintwith{Paquet2013, Vanneste2012b, Vanneste2012a, Bao2011c, Vanneste2011a, Bao2011b, Vanneste2010}         \bibliographystyleconfintwith{abbrvnat}         \bibliographyconfintwith{Chapter/Bibliography}              \nociteconfint{Bontemps2011b, Bontemps2011a}         \bibliographystyleconfint{abbrvnat}         \bibliographyconfint{Chapter/Bibliography}              \nociteconfnat{Vanneste2011b}         \bibliographystyleconfnat{abbrvnat}         \bibliographyconfnat{Chapter/Bibliography}     \end{frame}          \end{document}      Any suggestions?


title: Hyperlinks to enumeration numberings

text: I have a list               \begin{enumerate}     \item This is the first post     \item This is the second post     \end{enumerated}      And I want to add hyperlinks to the numberings within a box. The simplest approach can be using my own numbering (using a counter, or manually)               \boxed{ \href{www.google.com}{1} } This is the first post     \boxed{ \href{www.google.com}{2} } This is the first post      But with this structure, I lost the indentation that "enumerate" presents. How can I preserve the indentation ![enter image description here](http://i.stack.imgur.com/p4OER.png)


title: Random ink blotches from tikz

text: ![enter image description here](http://i.stack.imgur.com/yTwD0.jpg) How can I create this type of effect in tikz, random ink spots from a fountain pen, for a watermark on select feature pages.


title: Table of Contents Font Size Change

text: I am in the final stages of writing my dissertation and right now, I am trying to make my dissertation to match the graduate school standards. One of the issues that I am currently struggling with is the way the Table of Contents and List of Figures of my dissertation look like. For some reason, the font size of these two parts is larger than the rest of my document. I know similar questions have been asked on here but the proposed solutions don't seem to help my case. I have two questions: **First Question** How can I change the font size of the Table of Contents title, _i.e._ , the term "Table of Contents"? (Similar question for List of Figures too) I have to add that for this question, I found the term "Table of Contents" in the style file and tried to insert a `\small` term in front of it. This changes the font size but it prints the title as `=Table of Contents` and I am not sure how to remove to equal sign. **Second Question** How can I change the font size of the entries of the Table of Contents and List of Figures sections? I have put the Style file here for you to see: http://pastebin.com/2NP9Jbci


title: apacitex bibliography stile does not show citations properly

text: I'm trying to use apacite to manage my references style. I'm satisfied with the style of the bibliography, but not the citations. They appear as a number between square brackets, which is not, by any means, close to the APA citation style. How am I supposed to get the citations to appear as actual APA-style ones? There is also something weird which may be relevant, and it's that the only commands I can use for citations are \cite and \citep (which both result in the output describred earlier) - if I try to use \citeA, the references are taken as error because of, supposedly, not being defined. This is how I'm setting it up:               \usepackage[index]{apacite}     \bibliographystyle{apacitex}      I am using pdfLatex as compiler on ShareLaTeX.


title: Table of Descriptions

text: I'd like to display a list of descriptions, similar to a TOC, LOF or LOT. How would I do this? Maybe using the `tocloft`-package?


title: Problem with Table Vertical Alignment

text: I want a table whose first column is aligned top, second column is aligned middle, and third column is aligned bottom; like this: ![](http://i.stack.imgur.com/S0duM.png) I wrote the following code:               \documentclass{article}     \usepackage[english]{babel}     \usepackage{array}          \begin{document}          \begin{tabular}{| p{1cm} | m{1cm} | b{1cm} |}         \hline         x &         A long text comes here &         x \\         \hline     \end{tabular}          \end{document}      Yet, to my surprise, the outcome was "all columns aligned middle," as follows: ![](http://i.stack.imgur.com/JVWqV.png) What did I do wrong?


title: tkz-eucide's tkzDrawArc is not cooperating with me

text: I would really like to set my points as I've done in the following example:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{tkz-euclide}     \usetkzobj{all}     \pagestyle{empty}          \begin{document}          \begin{tikzpicture}            \coordinate (Q) at (0,0);       \coordinate (P) at (1.25in,0);       \coordinate (A) at (4in,0);            \tkzDrawPoints(Q,P,A)       \tkzDrawCircle(Q,P)             \tkzDrawSegment(Q,A)       \tkzDefMidPoint(Q,A)  \tkzGetPoint{M}       \tkzDrawPoint(M)            \tkzDefPointBy[rotation=center M angle  90](A)  \tkzGetPoint{uM}       \tkzDefPointBy[rotation=center M angle -90](A)  \tkzGetPoint{nM}            \tkzDrawSegment(uM,nM)       \tkzLabelPoints[left](uM,nM)            \tkzSetUpCompass[color=orange]       \tkzDrawArc[delta=10](A,uM)(uM)          \end{tikzpicture}               \end{document}      However, `\tkzDrawArc` generates an error with the above approach:               ! Missing number, treated as zero.     <to be read again>                         \pgfmath@atan@1001      l.30   \tkzDrawArc[delta=10](A,uM)(uM)          ?       If I use the following MWE, everything compiles fine:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{tkz-euclide}     \usetkzobj{all}     \begin{document}            \begin{tikzpicture}              \tkzDefPoint(0,0){Q}         \tkzDefPoint(1.25,0){P}         \tkzDefPoint(4,0){A}              \tkzDrawPoints(Q,P,A)         \tkzDrawCircle(Q,P)               \tkzDrawSegment(Q,A)         \tkzDefMidPoint(Q,A)  \tkzGetPoint{M}         \tkzDrawPoint(M)              \tkzDefPointBy[rotation=center M angle  90](A)  \tkzGetPoint{uM}         \tkzDefPointBy[rotation=center M angle -90](A)  \tkzGetPoint{nM}              \tkzDrawSegment(uM,nM)         \tkzLabelPoints[left](uM,nM)              \tkzSetUpCompass[color=orange]         \tkzDrawArc[delta=10](A,uM)(uM)            \end{tikzpicture}               \end{document}      But then my points `Q`, `P`, and `A` are not placed as I _need_ them to be. I would prefer not to have to use `\tkzDefPoint` to define these three points. Could someone suggest a work around? I've tried the following, but it also fails:               \coordinate (Q) at (0,0);     \tkzDefPoint(Q){Q}      _UPDATE_ Interestingly enough, the following seems to get things to work:               \coordinate (uM) at ($(uM)+(0,1pt)$)      but               \coordinate (uM) at ($(uM)+(0,0)$)      fails. I'm not so concerned with any particular position for points `uM` or `nM` (other than that they lie on the perpendicular bisector of segment `QA`), but I'm very curious why what works works and why what fails fails.


How to disable pagebreak on \hline in longtable? This is an example illustrating my problem:               \documentclass[12pt,a4paper,oneside]{letter}          \usepackage{longtable}          \begin{document}          \begin{longtable}{ | p{5cm} | }     \hline     Table header\\*     \hline     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pharetra     porttitor turpis, id egestas neque congue in. Nam sed lorem lorem, ac     tristique tellus. Nunc ornare feugiat orci, a blandit turpis facilisis ut.     Aenean pharetra ornare ante. Sed tempus leo in dolor eleifend placerat.     Integer at enim augue. Ut nisl tortor, interdum ac porttitor ac, sagittis     quis libero. Vivamus nibh metus, ornare vel pulvinar nec, fringilla nec     orci. Maecenas mollis nulla a nibh fringilla nec convallis augue varius.     Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere       cubilia Curae. \\     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pharetra     porttitor turpis, id egestas neque congue in. Nam sed lorem lorem, ac     tristique tellus. Nunc ornare feugiat orci, a blandit turpis facilisis ut.     Aenean pharetra ornare ante. Sed tempus leo in dolor eleifend placerat.      Integer at enim augue. Ut nisl tortor, interdum ac porttitor ac, sagittis     quis libero. Vivamus nibh metus, ornare vel pulvinar nec, fringilla nec        orci. Maecenas mollis nulla a nibh fringilla nec convallis augue varius.       Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere       cubilia Curae. \\     \hline     Table header\\*     \hline     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pharetra     porttitor turpis, id egestas neque congue in. Nam sed lorem lorem, ac        tristique tellus. Nunc ornare feugiat orci, a blandit turpis facilisis ut.     Aenean pharetra ornare ante. Sed tempus leo in dolor eleifend placerat.        Integer at enim augue. Ut nisl tortor, interdum ac porttitor ac, sagittis      quis libero. Vivamus nibh metus, ornare vel pulvinar nec, fringilla nec        orci. Maecenas mollis nulla a nibh fringilla nec convallis augue varius.       Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere      cubilia Curae. \\     \hline     \end{longtable}          \end{document}      I'd like to have second header on page 3. I do not control table contents, so I can not do page breaks manually.


title: Hyphenation in listings captions doesn't work correctly

text: I have the problem that automatic hyphenation in listings caption doesn't work if automatic linebreaking is activated. It works if I set `breaklines=false` or `captionpos=t`, which is weird. Is there a workaround? I want to have captions at the bottom and I need automatic line-breaking.               \documentclass{article}     \usepackage[english]{babel}          \usepackage{listings}          \lstset{        breaklines=true,        captionpos=b     }          \begin{document}          \begin{lstlisting}[caption={information information information information information information information}]     A = B     C = D     \end{lstlisting}          \end{document}      `captionpos=b` (WRONG): ![enter image description here](http://i.stack.imgur.com/JyDnK.png) `captionpos=t` (correct): ![enter image description here](http://i.stack.imgur.com/OnUng.png)


title: How to create this matrix in LaTeX?

text: I want to create the following picture in LaTeX. How can I do this?![enter image description here](http://i.stack.imgur.com/ds6In.jpg)


title: Combine europecv document class with KOMA-script letter scrlttr2

text: I use the document class `europecv` to write my CV. I want to add a letter before the actual CV, most preferable with the `scrlttr2` KOMA-script document class. Is there a way to load the KOMA-script document class `scrlttr2` as a package, or can anyone recommend another way of having both - a CV and a letter - in the same document?


title: TikZ: Text becomes invisible in large PDF

text: I am attempting to create a family tree in TikZ, containing an excessive number of nodes. Given the fact that everything should be visible, it is currently 9 layers high and around 70 layers wide. Increasing the width to 71 layers results in **everything** being **invisible**! One can still mark and copy the content, but not see it. I tried to cover the problem in a minimal example:               \documentclass[border=0pt]{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}          \node[fill=black, minimum height = 30cm, minimum width=10cm] (A) at (0, 0){};          \node[fill=black, minimum height = 30cm, minimum width=10cm] (B) at (490,0){};          \end{tikzpicture}     \end{document}      This example should create a PDF with two black boxes in the left / right side. Increasing the x component of the second box from 490 to 500 results in both boxes being invisible. I am using TeXnicCenter 2.0 with the `LaTeX -> PDF` setting and pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9). The compilation does not print any errors (such as _Dimension too large_ ), but the problem is not reproducable on some machines (however, I could reproduce it on three machines with the above configurations). What could cause this problem? Any help would be appreciated!


title: Enumerate level 2 reference format

text: In the following example, when I refer the `enumerate` level 2, it comes out 2a instead of 2 (a). How can I change that?               \begin{document}          \maketitle          \begin{abstract}          \end{abstract}          \section{}          \begin{enumerate}      \item Iadfagas      \item adf      \begin{enumerate}      \item \label{item:a} af a      \item \label{item:aa} asd      \item \label{item:b} asfa      \item \label{item:c} af a     \end{enumerate}     \end{enumerate}               \ref{item:a} follows from Proposition     \end{document}