As of  we can crop images by using something like \documentclass{article}  \usepackage{graphicx}  \begin{document} % trim from left edge \includegraphics[trim={5cm 0 0 0},clip]{myImage.pdf} \end{document}  in order to crop away the left 5cm of our example image. In my example it would be really neat if I could use relative crop directions instead of absolute ones (e.g. crop a way 10% from the left, 25% from the top, etc.). Is this possible? And if so: how? Unfortunately the documentation of the graphicx package is not very verbose when it comes to the trim option (at least as far as I have found). In case it's relevant: I am looking for an option that works with PDF files included as images.  Note that I found  that explains how the effect can be achieved by using a savebox to query the image's dimension first. I am hoping for a solution where this is automated in the background so I don't have to do this every time...
I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade).
Why am I getting rounded faces when combining Edge Split and Subsurf? What's going on here? I'm trying to apply a normal edge split with a subdivision to make it look high poly with good edges. But when I applied it on this model it did this. Retail boxed Steam activated games: can they be resold? I recently purchased retail boxed versions of   Dead Island (which is awesome) Warhammer 40k: Space Marine (not so much)   I finished both games and I was thinking of reselling them or giving them to a friend to play. However, these are both Steam activated games that had a required Steam registration code I had to enter -- and validate on Steam -- as part of the installation.  If I give these games to a friend or resell them, will they even work? Is the registration code single use and tied to a single person / computer / Steam account? I've created a Lightning component to view key details for the Account and Contact lookups from a Case, like so:    The problem is, I have been unable to get field content to render when  using the &lt;force:inputField/&gt; or &lt;force:outputField/&gt; components when I place them inside the markup to style them as cards. I've used &lt;ui:outputText/&gt; as a workaround, but that means I don't get any of the built-in behaviors I would get with the &lt;force:*Field/&gt; components -- like Lightning styling, which means I have to manually do it using SLDS.  This displays the contact name as expected:  &lt;aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="LightningCaseTestController"&gt;   &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}" /&gt;   &lt;aura:attribute name="recordId" type="Id" /&gt;   &lt;aura:attribute name="contact" type="Contact" default="{sobjectType: 'Contact'}"/&gt;    &lt;force:outputField value="{!v.contact.Name}"/&gt;   &lt;force:inputField value="{!v.contact.Name}"/&gt;  &lt;/aura:component&gt;   This does not:  &lt;aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="LightningCaseTestController"&gt;   &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}" /&gt;   &lt;aura:attribute name="recordId" type="Id" /&gt;   &lt;aura:attribute name="contact" type="Contact" default="{sobjectType: 'Contact'}"/&gt;    &lt;article&gt;     &lt;force:outputField value="{!v.contact.Name}"/&gt;     &lt;force:inputField value="{!v.contact.Name}"/&gt;   &lt;/article&gt;  &lt;/aura:component&gt;   Basically, it appears that as soon as any markup is placed around the &lt;force:*Field/&gt; tags -- even just a &lt;div&gt; -- they no longer render. Examples in Trailhead and other places all seem to use &lt;ui:outputText/&gt; or &lt;ui:input*/&gt;.  This seems like a lot of extra manual work. Am I missing something?  Update: it only fails when the component is included in a Lightning page -- such as the record detail page -- from Lightning App Builder. If I add it to a simple Lightning app, it works:  &lt;aura:application &gt;     &lt;c:LightningCaseTest recordId="SOMECASEID" /&gt; &lt;/aura:application&gt;   So it appears to be a bug? What's the cleanest, most effective way to validate decimal numbers in JavaScript?  Bonus points for:   Clarity. Solution should be clean and simple. Cross-platform.   Test cases:  01. IsNumeric('-1')      =&gt; true 02. IsNumeric('-1.5')    =&gt; true 03. IsNumeric('0')       =&gt; true 04. IsNumeric('0.42')    =&gt; true 05. IsNumeric('.42')     =&gt; true 06. IsNumeric('99,999')  =&gt; false 07. IsNumeric('0x89f')   =&gt; false 08. IsNumeric('#abcdef') =&gt; false 09. IsNumeric('1.2.3')   =&gt; false 10. IsNumeric('')        =&gt; false 11. IsNumeric('blah')    =&gt; false Show that if $ab$ has finite order $n$, then $ba$ also has order $n$. - Fraleigh p. 47 6.46. Attempted proof based on  and .  Given: $a,b$ elements of $G$, and $ab$ has finite order $n$.   Hence $\color{magenta}{|ab| = n} \iff (ab)^n = e$.   I must prove that $n$ is the smallest positive integer        such that $(ba)^n = e.$ Notice:  $\begin{align}(\color{darkorange}{a}\color{darkcyan}{b})^n &amp;= e \implies \color{darkorange}{a}\color{darkcyan}{b}(ab)^{n-1} = e \implies  \color{darkcyan}{b}(ab)^{n-1}\color{darkorange}{a} = e \implies (ba)^n = e \end{align} $ $\implies |ba| \le n$.  Now I must prove that there's no positive integer $m$ such that $m&lt;n$ and $(ba)^m = e.$ For a proof by contradiction, suppose $|ba|&lt;\color{magenta}{n}$. Then we could apply the same reasoning to find that $ |ab| ≤ |ba| &lt; \color{magenta}{|ab|}$,  which is absurd. So $|ba| = |ab| = n. \quad \blacksquare$  Questions   Whence does $ |ab| ≤ |ba| $ arise, in the second last line?   What's the intuition of the claim proved?    How do you prognosticate that $|ba|&lt;\color{magenta}{n}$ is impossible, and that you should prove it by contradiction? Get Age of a person in MySQL Inner product of two continuous maps is continuous Let f,g be continuous maps of S in $\mathbb{R}^n$, to $\mathbb{R}^m$. Show the inner product h(x) = $\langle f(x), g(x)\rangle$ is continuous.  My attempt: Since f,g are continuous, their product is a continuous mapping, so for $\epsilon \gt 0\: t.e\:  \delta \gt 0$ such that $\parallel x - a\parallel \lt \delta $ implies $\parallel \langle f(x),g(x)\rangle - \langle f(a)g(a)\rangle \parallel \le\parallel f(x)g(x) - f(a)g(a)\parallel \lt \epsilon$ by schwartz inequality. QR factorization of complex matrix If you have two complex numbers $a,b$ how can you find the QR factorization of   $ M = \begin{bmatrix}        aI_n\\          bI_n \end{bmatrix} $,  I can't seem to be able to do it. I tried an earlier trick, but I now know it's not necessary true for complex numbers. Is there anyway to do this?  I think if I use a Givens algorithm I should be able to reduce it to a QR factorization. How do I update Ubuntu manually? I wanted to update Ubuntu manually, because I used CDMA USB modem and connected using wvdial, but it won't able to update Ubuntu via Update Manager, because my Ubuntu won't showing "Connected" message via network-manager.  Can I update Ubuntu manually? Am I should download separate files, or use terminal instead? I play D&amp;D 5e and sometimes come here with questions. But sometimes I see things referenced here as sources that I don't have or aren't aware of....  Which are the "official rules" for D&amp;D 5e, and where do I find them? How to run scripts every 5 seconds? Use induction to prove a product of sums of squares is a sum of squares Assume I have the following list:  foo = ['a', 'b', 'c', 'd', 'e']   What is the simplest way to retrieve an item at random from this list? Can someone give a simple explanation as to why the       $$\sum_{n=1}^\infty\frac1n=\frac 1 1 + \frac 12 + \frac 13 + \cdots $$   doesn't converge, on the other hand it grows very slowly?   I'd prefer an easily comprehensible explanation rather than a rigorous proof regularly found in undergraduate textbooks. My PC was working yesterday without any problem. I shut it down and tried to open this morning. It prints out these messages on the black screen:  systemd-udevd[713]: failed to execute '/bin/systemctl' '/bin/systemctl start --no-block nvidia-persistenced.service': No such file or directory  systemd-udevd[852]: failed to execute '/bin/systemctl' '/bin/systemctl stop--no-block nvidia-persistenced': No such file or directory   It then continued with the login screen. I entered my password and pressed enter. It waited for a while and the login screen reappeared again.  How can I fix the problem? Does IBIS reduce image resolution? How does it compare to lens based IS? What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type?  Let's say I have an object o. How do I check whether it's a str? I'm trying to prove that for $p,q&gt;0$, we have $$\int_0^1t^{p-1}(1-t)^{q-1}\,dt=\frac{\Gamma(p)\Gamma(q)}{\Gamma(p+q)}.$$    The hint given suggests that we express $\Gamma(p)\Gamma(q)$ as a double integral, then do a change of variables, but I've been unable thus far to express it as a double integral.  Can anyone get me started or suggest an alternate approach?  Note: This wasn't actually given to me as the $\Gamma$ function, just as a function $f$ satisfying $$f(p)=\int_0^\infty e^{-t}t^{p-1}\,dt$$ for all $p&gt;0$, but I recognized that. This is in the context of an advanced calculus practice exam. natbib and hyperref create by default two links to the bibentry in the reference section|chapter of the document:   \begin{filecontents}{\jobname.bib} @book{author08, title = {{A Title}}, publisher = {Alpha}, year = {2008}, author = {Author, A}, address = {London} } @book{buthor90, title = {{B Title}}, publisher = {Bravo}, year = {1990}, editor = {Buthor, B}, address = {New York} } \end{filecontents}  \documentclass{article}  \usepackage{natbib} \usepackage{hyperref} \hypersetup{colorlinks,citecolor=red}  \begin{document}  \noindent citet: \citet{author08}, \citet[see][p. 20]{author08} \\ citep: \citep{author08}, \citep[see][p. 20]{author08}  \bibliographystyle{plainnat} \bibliography{\jobname}  \end{document}     In order to avoid two links to the bibliography (one for the [author] and one for the year [year], respectively), I took  to an older question and added it to my preamble.  \usepackage{etoolbox} \makeatletter  \pretocmd{\NAT@citex}{%   \let\NAT@hyper@\NAT@hyper@citex   \def\NAT@postnote{#2}%   \setcounter{NAT@total@cites}{0}%   \setcounter{NAT@count@cites}{0}%   \forcsvlist{\stepcounter{NAT@total@cites}\@gobble}{#3}}{}{} \newcounter{NAT@total@cites} \newcounter{NAT@count@cites} \def\NAT@postnote{}  % include postnote and \citet closing bracket in hyperlink \def\NAT@hyper@citex#1{%   \stepcounter{NAT@count@cites}%   \hyper@natlinkstart{\@citeb\@extra@b@citeb}#1%   \ifnumequal{\value{NAT@count@cites}}{\value{NAT@total@cites}}     {\ifNAT@swa\else\if*\NAT@postnote*\else%      \NAT@cmt\NAT@postnote\global\def\NAT@postnote{}\fi\fi}{}%   \ifNAT@swa\else\if\relax\NAT@date\relax   \else\NAT@@close\global\let\NAT@nm\@empty\fi\fi% avoid compact citations   \hyper@natlinkend} \renewcommand\hyper@natlinkbreak[2]{#1}  % avoid extraneous postnotes, closing brackets \patchcmd{\NAT@citex}   {\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi    \if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{}{}{} \patchcmd{\NAT@citex}   {\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@close\fi}   {\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@space\fi}{}{}  \makeatother     Which gets me almost where I want to be, but leaves me with two issues I would like to be solved:   while \citet includes pre- and postnotes in the link, \citep doesn't. How can \citep be changed to include postnotes? is there a way to color the brackets and commas that are typeset in black in the unmodified first example also in black in the modified second example without removing them from the link? How can I copy from Tmux terminal and paste it other application in my OS? I am using tmux on ubuntu. I read this  for copy and paste inside tmux. But I would like to know how can I copy from TMUX terminal and paste it to other application e.g browser in my OS?