Adjustbox inside table/figure environment

\documentclass{report}
\usepackage{tikz}
\usepackage{adjustbox}      
\usepackage{filecontents}

\begin{document}
\begin{filecontents}{asso.tex}
\begin{tikzpicture}

\end{tikzpicture}
\end{filecontents}

\begin{figure}
\centering
\adjustbox{max width=\linewidth}{\include{asso}}
%\include{asso}
\end{figure}
\end{document}

 

 


From: https://tex.stackexchange.com/q/125342

Advertisements

LaTeX如何正确输入引号:双引号“”单引号‘’

转自:http://blog.sina.com.cn/s/blog_5e16f1770100gusb.html

最近看一些latex用户的文章,输入的双引号和单引号都是用输入法中的中文模式键入,并不是LaTeX的正确输入方式。
正确的输入方法如下:
使用键盘的 Tab键上侧的LaTeX技巧218:LaTeX如何正确输入引号:双引号“”单引号‘’连续键入两个然后输入键盘的两个单引号。单引号输入类似。示例如下:
LaTeX技巧218:LaTeX如何正确输入引号:双引号“”单引号‘’

演示代码:
    \documentclass{article}
   \setlength \textwidth{150pt}
   \begin{document}
   \large
   Pumas are “large, cat-like animals” which are `found in America’. When reports came into London Zoo that a wild puma had been spotted forty-five miles south of London, they were not taken seriously. However, as the evidence began to accumulate, experts from the Zoo felt obliged to investigate, for the descriptions given by people who claimed to have seen the puma were extraordinarily similar.
       \end{document}

 


http://blog.sina.com.cn/s/blog_5e16f1770100gusb.html

How to remove space after image caption

A quick way would be to use \vspace{} with negative length as input. However, this is not the right approach and is not recommended for use.

Without using vspace the output would look like: without vspace

Here is a MWE with vspace and negative length as input followed by the output.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{xcolor} 

\begin{document}

 \begin{figure}[!ht]
  \centering
  \includegraphics[width=0.5\textwidth]{image}                   
  \vspace{-1em}
  \caption{\textcolor{gray}{\footnotesize \textit{ImageCaption}}}
  \vspace{-1.5em}
  \end{figure}
   This is first text after caption.

\end{document}

Note how the use of vspace after the figure and after the caption shrinks the space.

with vpsace

 


https://tex.stackexchange.com/a/100131

Placing a figure inside a multirow table cell

or those wondering how to put images in tables in general, the salient point is the bracketed fixup after the {*} in \multirow:

\multirow{2}{*}[fixup]{\includegraphics[width=2in]{...}}

For example:

\multirow{2}{*}[0.5in]{\includegraphics[width=2in]{...}}

By adjusting the fixup you can avoid Latex’s default behavior of putting the image way too low in the table.

 

 

 


https://tex.stackexchange.com/a/182609

 

foreign command atop frack or genfrac should be used instead(amsmath)

Using \atop is abusing its functionality; if you want to turn a screw, sometimes a knife can help, but a screwdriver is surely better.

In other words, use \substack that has been specifically defined for this task and can accommodate any number of lines. It’s also easier to use even for two lines.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
\sum_{1\le i\le n\atop i\ne j}\quad
\sum_{\scriptstyle 1\le i\le n\atop\scriptstyle i\ne j}\quad
\sum_{\substack{1\le i\le n\\ i\ne j}}
\]
\end{document}

 

The first is wrong; the second is complicated to write. With \substack you also avoid the warning

Package amsmath Warning: Foreign command \atop;
(amsmath)                \frac or \genfrac should be used instead
(amsmath)                 on input line 6.

 

 


https://tex.stackexchange.com/questions/153490/atop-vs-substack-for-multiple-lines-under-a-sum/153502